[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: Mon, 19 Oct 2009 11:59:37 +0200

On Sun, Oct 18, 2009 at 11:49:52PM +0200, Stefan Sperling wrote:
> And how we can have fun controlling diff output from the command line:

This behaviour is encoded in libsvn_wc/diff.c:close_file().

> $ svn diff -r1:BASE
> Index: foo
> ===================================================================
> --- foo (revision 0)

We have hard-coded r0 for added files in libsvn_wc/diff.c:{file_diff,
report_wc_file_as_added,close_file}.
Since foo did not exist in r1, it is considered added.

> +++ 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

foo exists in r2, so in this case we see a diff.

> The above two don't align well,

In fact, when taking a closer look it all makes sense.

> the following are more consistent:

The "working copy" labels are caused by wc-ng correctly reporting
SVN_INVALID_REVNUM for the deleted node foo (it's deleted locally
in the WC).

> $ 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
>

> 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.

So turns out it's alright, at least in this test.
I'll check the other tests similarly, and if I don't see any problems,
I'll adjust the expected test output.

Stefan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2408894
Received on 2009-10-19 12:00:02 CEST

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