You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2013/03/08 12:32:02 UTC

svn commit: r1454327 - in /subversion/trunk/subversion: libsvn_client/update.c libsvn_wc/questions.c libsvn_wc/update_editor.c libsvn_wc/wc.h tests/cmdline/tree_conflict_tests.py tests/libsvn_wc/op-depth-test.c

Author: philip
Date: Fri Mar  8 11:32:01 2013
New Revision: 1454327

URL: http://svn.apache.org/r1454327
Log:
Allow update of move-away-edit tree-conflicts so that move sources
can be returned to single-revision status (part of issue 4232).

* subversion/libsvn_client/update.c
  (update_internal): Allow updates with tree-conflicts.

* subversion/libsvn_wc/wc.h
  (svn_wc__conflicted_for_update_p): New.

* subversion/libsvn_wc/questions.c
  (internal_conflicted_p): New, code from svn_wc__internal_conflicted_p.
  (svn_wc__internal_conflicted_p): Now just a wrapper.
  (svn_wc__conflicted_for_update_p): New.

* subversion/libsvn_wc/update_editor.c
  (already_in_a_tree_conflict, node_already_conflicted): Use new function.

* subversion/tests/libsvn_wc/op-depth-test.c
  (test_funcs): Mark move_update_subtree as PASS.

* subversion/tests/cmdline/tree_conflict_tests.py
  (actual_only_node_behaviour): Tweak update expectation.

Modified:
    subversion/trunk/subversion/libsvn_client/update.c
    subversion/trunk/subversion/libsvn_wc/questions.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/wc.h
    subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1454327&r1=1454326&r2=1454327&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/update.c (original)
+++ subversion/trunk/subversion/libsvn_client/update.c Fri Mar  8 11:32:01 2013
@@ -239,20 +239,21 @@ update_internal(svn_revnum_t *result_rev
   /* It does not make sense to update conflict victims. */
   if (repos_relpath)
     {
-      svn_boolean_t text_conflicted, prop_conflicted, tree_conflicted;
+      svn_boolean_t text_conflicted, prop_conflicted;
 
       anchor_url = svn_path_url_add_component2(repos_root_url, repos_relpath,
                                                pool);
 
       err = svn_wc_conflicted_p3(&text_conflicted, &prop_conflicted,
-                                 &tree_conflicted,
+                                 NULL,
                                  ctx->wc_ctx, local_abspath, pool);
 
       if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
         return svn_error_trace(err);
       svn_error_clear(err);
 
-      if (!err && (text_conflicted || prop_conflicted || tree_conflicted))
+      /* tree-conflicts are handled by the update editor */
+      if (!err && (text_conflicted || prop_conflicted))
         target_conflicted = TRUE;
     }
   else

Modified: subversion/trunk/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/questions.c?rev=1454327&r1=1454326&r2=1454327&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/questions.c (original)
+++ subversion/trunk/subversion/libsvn_wc/questions.c Fri Mar  8 11:32:01 2013
@@ -363,13 +363,14 @@ svn_wc_text_modified_p2(svn_boolean_t *m
 
 
 
-svn_error_t *
-svn_wc__internal_conflicted_p(svn_boolean_t *text_conflicted_p,
-                              svn_boolean_t *prop_conflicted_p,
-                              svn_boolean_t *tree_conflicted_p,
-                              svn_wc__db_t *db,
-                              const char *local_abspath,
-                              apr_pool_t *scratch_pool)
+static svn_error_t *
+internal_conflicted_p(svn_boolean_t *text_conflicted_p,
+                      svn_boolean_t *prop_conflicted_p,
+                      svn_boolean_t *tree_conflicted_p,
+                      svn_boolean_t ignore_move_edit,
+                      svn_wc__db_t *db,
+                      const char *local_abspath,
+                      apr_pool_t *scratch_pool)
 {
   svn_node_kind_t kind;
   svn_skel_t *conflicts;
@@ -470,7 +471,19 @@ svn_wc__internal_conflicted_p(svn_boolea
         }
     }
 
-  /* tree_conflicts don't have markers, so don't need checking */
+  if (tree_conflicted_p && *tree_conflicted_p && ignore_move_edit)
+    {
+      svn_wc_conflict_reason_t reason;
+      svn_wc_conflict_action_t action;
+
+      SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL,
+                                                  db, local_abspath, conflicts,
+                                                  scratch_pool, scratch_pool));
+
+      if (reason == svn_wc_conflict_reason_moved_away
+          && action == svn_wc_conflict_action_edit)
+        *tree_conflicted_p = FALSE;
+    }
 
   if (resolved_text || resolved_props)
     {
@@ -492,6 +505,42 @@ svn_wc__internal_conflicted_p(svn_boolea
 }
 
 svn_error_t *
+svn_wc__internal_conflicted_p(svn_boolean_t *text_conflicted_p,
+                              svn_boolean_t *prop_conflicted_p,
+                              svn_boolean_t *tree_conflicted_p,
+                              svn_wc__db_t *db,
+                              const char *local_abspath,
+                              apr_pool_t *scratch_pool)
+{
+  SVN_ERR(internal_conflicted_p(text_conflicted_p, prop_conflicted_p,
+                                tree_conflicted_p, FALSE,
+                                db, local_abspath, scratch_pool));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__conflicted_for_update_p(svn_boolean_t *conflicted_p,
+                                svn_wc__db_t *db,
+                                const char *local_abspath,
+                                svn_boolean_t tree_only,
+                                apr_pool_t *scratch_pool)
+{
+  svn_boolean_t text_conflicted, prop_conflicted, tree_conflicted;
+
+  SVN_ERR(internal_conflicted_p(tree_only ? NULL: &text_conflicted,
+                                tree_only ? NULL: &prop_conflicted,
+                                &tree_conflicted, TRUE,
+                                db, local_abspath, scratch_pool));
+  if (tree_only)
+    *conflicted_p = tree_conflicted;
+  else
+    *conflicted_p = text_conflicted || prop_conflicted || tree_conflicted;
+
+  return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
 svn_wc_conflicted_p3(svn_boolean_t *text_conflicted_p,
                      svn_boolean_t *prop_conflicted_p,
                      svn_boolean_t *tree_conflicted_p,

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1454327&r1=1454326&r2=1454327&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Fri Mar  8 11:32:01 2013
@@ -1616,9 +1616,9 @@ check_tree_conflict(svn_skel_t **pconfli
 }
 
 
-/* If LOCAL_ABSPATH is inside a conflicted tree, set *CONFLICTED to TRUE,
- * Otherwise set *CONFLICTED to FALSE.  Use SCRATCH_POOL for temporary
- * allocations.
+/* If LOCAL_ABSPATH is inside a conflicted tree and the conflict is
+ * not a moved-away-edit conflict, set *CONFLICTED to TRUE.  Otherwise
+ * set *CONFLICTED to FALSE.
  */
 static svn_error_t *
 already_in_a_tree_conflict(svn_boolean_t *conflicted,
@@ -1635,22 +1635,17 @@ already_in_a_tree_conflict(svn_boolean_t
 
   while (TRUE)
     {
-      svn_boolean_t is_wc_root, tree_conflicted;
+      svn_boolean_t is_wc_root;
 
       svn_pool_clear(iterpool);
 
-      SVN_ERR(svn_wc__internal_conflicted_p(NULL, NULL, &tree_conflicted,
-                                            db, ancestor_abspath, iterpool));
-
-      if (tree_conflicted)
-        {
-          *conflicted = TRUE;
-          break;
-        }
+      SVN_ERR(svn_wc__conflicted_for_update_p(conflicted, db, ancestor_abspath,
+                                              TRUE, scratch_pool));
+      if (*conflicted)
+        break;
 
       SVN_ERR(svn_wc__db_is_wcroot(&is_wc_root, db, ancestor_abspath,
                                    iterpool));
-
       if (is_wc_root)
         break;
 
@@ -1669,15 +1664,9 @@ node_already_conflicted(svn_boolean_t *c
                         const char *local_abspath,
                         apr_pool_t *scratch_pool)
 {
-  svn_boolean_t text_conflicted, prop_conflicted, tree_conflicted;
-
-  SVN_ERR(svn_wc__internal_conflicted_p(&text_conflicted,
-                                        &prop_conflicted,
-                                        &tree_conflicted,
-                                        db, local_abspath,
-                                        scratch_pool));
+  SVN_ERR(svn_wc__conflicted_for_update_p(conflicted, db, local_abspath, FALSE,
+                                          scratch_pool));
 
-  *conflicted = (text_conflicted || prop_conflicted || tree_conflicted);
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1454327&r1=1454326&r2=1454327&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Fri Mar  8 11:32:01 2013
@@ -501,6 +501,16 @@ svn_wc__internal_conflicted_p(svn_boolea
                               const char *local_abspath,
                               apr_pool_t *scratch_pool);
 
+/* Similar to svn_wc__internal_conflicted_p(), but ignores
+ * moved-away-edit tree conflicts.  Also ignores text and property
+ * conflicts if TREE_ONLY is TRUE */
+svn_error_t *
+svn_wc__conflicted_for_update_p(svn_boolean_t *conflicted_p,
+                                svn_wc__db_t *db,
+                                const char *local_abspath,
+                                svn_boolean_t tree_only,
+                                apr_pool_t *scratch_pool);
+
 
 /* Internal version of svn_wc_transmit_text_deltas3(). */
 svn_error_t *

Modified: subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py?rev=1454327&r1=1454326&r2=1454327&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py Fri Mar  8 11:32:01 2013
@@ -1407,9 +1407,11 @@ def actual_only_node_behaviour(sbox):
                      "unlock", foo_path)
 
   # update (up)
+  # This doesn't skip because the update is anchored at the parent of A,
+  # the parent of A is not in conflict, and the update doesn't attempt to
+  # change foo itself.
   expected_stdout = [
-   "Skipped '%s' -- Node remains in conflict\n" % sbox.ospath('A/foo'),
-  ] + svntest.main.summary_of_conflicts(skipped_paths=1)
+   "Updating '" + foo_path + "':\n", "At revision 4.\n"]
   expected_stderr = []
   run_and_verify_svn(None, expected_stdout, expected_stderr,
                      "update", foo_path)

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1454327&r1=1454326&r2=1454327&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Fri Mar  8 11:32:01 2013
@@ -7613,7 +7613,7 @@ struct svn_test_descriptor_t test_funcs[
                        "new_basemove"),
     SVN_TEST_OPTS_PASS(move_back,
                        "move_back (issue 4302)"),
-    SVN_TEST_OPTS_XFAIL(move_update_subtree,
+    SVN_TEST_OPTS_PASS(move_update_subtree,
                        "move_update_subtree (issue 4232)"),
     SVN_TEST_NULL
   };