[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: more wc-ng node revision differences that affect 'svn diff'

From: Stefan Sperling <stsp_at_elego.de>
Date: Sun, 18 Oct 2009 23:49:52 +0200

On Sun, Oct 18, 2009 at 11:32:51PM +0200, Stefan Sperling wrote:
> On Sun, Oct 18, 2009 at 05:06:25PM -0400, Greg Stein wrote:
> > Euh... why not fix it before committing?
>
> Cause I didn't have much hope of fixing it as I'm barely scratching
> WC-NG on the surface. But OK, I'll try fixing it. So it should be r2
> or r3, let's see...

Turns out the rev in the diff header does not depend on the rev recorded
in the WC. Note how foo has rev 3 in BASE:

$ sqlite3 .svn/wc.db .dump | grep foo
INSERT INTO "BASE_NODE" VALUES(1,'foo',1,'foo','','normal','file',3,'$md5 $c1e83ac2a8724d11fb85025f7bd5d807',8,3,1255892725685633,'jrandom','infinity',NULL,1255892725151491,NULL,NULL,NULL,NULL);
INSERT INTO "WORKING_NODE" VALUES(1,'foo','','base-deleted','file','$md5 $c1e83ac2a8724d11fb85025f7bd5d807',8,3,1255892725685633,'jrandom','infinity',NULL,NULL,NULL,NULL,NULL,NULL,1255892725151491,X'2829',0);

And how we can have fun controlling diff output from the command line:
$ svn diff -r1:BASE
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 1)
@@ -0,0 +1,2 @@
+xxx
+yyy
$ svn diff -r2:BASE
Index: foo
===================================================================
--- foo (revision 2)
+++ foo (working copy)
@@ -1 +1,2 @@
 xxx
+yyy

The above two don't align well, the following are more consistent:

$ svn diff -rBASE:1
Index: foo
===================================================================
--- foo (working copy)
+++ foo (revision 1)
@@ -1,2 +0,0 @@
-xxx
-yyy
$ svn diff -rBASE:2
Index: foo
===================================================================
--- foo (working copy)
+++ foo (revision 2)
@@ -1,2 +1 @@
 xxx
-yyy

To recap, this is what the first failing test was doing:

CMD: svn diff -r 1:BASE --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.367387>
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 1)
@@ -0,0 +1,2 @@
+xxx
+yyy
EXPECTED STDOUT:
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 3)
@@ -0,0 +1,2 @@
+xxx
+yyy

No idea so far why my change caused this, though.
In any case, it might not even be a bug, and even if it is,
it's likely not a bug in WC-NG.

Stefan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2408737
Received on 2009-10-18 23:50:01 CEST

This is an archived mail posted to the Subversion Dev mailing list.