Author: julianfoad
Date: Thu Aug 21 15:47:37 2014
New Revision: 1619452

URL: http://svn.apache.org/r1619452
Log:
Fix the copy-from revision number reported in a diff header. It previously
reported 'nonexistent' instead of the copy-from revision in some cases.

This bug seems to be a regression; 1.8.x releases show the correct revision.

* subversion/libsvn_client/diff.c
  (diff_file_added, diff_dir_added): Pass on the copy-from revision number.

* subversion/tests/cmdline/diff_tests.py
  (diff_git_format_wc_wc,
   diff_local_copied_dir): Update the expected output.

Modified:
    subversion/trunk/subversion/libsvn_client/diff.c
    subversion/trunk/subversion/tests/cmdline/diff_tests.py

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1619452&r1=1619451&r2=1619452&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Thu Aug 21 15:47:37 2014
@@ -1027,7 +1027,7 @@ diff_file_added(const char *relpath,
   else if (copyfrom_source && right_file)
     SVN_ERR(diff_content_changed(&wrote_header, relpath,
                                  left_file, right_file,
-                                 DIFF_REVNUM_NONEXISTENT,
+                                 copyfrom_source->revision,
                                  right_source->revision,
                                  svn_prop_get_value(left_props,
                                                     SVN_PROP_MIME_TYPE),
@@ -1190,7 +1190,8 @@ diff_dir_added(const char *relpath,
                          scratch_pool));
 
   return svn_error_trace(diff_props_changed(relpath,
-                                            DIFF_REVNUM_NONEXISTENT,
+                                            copyfrom_source ? 
copyfrom_source->revision
+                                                            : 
DIFF_REVNUM_NONEXISTENT,
                                             right_source->revision,
                                             prop_changes,
                                             left_props,

Modified: subversion/trunk/subversion/tests/cmdline/diff_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/diff_tests.py?rev=1619452&r1=1619451&r2=1619452&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/diff_tests.py Thu Aug 21 15:47:37 
2014
@@ -3215,7 +3215,7 @@ def diff_git_format_wc_wc(sbox):
 
   expected_output = make_git_diff_header(
                          alpha_copied_path, "A/B/E/alpha_copied",
-                         "nonexistent", "working copy",
+                         "revision 1", "working copy",
                          copyfrom_path="A/B/E/alpha",
                          copyfrom_rev='1', cp=True,
                          text_changes=True) + [
@@ -4809,9 +4809,7 @@ def diff_local_copied_dir(sbox):
     expected_output_C3 = [
       'Index: C3\n',
       '===================================================================\n',
-      '--- C3  (nonexistent)\n',  ### This is the present display, but really
-                                   ### it should show the copy-from:
-                                   ### "(revision 1)"
+      '--- C3  (revision 2)\n',
       '+++ C3  (working copy)\n',
       '\n',
       'Property changes on: C3\n',


Reply via email to