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

RE: [PATCH] enhance svn diff by adding --diff-copy-from switch

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Mon, 29 Nov 2010 11:09:41 +0000

On Sun, 2010-11-28, Prabhu Gnana Sundar Ponnarasu wrote:
> [[[
> Make svn diff to accept "--diff-copy-from" inorder to compare/diff
> against the copy-source file.

Hi Prabhu.

I'm not clear about the precise change in behaviour that you are making.
The current behaviour of "svn diff" seems to be to show the difference
against the copy source in some cases, but not in other cases:

[[[
$ svn log -vq -c1029240
[...]
   A /subversion/trunk/subversion/tests/libsvn_wc/utils.h (from /subversion/trunk/subversion/tests/svn_test_utils.h:1029227)

$ svn diff -r1029227:1029240 subversion/tests/libsvn_wc/utils.h
Index: subversion/tests/libsvn_wc/svn_test_utils.h
===================================================================
--- subversion/tests/libsvn_wc/svn_test_utils.h (.../svn_test_utils.h) (revision 1029227)
+++ subversion/tests/libsvn_wc/svn_test_utils.h (.../libsvn_wc/utils.h) (revision 1029240)
@@ -1,7 +1,7 @@
-/* svn_test_utils.h --- test utilities
+/* utils.h --- wc/client test utilities
[...]

$ svn diff -r1029227:1029240 subversion/tests/
Index: subversion/tests/svn_test_utils.h
===================================================================
--- subversion/tests/svn_test_utils.h (revision 1029227)
+++ subversion/tests/svn_test_utils.h (revision 1029240)
@@ -1,64 +0,0 @@
-/* svn_test_utils.h --- test utilities
[...]
Index: subversion/tests/libsvn_wc/utils.h
===================================================================
--- subversion/tests/libsvn_wc/utils.h (revision 0)
+++ subversion/tests/libsvn_wc/utils.h (revision 1029240)
@@ -0,0 +1,64 @@
+/* utils.h --- wc/client test utilities
[...]
]]]

The current doc strings do not appear to describe this. I think it is
important that we clarify what the current behaviour is - in other
words, what the new behaviour will be when --diff-copy-from is not
present or when diff_copy_from = FALSE. Can you help by describing
that?

Do we have a way to request the opposite behaviour - to show a diff in
which a copy is *never* diffed against its source? Is that what the
"--show-copies-as-adds" option and show_copies_as_adds API flag does?
If so, then the doc strings need to mention how these two relate: for
example, are they mutually exclusive or does one override the other?

[...]
> Index: subversion/svn/main.c
> ===================================================================
> + {"diff-copy-from", opt_diff_copy_from, 0,
> + N_("print copy history of files")},

We can probably find some better words to describe this option.
Perhaps, "always diff a copied file against its source".

> Index: subversion/include/svn_client.h
> ===================================================================
> + * If @a diff_copy_from is TRUE, then the diff output will be generated
> + * with respect to the copy-source.

Otherwise, ... what? If we don't say, then the reader might naturally
assume that the diff output would be generated as a delete and an add,
but that is not always the case.

> + * If @a diff_copy_from is TRUE, then the diff output will be generated
> + * with respect to the copy-source.

Same.

> Index: subversion/include/svn_ra.h
> ===================================================================
> + * Pass TRUE to @a diff_copy_from to do the diff against the copy-source.

Same question, but I don't know if the answer is the same here.

> Index: subversion/libsvn_client/client.h
> ===================================================================
> @@ -644,6 +644,7 @@
> + svn_boolean_t diff_copy_from,
> Index: subversion/libsvn_ra_serf/ra_serf.h
> ===================================================================
> @@ -1245,6 +1245,7 @@
> + svn_boolean_t diff_copy_from,
> Index: subversion/libsvn_ra_neon/ra_neon.h
> ===================================================================
> @@ -349,6 +349,7 @@
> + svn_boolean_t diff_copy_from,

The new parameter needs to be mentioned in the doc strings of these
APIs.

- Julian
Received on 2010-11-29 12:11:22 CET

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