« Return to Thread: paths in diff output (possible bug)

paths in diff output (possible bug)

by Dmitry Pavlenko-2 :: Rate this Message:

| View in Thread

Hello all.
I'm trying to understand the principles how SVN calculates paths for diff.

I've put repository attached under URL "http://localhost/svn". I'll put its history here:
------------------------------------------------------------------------
r4 | dmit10 | 2012-03-19 20:34:31 +0100 (Пнд, 19 Мар 2012) | 2 lines
Changed paths:
   A /directory/subdirectory/file1
   A /directory/subdirectory/file2

files again

------------------------------------------------------------------------
r3 | dmit10 | 2012-03-19 20:33:55 +0100 (Пнд, 19 Мар 2012) | 2 lines
Changed paths:
   A /directory/subdirectory

subdirectory

------------------------------------------------------------------------
r2 | dmit10 | 2012-03-19 20:33:39 +0100 (Пнд, 19 Мар 2012) | 2 lines
Changed paths:
   A /directory

directory

------------------------------------------------------------------------
r1 | dmit10 | 2012-03-19 20:33:27 +0100 (Пнд, 19 Мар 2012) | 2 lines
Changed paths:
   A /file1
   A /file2

files

------------------------------------------------------------------------



 Then I run:

$ svn diff http://localhost/svn/directory/subdirectory@1 http://localhost/svn/directory/subdirectory@4

(note that neither "http://localhost/svn/directory/subdirectory" nor "http://localhost/svn/directory" exist in r1)

And I get

Index: subdirectory/file1
===================================================================
--- subdirectory/file1  (revision 0)
+++ subdirectory/file1  (revision 4)
@@ -0,0 +1 @@
+file1
Index: subdirectory/file2
===================================================================
--- subdirectory/file2  (revision 0)
+++ subdirectory/file2  (revision 4)
@@ -0,0 +1 @@
+file2-changed


i.e. all paths are relative to "http://localhost/svn/directory" that is strange for me. I tried to debug the code. All editor calls are relative to that path too ("add_file subdirectory/file1").

svn_ra_do_diff3 is called  with ra_session pointing to "http://localhost/svn", url2="http://localhost/svn/directory/subdirectory" and target="directory/subdirectory" (that contradicts svn_ra_do_diff3 documentation --- as I
understand it --- stating, that states that "diff_target is an optional single path component").

So I have some "yes-no" questions about that all:
1. Do I understand correctly that "target" parameter in svn_ra_do_diff3 should never contain '/'?
2. Is current diff output really expected (I'm about the paths, the files' content is correct) or is there a bug?
3. Is there any guarantee (suppose, all bugs are fixed if exist) about paths in diff output --- relative to what are they (expected to be)? As I understand, SVN wants to show them relative to the first ancestor of arguments
which exists in both revisions (in my example --- relative to "http://localhost/svn" because "http://localhost/svn/directory" and "http://localhost/svn/directory/subdirectory" do not exist in r1). Please, confirm or disprove. If
there's no guarantee, and it is just human-readable, it's ok too, but I would like to know.

Thanks.


diff.dump.gz (806 bytes) Download Attachment

 « Return to Thread: paths in diff output (possible bug)