subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1441076 - in /subversion/trunk/subversion: libsvn_client/merge.c tests/cmdline/merge_reintegrate_tests.py tests/cmdline/merge_tests.py tests/cmdline/merge_tree_conflict_tests.py
Date Thu, 31 Jan 2013 17:22:05 GMT
Author: rhuijben
Date: Thu Jan 31 17:22:04 2013
New Revision: 1441076

URL: http://svn.apache.org/viewvc?rev=1441076&view=rev
Log:
For merge targets that are skipped because one of their ancestors is
obstructed, notify a shadowed update style notification.

I wish I had this output before I started doing this merge work, as
it makes the tree conflict tests much easier to understand.

* subversion/libsvn_client/merge.c
  (record_skip): Allow notifying more actions as skip.

  (merge_file_opened): Notify missing root as skipped when receiving changes.
    Always record the path as skipped.
  (merge_file_changed,
   merge_file_added,
   merge_file_deleted): Use specific skip type.

  (merge_dir_opened): Notify missing root as skipped when receiving changes.
    Always record the path as skipped.
  (merge_dir_changed,
   merge_dir_added,
   merge_dir_deleted): Use specific skip type.

  (merge_node_absent): Update caller.

* subversion/tests/cmdline/merge_reintegrate_tests.py
  (reintegrate_on_shallow_wc): Tweak expected result.

* subversion/tests/cmdline/merge_tests.py
  (merge_skips_obstructions,
   merge_to_sparse_directories): Tweak expected results.

* subversion/tests/cmdline/merge_tree_conflict_tests.py
  (tree_conflicts_merge_edit_onto_missing,
   tree_conflicts_merge_del_onto_missing): Tweak expected results.

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/tests/cmdline/merge_reintegrate_tests.py
    subversion/trunk/subversion/tests/cmdline/merge_tests.py
    subversion/trunk/subversion/tests/cmdline/merge_tree_conflict_tests.py

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1441076&r1=1441075&r2=1441076&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Thu Jan 31 17:22:04 2013
@@ -1537,6 +1537,7 @@ static svn_error_t *
 record_skip(const merge_cmd_baton_t *merge_b,
             const char *local_abspath,
             svn_node_kind_t kind,
+            svn_wc_notify_action_t action,
             svn_wc_notify_state_t state,
             apr_pool_t *scratch_pool)
 {
@@ -1553,8 +1554,7 @@ record_skip(const merge_cmd_baton_t *mer
     {
       svn_wc_notify_t *notify;
 
-      notify = svn_wc_create_notify(local_abspath, svn_wc_notify_skip,
-                                    scratch_pool);
+      notify = svn_wc_create_notify(local_abspath, action, scratch_pool);
       notify->kind = kind;
       notify->content_state = notify->prop_state = state;
 
@@ -2071,8 +2071,15 @@ merge_file_opened(void **new_file_baton,
                 {
                   fb->shadowed = TRUE;
 
-                  /*db->tree_conflict_reason = CONFLICT_REASON_SKIP; */
+                  fb->tree_conflict_reason = CONFLICT_REASON_SKIP;
                   fb->skip_reason = svn_wc_notify_state_missing;
+
+                  if (merge_b->merge_source.ancestral
+                      || merge_b->reintegrate_merge)
+                    {
+                      store_path(merge_b->skipped_abspaths, local_abspath);
+                    }
+
                   return SVN_NO_ERROR;
                 }
             }
@@ -2198,6 +2205,7 @@ merge_file_changed(const char *relpath,
         {
           /* We haven't notified for this node yet: report a skip */
           SVN_ERR(record_skip(merge_b, local_abspath, svn_node_file,
+                              svn_wc_notify_update_shadowed_update,
                               fb->skip_reason, scratch_pool));
         }
 
@@ -2341,6 +2349,7 @@ merge_file_added(const char *relpath,
         {
           /* We haven't notified for this node yet: report a skip */
           SVN_ERR(record_skip(merge_b, local_abspath, svn_node_file,
+                              svn_wc_notify_update_shadowed_add,
                               fb->skip_reason, scratch_pool));
         }
 
@@ -2594,6 +2603,7 @@ merge_file_deleted(const char *relpath,
         {
           /* We haven't notified for this node yet: report a skip */
           SVN_ERR(record_skip(merge_b, local_abspath, svn_node_file,
+                              svn_wc_notify_update_shadowed_delete,
                               fb->skip_reason, scratch_pool));
         }
 
@@ -2774,8 +2784,15 @@ merge_dir_opened(void **new_dir_baton,
                 {
                   db->shadowed = TRUE;
 
-                  /*db->tree_conflict_reason = CONFLICT_REASON_SKIP; */
+                  db->tree_conflict_reason = CONFLICT_REASON_SKIP;
                   db->skip_reason = svn_wc_notify_state_missing;
+
+                  if (merge_b->merge_source.ancestral
+                      || merge_b->reintegrate_merge)
+                    {
+                      store_path(merge_b->skipped_abspaths, local_abspath);
+                    }
+
                   return SVN_NO_ERROR;
                 }
             }
@@ -2973,6 +2990,7 @@ merge_dir_changed(const char *relpath,
         {
           /* We haven't notified for this node yet: report a skip */
           SVN_ERR(record_skip(merge_b, local_abspath, svn_node_dir,
+                              svn_wc_notify_update_shadowed_update,
                               db->skip_reason, scratch_pool));
         }
 
@@ -3055,6 +3073,7 @@ merge_dir_added(const char *relpath,
         {
           /* We haven't notified for this node yet: report a skip */
           SVN_ERR(record_skip(merge_b, local_abspath, svn_node_dir,
+                              svn_wc_notify_update_shadowed_add,
                               db->skip_reason, scratch_pool));
         }
 
@@ -3190,6 +3209,7 @@ merge_dir_deleted(const char *relpath,
         {
           /* We haven't notified for this node yet: report a skip */
           SVN_ERR(record_skip(merge_b, local_abspath, svn_node_dir,
+                              svn_wc_notify_update_shadowed_delete,
                               db->skip_reason, scratch_pool));
         }
 
@@ -3298,7 +3318,7 @@ merge_node_absent(const char *relpath,
                                               relpath, scratch_pool);
 
   record_skip(merge_b, local_abspath, svn_node_unknown,
-              svn_wc_notify_state_missing, scratch_pool);
+              svn_wc_notify_skip, svn_wc_notify_state_missing, scratch_pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1441076&r1=1441075&r2=1441076&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_reintegrate_tests.py Thu Jan 31 17:22:04
2013
@@ -905,7 +905,11 @@ def reintegrate_on_shallow_wc(sbox):
   expected_A_disk.tweak('D', props={SVN_PROP_MERGEINFO : '/A_COPY/D:2-4*'})
   # ... a depth-restricted item is skipped ...
   expected_A_skip.add({
-      'D/H/psi' : Item(verb='Skipped')
+      'D/H' : Item(verb='Skipped missing target')
+  })
+  expected_output.add({
+    # Below the skip
+    'D/H/psi'           : Item(status='  ', treeconflict='U'),
   })
   # Currently this fails due to r1424469.  For a full explanation see
   # http://svn.haxx.se/dev/archive-2012-12/0472.shtml

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1441076&r1=1441075&r2=1441076&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Thu Jan 31 17:22:04 2013
@@ -1512,6 +1512,7 @@ def merge_skips_obstructions(sbox):
 
   expected_output = wc.State(C_path, {
     'foo'    : Item(status='A '),
+    'Q/bar'  : Item(status='  ', treeconflict='A'), # Skipped
     })
   expected_mergeinfo_output = wc.State(C_path, {
     '' : Item(status=' U'),
@@ -1529,7 +1530,6 @@ def merge_skips_obstructions(sbox):
     })
   expected_skip = wc.State(C_path, {
     'Q'     : Item(verb='Skipped'),
-    'Q/bar' : Item(verb='Skipped'),
     })
 
   svntest.actions.run_and_verify_merge(C_path, '1', '2', F_url, None,
@@ -7796,6 +7796,9 @@ def merge_to_sparse_directories(sbox):
     'D'   : Item(status=' U'),
     'mu'  : Item(status='U '),
     ''    : Item(status=' U'),
+    # Shadowed below skips
+    'D/H/omega' : Item(status='  ', treeconflict='U'),
+    'B/E/beta'  : Item(status='  ', treeconflict='U'),
     })
   expected_mergeinfo_output = wc.State(immediates_dir, {
     ''  : Item(status=' U'),
@@ -7821,8 +7824,8 @@ def merge_to_sparse_directories(sbox):
                               "prop:name" : "propval"}),
     })
   expected_skip = svntest.wc.State(immediates_dir, {
-    'D/H/omega' : Item(verb='Skipped missing target'),
-    'B/E/beta'  : Item(verb='Skipped missing target'),
+    'D/H'       : Item(verb='Skipped missing target'),
+    'B/E'       : Item(verb='Skipped missing target'),
     })
   svntest.actions.run_and_verify_merge(immediates_dir, '4', '9',
                                        sbox.repo_url + '/A', None,
@@ -7857,6 +7860,9 @@ def merge_to_sparse_directories(sbox):
   expected_output = wc.State(files_dir, {
     'mu' : Item(status='U '),
     ''   : Item(status=' U'),
+    # Below the skips
+    'D/H/omega' : Item(status='  ', treeconflict='U'),
+    'B/E/beta'  : Item(status='  ', treeconflict='U'),
     })
   expected_mergeinfo_output = wc.State(files_dir, {
     ''   : Item(status=' U'),
@@ -7876,8 +7882,7 @@ def merge_to_sparse_directories(sbox):
     })
   expected_skip = svntest.wc.State(files_dir, {
     'D'         : Item(verb='Skipped missing target'),
-    'D/H/omega' : Item(verb='Skipped missing target'),
-    'B/E/beta'  : Item(verb='Skipped missing target'),
+    'B'         : Item(verb='Skipped missing target'),
     })
   svntest.actions.run_and_verify_merge(files_dir, '4', '9',
                                        sbox.repo_url + '/A', None,
@@ -7905,6 +7910,9 @@ def merge_to_sparse_directories(sbox):
   # the one change that affects it directly (the prop add from r9).
   expected_output = wc.State(empty_dir, {
     ''   : Item(status=' U'),
+    # Below the skips
+    'B/E/beta'  : Item(status='  ', treeconflict='U'),
+    'D/H/omega' : Item(status='  ', treeconflict='U'),
     })
   expected_mergeinfo_output = wc.State(empty_dir, {
     '' : Item(status=' U'),
@@ -7921,8 +7929,7 @@ def merge_to_sparse_directories(sbox):
   expected_skip = svntest.wc.State(empty_dir, {
     'mu'        : Item(verb='Skipped missing target'),
     'D'         : Item(verb='Skipped missing target'),
-    'D/H/omega' : Item(verb='Skipped missing target'),
-    'B/E/beta'  : Item(verb='Skipped missing target'),
+    'B'         : Item(verb='Skipped missing target'),
     })
   svntest.actions.run_and_verify_merge(empty_dir, '4', '9',
                                        sbox.repo_url + '/A', None,

Modified: subversion/trunk/subversion/tests/cmdline/merge_tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1441076&r1=1441075&r2=1441076&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tree_conflict_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tree_conflict_tests.py Thu Jan 31 17:22:04
2013
@@ -1284,6 +1284,14 @@ def tree_conflicts_merge_edit_onto_missi
 
   sbox.build()
   expected_output = wc.State('', {
+  # Below the skips
+  'DD/D1/D2'          : Item(status='  ', treeconflict='U'),
+  'DD/D1/D2/epsilon'  : Item(status='  ', treeconflict='A'),
+  'DDD/D1/D2/D3'      : Item(status='  ', treeconflict='U'),
+  'DDD/D1/D2/D3/zeta' : Item(status='  ', treeconflict='A'),
+  'DDF/D1/D2/gamma'   : Item(status='  ', treeconflict='U'),
+  'D/D1/delta'        : Item(status='  ', treeconflict='A'),
+  'DF/D1/beta'        : Item(status='  ', treeconflict='U'),
   })
 
   expected_disk = disk_after_tree_del
@@ -1315,19 +1323,12 @@ def tree_conflicts_merge_edit_onto_missi
   expected_skip = svntest.wc.State('', {
     'F/alpha'           : Item(verb='Skipped missing target'),
     # Obstruction handling improvements in 1.7 and 1.8 added
-    'DF/D1/beta'        : Item(verb='Skipped missing target'),
-    'DDD/D1/D2/D3/zeta' : Item(verb='Skipped missing target'),
-    'DDD/D1/D2/D3'      : Item(verb='Skipped missing target'),
-    'DDF/D1/D2/gamma'   : Item(verb='Skipped missing target'),
-    'D/D1/delta'        : Item(verb='Skipped missing target'),
-    'D/D1'              : Item(verb='Skipped missing target'),
-    'DD/D1/D2/epsilon'  : Item(verb='Skipped missing target'),
-    'DD/D1/D2'          : Item(verb='Skipped missing target'),
-    # And more recent changes added the obstruction roots
-    'DD/D1'             : Item(verb='Skipped missing target'),
-    'DF/D1'             : Item(verb='Skipped missing target'),
     'DDD/D1'            : Item(verb='Skipped missing target'),
+    'DF/D1'             : Item(verb='Skipped missing target'),
     'DDF/D1'            : Item(verb='Skipped missing target'),
+    'D/D1'              : Item(verb='Skipped missing target'),
+    'DD/D1'             : Item(verb='Skipped missing target'),
+    'F/alpha'           : Item(verb='Skipped missing target'),
   })
 
   # Currently this test fails because some parts of the merge
@@ -1361,6 +1362,11 @@ def tree_conflicts_merge_del_onto_missin
 
   sbox.build()
   expected_output = wc.State('', {
+  # Below the skips
+    'DF/D1/beta'        : Item(status='  ', treeconflict='D'),
+    'DDD/D1/D2/D3'      : Item(status='  ', treeconflict='D'),
+    'DD/D1/D2'          : Item(status='  ', treeconflict='D'),
+    'DDF/D1/D2/gamma'   : Item(status='  ', treeconflict='D'),
   })
 
   expected_disk = disk_after_tree_del
@@ -1393,15 +1399,10 @@ def tree_conflicts_merge_del_onto_missin
     'F/alpha'           : Item(verb='Skipped missing target'),
     'D/D1'              : Item(verb='Skipped missing target'),
     # Obstruction handling improvements in 1.7 and 1.8 added
-    'DD/D1/D2'          : Item(verb='Skipped missing target'),
-    'DF/D1/beta'        : Item(verb='Skipped missing target'),
-    'DDD/D1/D2/D3'      : Item(verb='Skipped missing target'),
-    'DDF/D1/D2/gamma'   : Item(verb='Skipped missing target'),
-    # And more recent changes added the obstruction roots
-    'DDF/D1'            : Item(verb='Skipped missing target'),
-    'DF/D1'             : Item(verb='Skipped missing target'),
     'DDD/D1'            : Item(verb='Skipped missing target'),
     'DD/D1'             : Item(verb='Skipped missing target'),
+    'DDF/D1'            : Item(verb='Skipped missing target'),
+    'DF/D1'             : Item(verb='Skipped missing target'),
   })
 
   svntest.actions.deep_trees_run_tests_scheme_for_merge(sbox,



Mime
View raw message