subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1424506 - in /subversion/trunk/subversion: libsvn_client/diff.c tests/cmdline/diff_tests.py
Date Thu, 20 Dec 2012 15:00:25 GMT
Author: rhuijben
Date: Thu Dec 20 15:00:25 2012
New Revision: 1424506

URL: http://svn.apache.org/viewvc?rev=1424506&view=rev
Log:
Resolve issue #4010 for files by reporting the per node BASE revision instead
of the global diff base revision for property changes on files.

This change can not simply be applied for directories, as the diff callback
infrastructure doesn't pass the revision in this case.
(This requires a major round of api revving)

* subversion/libsvn_client/diff.c
  (diff_props_changed): Add two revision arguments, to allow passing revisions
    for the diff headers.
  (diff_dir_props_changed): Update caller. Pass baton values.

  (diff_file_changed,
   diff_file_added): Update caller. Pass reported revisions.

  (arbitrary_diff_walker): Update caller. Pass baton values.

* subversion/tests/cmdline/diff_tests.py
  (diff_git_with_props): Expect node revision.
  (diff_correct_wc_base_revnum): Remove XFail marker.
  (diff_properties_no_newline): Expect node revision.

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=1424506&r1=1424505&r2=1424506&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Thu Dec 20 15:00:25 2012
@@ -613,6 +613,8 @@ static svn_error_t *
 diff_props_changed(svn_wc_notify_state_t *state,
                    svn_boolean_t *tree_conflicted,
                    const char *path,
+                   svn_revnum_t rev1,
+                   svn_revnum_t rev2,
                    svn_boolean_t dir_was_added,
                    const apr_array_header_t *propchanges,
                    apr_hash_t *original_props,
@@ -642,8 +644,8 @@ diff_props_changed(svn_wc_notify_state_t
       SVN_ERR(display_prop_diffs(props, original_props, path,
                                  diff_cmd_baton->orig_path_1,
                                  diff_cmd_baton->orig_path_2,
-                                 diff_cmd_baton->revnum1,
-                                 diff_cmd_baton->revnum2,
+                                 rev1,
+                                 rev2,
                                  diff_cmd_baton->header_encoding,
                                  diff_cmd_baton->outstream,
                                  diff_cmd_baton->relative_to_dir,
@@ -686,6 +688,10 @@ diff_dir_props_changed(svn_wc_notify_sta
 
   return svn_error_trace(diff_props_changed(state,
                                             tree_conflicted, path,
+                                            /* ### These revs be filled
+                                             * ### with per node info */
+                                            diff_cmd_baton->revnum1,
+                                            diff_cmd_baton->revnum2,
                                             dir_was_added,
                                             propchanges,
                                             original_props,
@@ -952,7 +958,7 @@ diff_file_changed(svn_wc_notify_state_t 
                                  SVN_INVALID_REVNUM, diff_cmd_baton));
   if (prop_changes->nelts > 0)
     SVN_ERR(diff_props_changed(prop_state, tree_conflicted,
-                               path, FALSE, prop_changes,
+                               path, rev1, rev2, FALSE, prop_changes,
                                original_props, diff_cmd_baton, scratch_pool));
   if (content_state)
     *content_state = svn_wc_notify_state_unknown;
@@ -1025,7 +1031,8 @@ diff_file_added(svn_wc_notify_state_t *c
                                  diff_cmd_baton));
   if (prop_changes->nelts > 0)
     SVN_ERR(diff_props_changed(prop_state, tree_conflicted,
-                               path, FALSE, prop_changes,
+                               path, rev1, rev2,
+                               FALSE, prop_changes,
                                original_props, diff_cmd_baton, scratch_pool));
   if (content_state)
     *content_state = svn_wc_notify_state_unknown;
@@ -1877,6 +1884,8 @@ arbitrary_diff_walker(void *baton, const
                              scratch_pool));
       if (prop_changes->nelts > 0)
         SVN_ERR(diff_props_changed(NULL, NULL, child_relpath,
+                                   b->callback_baton->revnum1,
+                                   b->callback_baton->revnum2,
                                    b->recursing_within_added_subtree,
                                    prop_changes, original_props,
                                    b->callback_baton, scratch_pool));

Modified: subversion/trunk/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/diff_tests.py?rev=1424506&r1=1424505&r2=1424506&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/diff_tests.py Thu Dec 20 15:00:25 2012
@@ -3711,7 +3711,7 @@ def diff_git_with_props(sbox):
                     make_diff_prop_header("new") + \
                     make_diff_prop_added("svn:eol-style", "native") + \
                     make_git_diff_header(iota_path, "iota",
-                                         "revision 1", "working copy",
+                                         "revision 2", "working copy",
                                          text_changes=False) + \
                     make_diff_prop_header("iota") + \
                     make_diff_prop_added("svn:keywords", "Id")
@@ -3722,7 +3722,6 @@ def diff_git_with_props(sbox):
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
                                      '--git', wc_dir)
 
-@XFail()
 @Issue(4010)
 def diff_correct_wc_base_revnum(sbox):
   "diff WC-WC shows the correct base rev num"
@@ -4108,7 +4107,7 @@ def diff_properties_no_newline(sbox):
   # may not be predictable.)
   for pname, old_val, new_val in subtests:
     expected_output = \
-      make_diff_header("iota", "revision 1", "working copy") + \
+      make_diff_header("iota", "revision 2", "working copy") + \
       make_diff_prop_header("iota") + \
       make_diff_prop_modified(pname, old_val, new_val)
 



Mime
View raw message