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

svn diff -r WORKING:HEAD

From: Kyle McKay <mackyle_at_tigris.org>
Date: 2007-03-19 21:26:38 CET

How does one get the equivalent of svn diff -r working:head output?

There doesn't seem to be a way.

Consider the following:

Foo.txt Revision 1:

Line 1
Line 2
Line 3

Foo.txt Revision 1 is checked out and the working copy of Foo.txt is
changed to:

Line 1
Line 2
Line 2.5
Line 3

Meanwhile, elsewhere Revision 2 is checked in with Foo.txt Revision 2:

Line 1
Line 2
Line 3
Line 4
Line 5

Now for the purposes of this discussion, svn diff is being executed
in the working copy of the modified revision 1.

"svn diff" produces:

Index: foo.txt
===================================================================
--- foo.txt (revision 1)
+++ foo.txt (working copy)
@@ -1,3 +1,4 @@
Line 1
Line 2
+Line 2.5
Line 3

"svn diff -r HEAD" produces:

Index: foo.txt
===================================================================
--- foo.txt (revision 2)
+++ foo.txt (working copy)
@@ -1,5 +1,4 @@
Line 1
Line 2
+Line 2.5
Line 3
-Line 4
-Line 5

"svn diff -r BASE:HEAD" produces:

Index: foo.txt
===================================================================
--- foo.txt (working copy)
+++ foo.txt (revision 2)
@@ -1,3 +1,5 @@
Line 1
Line 2
Line 3
+Line 4
+Line 5

But really, the output I want to see is this (which is the set
of changes needed to change my working copy into HEAD):

Index: foo.txt
===================================================================
--- foo.txt (working copy)
+++ foo.txt (revision 2)
@@ -1,5 +1,4 @@
Line 1
Line 2
-Line 2.5
Line 3
+Line 4
+Line 5

And there doesn't seem to be any way to generate that. That seems to
be a bug to me.

One obvious way to fix it is to add this sequence:

   else if (strcasecmp(word, "working") == 0)
     {
       revision->kind = svn_opt_revision_working;
     }

to the revision_from_word function located in libsvn_subr/opt.c file
which then permits "svn diff -r WORKING:HEAD" to produce the desired
output. Of course that also means that all other commands would
start accepting "WORKING" as a revision. That may not be a bad
thing, but it's unclear to me what other ramifications it will have.

Would it be possible to get an issue opened for this so that it can
be tracked?

Thanks,

Kyle

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 19 21:26:56 2007

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