subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1577815 - in /subversion/branches/1.8.x-r1577812: ./ subversion/libsvn_client/merge.c subversion/tests/cmdline/merge_tests.py
Date Sat, 15 Mar 2014 10:07:20 GMT
Author: rhuijben
Date: Sat Mar 15 10:07:20 2014
New Revision: 1577815

URL: http://svn.apache.org/r1577815
Log:
Merge r1577812,r1577813, resolving a trivial text conflict caused by r1573006

Modified:
    subversion/branches/1.8.x-r1577812/   (props changed)
    subversion/branches/1.8.x-r1577812/subversion/libsvn_client/merge.c
    subversion/branches/1.8.x-r1577812/subversion/tests/cmdline/merge_tests.py

Propchange: subversion/branches/1.8.x-r1577812/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1577812-1577813

Modified: subversion/branches/1.8.x-r1577812/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1577812/subversion/libsvn_client/merge.c?rev=1577815&r1=1577814&r2=1577815&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1577812/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/1.8.x-r1577812/subversion/libsvn_client/merge.c Sat Mar 15 10:07:20
2014
@@ -3062,7 +3062,6 @@ merge_dir_deleted(const char *relpath,
   struct merge_dir_baton_t *db = dir_baton;
   const char *local_abspath = svn_dirent_join(merge_b->target->abspath,
                                               relpath, scratch_pool);
-  struct dir_delete_baton_t *delb;
   svn_boolean_t same;
   apr_hash_t *working_props;
 
@@ -3093,66 +3092,71 @@ merge_dir_deleted(const char *relpath,
                             scratch_pool, scratch_pool));
 
   if (merge_b->force_delete)
-    same = TRUE;
+    {
+      /* In this legacy mode we just assume that a directory delete
+         matches any directory. db->delete_state is NULL */
+      same = TRUE;
+    }
   else
     {
+      struct dir_delete_baton_t *delb;
+
       /* Compare the properties */
       SVN_ERR(properties_same_p(&same, left_props, working_props,
                                 scratch_pool));
-    }
+      delb = db->delete_state;
+      assert(delb != NULL);
 
-  delb = db->delete_state;
-  assert(delb != NULL);
+      if (! same)
+        {
+          delb->found_edit = TRUE;
+        }
+      else
+        {
+          store_path(delb->compared_abspaths, local_abspath);
+        }
 
-  if (! same)
-    {
-      delb->found_edit = TRUE;
-    }
-  else
-    {
-      store_path(delb->compared_abspaths, local_abspath);
-    }
+      if (delb->del_root != db)
+        return SVN_NO_ERROR;
 
-  if (delb->del_root != db)
-    return SVN_NO_ERROR;
+      if (delb->found_edit)
+        same = FALSE;
+      else if (merge_b->force_delete)
+        same = TRUE;
+      else
+        {
+          apr_array_header_t *ignores;
+          svn_error_t *err;
+          same = TRUE;
 
-  if (delb->found_edit)
-    same = FALSE;
-  else if (merge_b->force_delete)
-    same = TRUE;
-  else
-    {
-      apr_array_header_t *ignores;
-      svn_error_t *err;
-      same = TRUE;
+          SVN_ERR(svn_wc_get_default_ignores(&ignores, merge_b->ctx->config,
+                                             scratch_pool));
 
-      SVN_ERR(svn_wc_get_default_ignores(&ignores, merge_b->ctx->config,
-                                         scratch_pool));
+          /* None of the descendants was modified, but maybe there are
+             descendants we haven't walked?
 
-      /* None of the descendants was modified, but maybe there are
-         descendants we haven't walked?
+             Note that we aren't interested in changes, as we already verified
+             changes in the paths touched by the merge. And the existence of
+             other paths is enough to mark the directory edited */
+          err = svn_wc_walk_status(merge_b->ctx->wc_ctx, local_abspath,
+                                   svn_depth_infinity, TRUE /* get-all */,
+                                   FALSE /* no-ignore */,
+                                   TRUE /* ignore-text-mods */, ignores,
+                                   verify_touched_by_del_check, delb,
+                                   merge_b->ctx->cancel_func,
+                                   merge_b->ctx->cancel_baton,
+                                   scratch_pool);
 
-         Note that we aren't interested in changes, as we already verified
-         changes in the paths touched by the merge. And the existance of
-         other paths is enough to mark the directory edited */
-      err = svn_wc_walk_status(merge_b->ctx->wc_ctx, local_abspath,
-                               svn_depth_infinity, TRUE /* get-all */,
-                               FALSE /* no-ignore */,
-                               TRUE /* ignore-text-mods */, ignores,
-                               verify_touched_by_del_check, delb,
-                               merge_b->ctx->cancel_func,
-                               merge_b->ctx->cancel_baton,
-                               scratch_pool);
+          if (err)
+            {
+              if (err->apr_err != SVN_ERR_CEASE_INVOCATION)
+                return svn_error_trace(err);
 
-      if (err)
-        {
-          if (err->apr_err != SVN_ERR_CEASE_INVOCATION)
-            return svn_error_trace(err);
+              svn_error_clear(err);
+            }
 
-          svn_error_clear(err);
+          same = ! delb->found_edit;
         }
-
-      same = ! delb->found_edit;
     }
 
   if (same && !merge_b->dry_run)

Modified: subversion/branches/1.8.x-r1577812/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1577812/subversion/tests/cmdline/merge_tests.py?rev=1577815&r1=1577814&r2=1577815&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1577812/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/1.8.x-r1577812/subversion/tests/cmdline/merge_tests.py Sat Mar 15
10:07:20 2014
@@ -19143,6 +19143,30 @@ def merge_to_empty_target_merge_to_infin
   # Commit the merge.
   #sbox.simple_commit()
 
+def merge_dir_delete_force(sbox):
+  "merge a directory delete with --force"
+
+  sbox.build()
+
+  sbox.simple_rm('A/D/G')
+  sbox.simple_commit() # r2
+
+  sbox.simple_update(revision=1)
+
+  # Just merging r2 on r1 succeeds
+  svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
+                                     'merge', '-c2', '^/', sbox.wc_dir,
+                                     '--ignore-ancestry')
+
+  # Bring working copy to r1 again
+  svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
+                                     'revert', '-R', sbox.wc_dir)
+
+  # But when using --force this same merge caused a segfault in 1.8.0-1.8.8
+  svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
+                                     'merge', '-c2', '^/', sbox.wc_dir,
+                                     '--ignore-ancestry', '--force')
+
 ########################################################################
 # Run the tests
 
@@ -19288,6 +19312,7 @@ test_list = [ None,
               single_editor_drive_merge_notifications,
               conflicted_split_merge_with_resolve,
               merge_to_empty_target_merge_to_infinite_target,
+              merge_dir_delete_force,
              ]
 
 if __name__ == '__main__':



Mime
View raw message