You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Andy Whitcroft <ap...@shadowen.org> on 2004/01/26 15:48:37 UTC

svn diff header confusion

It appears that the 'svn diff' command can result in output in which the 
file headers within the diff are incorrect; the unified diff itself appears 
to be as expected.  I am therefore assuming this is a different issue to 
issue #1602.

In this recipe revision 0 (BASE) is an empty repository and revision 1 
(HEAD) contains a single file containing the word test (the full recipe to 
reproduce and the full output from all the possible diffs are included at 
the end of this email).
The working copy from which the diffs are requested is a checkout of 
revision 0.

If we examine the svn diff -r BASE:HEAD and HEAD:BASE outputs it is clear 
that the diffs cannot both be against the working copy (if either is) 
despite the fact that it is clearly labeled as such indeed they are the 
diff we would expect between the requested versions, the diff (further 
below) of the real working copy against BASE and HEAD support this.  It 
seems to me that BASE is being incorrectly reported as working copy.

+ svn diff -r BASE:HEAD
Index: file
===================================================================
--- file        (revision 0)
+++ file        (working copy)
@@ -0,0 +1 @@
+test
+ svn diff -r HEAD:BASE
Index: file
===================================================================
--- file        (revision 1)
+++ file        (working copy)
@@ -1 +0,0 @@
-test

Does this come under an existing issuse or should I file one.  Feel free to 
say 'stupid' that's because of 'foo' and expected behaviour.

Cheers.

-apw


[apw@kuckoo test2]$ cat T
rm -rf repo test test2
svnadmin create repo
svn checkout file:///`pwd`/repo test
svn checkout file:///`pwd`/repo test2
cd test
echo "test" >file
svn add file
svn -m test commit
cd ../test2
svn diff -r BASE:HEAD
svn diff -r HEAD:BASE
svn diff -r BASE
svn diff -r HEAD
svn diff -r 0:BASE
svn diff -r 0:HEAD
svn diff -r 0:1
svn diff -r 1:0
svn diff -r 0
svn diff -r 1
[apw@kuckoo test2]$ sh -x T
+ rm -rf repo test test2
+ svnadmin create repo
++ pwd
+ svn checkout file:////home/apw/test2/repo test
Checked out revision 0.
++ pwd
+ svn checkout file:////home/apw/test2/repo test2
Checked out revision 0.
+ cd test
+ echo test
+ svn add file
A         file
+ svn -m test commit
Adding         file
Transmitting file data .
Committed revision 1.
+ cd ../test2
+ svn diff -r BASE:HEAD
Index: file
===================================================================
--- file        (revision 0)
+++ file        (working copy)
@@ -0,0 +1 @@
+test
+ svn diff -r HEAD:BASE
Index: file
===================================================================
--- file        (revision 1)
+++ file        (working copy)
@@ -1 +0,0 @@
-test
+ svn diff -r BASE
+ svn diff -r HEAD
Index: file
===================================================================
--- file        (revision 1)
+++ file        (working copy)
@@ -1 +0,0 @@
-test
+ svn diff -r 0:BASE
+ svn diff -r 0:HEAD
Index: file
===================================================================
--- file        (revision 0)
+++ file        (revision 1)
@@ -0,0 +1 @@
+test
+ svn diff -r 0:1
Index: file
===================================================================
--- file        (revision 0)
+++ file        (revision 1)
@@ -0,0 +1 @@
+test
+ svn diff -r 1:0
Index: file
===================================================================
--- file        (revision 1)
+++ file        (revision 0)
@@ -1 +0,0 @@
-test
+ svn diff -r 0
+ svn diff -r 1
Index: file
===================================================================
--- file        (revision 1)
+++ file        (working copy)
@@ -1 +0,0 @@
-test
[apw@kuckoo test2]$


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn diff header confusion

Posted by Greg Hudson <gh...@MIT.EDU>.
Issue #1675 may be related to this problem.  (Or it might not, but
they're both related to "svn diff" as applied to an added file.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn diff header confusion

Posted by kf...@collab.net.
Andy Whitcroft <ap...@shadowen.org> writes:
> diff (further below) of the real working copy against BASE and HEAD
> support this.  It seems to me that BASE is being incorrectly reported
> as working copy.

Yup.  Can you file an issue on this, please?  (Or if you don't have
time, that's fine, just let us know and someone else can do it.)

By the way, when reporting a bug in diff output, you might want to
choose a prompt other than "+ " :-).

-Karl

> + svn diff -r BASE:HEAD
> Index: file
> ===================================================================
> --- file        (revision 0)
> +++ file        (working copy)
> @@ -0,0 +1 @@
> +test
> + svn diff -r HEAD:BASE
> Index: file
> ===================================================================
> --- file        (revision 1)
> +++ file        (working copy)
> @@ -1 +0,0 @@
> -test
> 
> Does this come under an existing issuse or should I file one.  Feel
> free to say 'stupid' that's because of 'foo' and expected behaviour.
> 
> Cheers.
> 
> -apw
> 
> 
> [apw@kuckoo test2]$ cat T
> rm -rf repo test test2
> svnadmin create repo
> svn checkout file:///`pwd`/repo test
> svn checkout file:///`pwd`/repo test2
> cd test
> echo "test" >file
> svn add file
> svn -m test commit
> cd ../test2
> svn diff -r BASE:HEAD
> svn diff -r HEAD:BASE
> svn diff -r BASE
> svn diff -r HEAD
> svn diff -r 0:BASE
> svn diff -r 0:HEAD
> svn diff -r 0:1
> svn diff -r 1:0
> svn diff -r 0
> svn diff -r 1
> [apw@kuckoo test2]$ sh -x T
> + rm -rf repo test test2
> + svnadmin create repo
> ++ pwd
> + svn checkout file:////home/apw/test2/repo test
> Checked out revision 0.
> ++ pwd
> + svn checkout file:////home/apw/test2/repo test2
> Checked out revision 0.
> + cd test
> + echo test
> + svn add file
> A         file
> + svn -m test commit
> Adding         file
> Transmitting file data .
> Committed revision 1.
> + cd ../test2
> + svn diff -r BASE:HEAD
> Index: file
> ===================================================================
> --- file        (revision 0)
> +++ file        (working copy)
> @@ -0,0 +1 @@
> +test
> + svn diff -r HEAD:BASE
> Index: file
> ===================================================================
> --- file        (revision 1)
> +++ file        (working copy)
> @@ -1 +0,0 @@
> -test
> + svn diff -r BASE
> + svn diff -r HEAD
> Index: file
> ===================================================================
> --- file        (revision 1)
> +++ file        (working copy)
> @@ -1 +0,0 @@
> -test
> + svn diff -r 0:BASE
> + svn diff -r 0:HEAD
> Index: file
> ===================================================================
> --- file        (revision 0)
> +++ file        (revision 1)
> @@ -0,0 +1 @@
> +test
> + svn diff -r 0:1
> Index: file
> ===================================================================
> --- file        (revision 0)
> +++ file        (revision 1)
> @@ -0,0 +1 @@
> +test
> + svn diff -r 1:0
> Index: file
> ===================================================================
> --- file        (revision 1)
> +++ file        (revision 0)
> @@ -1 +0,0 @@
> -test
> + svn diff -r 0
> + svn diff -r 1
> Index: file
> ===================================================================
> --- file        (revision 1)
> +++ file        (working copy)
> @@ -1 +0,0 @@
> -test
> [apw@kuckoo test2]$
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn diff header confusion

Posted by Ben Reser <be...@reser.org>.
On Mon, Jan 26, 2004 at 03:48:37PM +0000, Andy Whitcroft wrote:
> It appears that the 'svn diff' command can result in output in which the 
> file headers within the diff are incorrect; the unified diff itself appears 
> to be as expected.  I am therefore assuming this is a different issue to 
> issue #1602.
> 
> In this recipe revision 0 (BASE) is an empty repository and revision 1 
> (HEAD) contains a single file containing the word test (the full recipe to 
> reproduce and the full output from all the possible diffs are included at 
> the end of this email).
> The working copy from which the diffs are requested is a checkout of 
> revision 0.
> 
> If we examine the svn diff -r BASE:HEAD and HEAD:BASE outputs it is clear 
> that the diffs cannot both be against the working copy (if either is) 
> despite the fact that it is clearly labeled as such indeed they are the 
> diff we would expect between the requested versions, the diff (further 
> below) of the real working copy against BASE and HEAD support this.  It 
> seems to me that BASE is being incorrectly reported as working copy.
> 
> + svn diff -r BASE:HEAD
> Index: file
> ===================================================================
> --- file        (revision 0)
> +++ file        (working copy)
> @@ -0,0 +1 @@
> +test
> + svn diff -r HEAD:BASE
> Index: file
> ===================================================================
> --- file        (revision 1)
> +++ file        (working copy)
> @@ -1 +0,0 @@
> -test
> 
> Does this come under an existing issuse or should I file one.  Feel free to 
> say 'stupid' that's because of 'foo' and expected behaviour.

Looks like the same thing I reported in:
http://www.contactor.se/~dast/svn/archive-2003-12/1307.shtml
msgid: 20031223075138.GE7841@titanium.brain.org

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org