On 02/05/2013 01:14 PM, Stefan Sperling wrote:
On Tue, Feb 05, 2013 at 09:19:19AM -0800, Alexey Neyman wrote:
There is one more weird issue with svn diff, see the script below. The issue
is that "--old=A --new=B" is not opposite of "--old=B --new=A". I don't know
if it is a bug or another ambuguity I am not aware of :)

Here is the script:
[[[
#!/bin/bash

REPO=/tmp/foo
WC=/tmp/foo.wc

rm -rf $REPO $WC
svnadmin create $REPO
svn co -q file://$REPO $WC
cd $WC

echo r1 > a
svn add -q a
svn ci -q -m R1
echo r2 > a
svn ci -q -m R2
svn up -q -r 1
echo new > a
echo "Issue: --old=A --new=B is not opposite of --old=B --new=A"
echo "  Running: svn di --old=^/ --new=."
svn di --old=^/ --new=.
echo "  Running: svn di --old=. --new=^/"
svn di --old=. --new=^/
]]]

And here is the output (svn 1.7.6):
[[[
Issue: --old=A --new=B is not opposite of --old=B --new=A
   Running: svn di --old=^/ --new=.
Index: a
===================================================================
--- a   (.../file:///tmp/foo)   (revision 2)
+++ a   (working copy)
@@ -1 +1 @@
-r2
+new
   Running: svn di --old=. --new=^/
Index: a
===================================================================
--- a   (working copy)
+++ a   (.../file:///tmp/foo)   (revision 2)
@@ -1 +1 @@
-r1
+r2
]]]

Regards,
Alexey.
I can reproduce this with a trunk build. Can you please file an issue
for this? I'm not going to get to this right away. Thanks!


Here is the issue that I see:

The --old=. get's the workspace version of ., but --new get's the non-changed version of /.

So, I believe it is comparing "r1" with the r2 contents of "r2" and not comparing both workspace versions.

Rev    Contents
1        r1
2        r2
2*      new

2* only get's referenced when it is in the --old position,
2 get's used when its in the --new position.


Please correct me if I'm wrong about this, but that is what seems to be a logical reasoning behind that behavior.

Lathan

Reply via email to