subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1659238 [4/21] - in /subversion/branches/fsx-1.10: ./ build/generator/ build/generator/templates/ subversion/bindings/swig/ subversion/include/ subversion/include/private/ subversion/libsvn_delta/ subversion/libsvn_fs_base/ subversion/libs...
Date Thu, 12 Feb 2015 12:21:32 GMT
Modified: subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db.h?rev=1659238&r1=1659237&r2=1659238&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db.h Thu Feb 12 12:21:31 2015
@@ -412,9 +412,6 @@ svn_wc__db_get_wcroot(const char **wcroo
    If DAV_CACHE is not NULL, sets LOCAL_ABSPATH's dav cache to the specified
    data.
 
-   If CONFLICT is not NULL, then it describes a conflict for this node. The
-   node will be record as conflicted (in ACTUAL).
-
    If UPDATE_ACTUAL_PROPS is TRUE, set the properties store NEW_ACTUAL_PROPS
    as the new set of properties in ACTUAL. If NEW_ACTUAL_PROPS is NULL or
    when the value of NEW_ACTUAL_PROPS matches NEW_PROPS, store NULL in
@@ -424,6 +421,9 @@ svn_wc__db_get_wcroot(const char **wcroo
    svn_prop_inherited_item_t * structures that is set as the base node's
    inherited_properties.
 
+   If CONFLICT is not NULL, then it describes a conflict for this node. The
+   node will be record as conflicted (in ACTUAL).
+
    Any work items that are necessary as part of this node construction may
    be passed in WORK_ITEMS.
 
@@ -444,10 +444,10 @@ svn_wc__db_base_add_directory(svn_wc__db
                               const apr_array_header_t *children,
                               svn_depth_t depth,
                               apr_hash_t *dav_cache,
-                              const svn_skel_t *conflict,
                               svn_boolean_t update_actual_props,
                               apr_hash_t *new_actual_props,
                               apr_array_header_t *new_iprops,
+                              const svn_skel_t *conflict,
                               const svn_skel_t *work_items,
                               apr_pool_t *scratch_pool);
 
@@ -3435,27 +3435,31 @@ svn_wc__db_follow_moved_to(apr_array_hea
                            apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool);
 
-/* Update a moved-away tree conflict victim at VICTIM_ABSPATH with changes
- * brought in by the update operation which flagged the tree conflict. */
+/* Update a moved-away tree conflict victim LOCAL_ABSPATH, deleted in
+   DELETE_OP_ABSPATH with changes from the original location. */
 svn_error_t *
 svn_wc__db_update_moved_away_conflict_victim(svn_wc__db_t *db,
-                                             const char *victim_abspath,
-                                             svn_wc_notify_func2_t notify_func,
-                                             void *notify_baton,
+                                             const char *local_abspath,
+                                             const char *delete_op_abspath,
+                                             svn_wc_operation_t operation,
+                                             svn_wc_conflict_action_t action,
+                                             svn_wc_conflict_reason_t reason,
                                              svn_cancel_func_t cancel_func,
                                              void *cancel_baton,
+                                             svn_wc_notify_func2_t notify_func,
+                                             void *notify_baton,
                                              apr_pool_t *scratch_pool);
 
 /* LOCAL_ABSPATH is moved to MOVE_DST_ABSPATH.  MOVE_SRC_ROOT_ABSPATH
  * is the root of the move to MOVE_DST_OP_ROOT_ABSPATH.
- * MOVE_SRC_OP_ROOT_ABSPATH is the op-root of the move; it's the same
+ * DELETE_ABSPATH is the op-root of the move; it's the same
  * as MOVE_SRC_ROOT_ABSPATH except for moves inside deletes when it is
  * the op-root of the delete. */
 svn_error_t *
 svn_wc__db_base_moved_to(const char **move_dst_abspath,
                          const char **move_dst_op_root_abspath,
                          const char **move_src_root_abspath,
-                         const char **move_src_op_root_abspath,
+                         const char **delete_abspath,
                          svn_wc__db_t *db,
                          const char *local_abspath,
                          apr_pool_t *result_pool,

Modified: subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db_private.h?rev=1659238&r1=1659237&r2=1659238&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db_private.h Thu Feb 12 12:21:31 2015
@@ -313,14 +313,14 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool);
 
-/* Look up REPOS_ID in SDB and set *REPOS_ROOT_URL and/or *REPOS_UUID to
-   its root URL and UUID respectively.  If REPOS_ID is INVALID_REPOS_ID,
+/* Look up REPOS_ID in WCROOT->SDB and set *REPOS_ROOT_URL and/or *REPOS_UUID
+   to its root URL and UUID respectively.  If REPOS_ID is INVALID_REPOS_ID,
    use NULL for both URL and UUID.  Either or both output parameters may be
    NULL if not wanted.  */
 svn_error_t *
 svn_wc__db_fetch_repos_info(const char **repos_root_url,
                             const char **repos_uuid,
-                            svn_sqlite__db_t *sdb,
+                            svn_wc__db_wcroot_t *wcroot,
                             apr_int64_t repos_id,
                             apr_pool_t *result_pool);
 
@@ -383,17 +383,6 @@ svn_wc__db_with_txn(svn_wc__db_wcroot_t
 #define SVN_WC__DB_WITH_TXN4(expr1, expr2, expr3, expr4, wcroot) \
   SVN_SQLITE__WITH_LOCK4(expr1, expr2, expr3, expr4, (wcroot)->sdb)
 
-
-/* Return CHILDREN mapping const char * names to svn_node_kind_t * for the
-   children of LOCAL_RELPATH at OP_DEPTH. */
-svn_error_t *
-svn_wc__db_get_children_op_depth(apr_hash_t **children,
-                                 svn_wc__db_wcroot_t *wcroot,
-                                 const char *local_relpath,
-                                 int op_depth,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool);
-
 /* Update the single op-depth layer in the move destination subtree
    rooted at DST_RELPATH to make it match the move source subtree
    rooted at SRC_RELPATH. */
@@ -415,48 +404,43 @@ svn_wc__db_op_make_copy_internal(svn_wc_
                                  apr_pool_t *scratch_pool);
 
 
-/* Extract the moved-to information for LOCAL_RELPATH at OP-DEPTH by
-   examining the lowest working node above OP_DEPTH.  The output paths
-   are NULL if there is no move, otherwise:
+/* Extract the moved-to information for LOCAL_RELPATH as it existed
+   at OP-DEPTH.  The output paths are optional and set to NULL
+   if there is no move, otherwise:
 
-   *MOVE_DST_RELPATH: the moved-to destination of LOCAL_RELPATH.
+   *MOVE_SRC_RELPATH: the path that was moved (LOCAL_RELPATH or one
+                      of its ancestors)
 
-   *MOVE_DST_OP_ROOT_RELPATH: the moved-to destination of the root of
-   the move of LOCAL_RELPATH. This may be equal to *MOVE_DST_RELPATH
-   if LOCAL_RELPATH is the root of the move.
+   *MOVE_DST_RELPATH: The path *MOVE_SRC_RELPATH was moved to.
 
-   *MOVE_SRC_ROOT_RELPATH: the root of the move source.  For moves
-   inside a delete this will be different from *MOVE_SRC_OP_ROOT_RELPATH.
+   *DELETE_RELPATH: The path at which LOCAL_RELPATH was removed (
+                    *MOVE_SRC_RELPATH or one of its ancestors)
 
-   *MOVE_SRC_OP_ROOT_RELPATH: the root of the source layer that
-   contains the move.  For moves inside deletes this is the root of
-   the delete, for other moves this is the root of the move.
+   Given a path A/B/C with A/B moved to X and A deleted then for A/B/C:
 
-   Given a path A/B/C with A/B moved to X then for A/B/C
+     MOVE_SRC_RELPATH is A/B
+     MOVE_DST_RELPATH is X
+     DELETE_RELPATH is A
 
-     MOVE_DST_RELPATH is X/C
-     MOVE_DST_OP_ROOT_RELPATH is X
-     MOVE_SRC_ROOT_RELPATH is A/B
-     MOVE_SRC_OP_ROOT_RELPATH is A/B
+     X/C can be calculated if necessesary, like with the other
+     scan functions.
 
-   If A is then deleted the MOVE_DST_RELPATH, MOVE_DST_OP_ROOT_RELPATH
-   and MOVE_SRC_ROOT_RELPATH remain the same but MOVE_SRC_OP_ROOT_RELPATH
-   changes to A.
+   This function returns SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_RELPATH didn't
+   exist at OP_DEPTH, or when it is not shadowed.
 
    ### Think about combining with scan_deletion?  Also with
    ### scan_addition to get moved-to for replaces?  Do we need to
    ### return the op-root of the move source, i.e. A/B in the example
    ### above?  */
 svn_error_t *
-svn_wc__db_op_depth_moved_to(const char **move_dst_relpath,
-                             const char **move_dst_op_root_relpath,
-                             const char **move_src_root_relpath,
-                             const char **move_src_op_root_relpath,
-                             int op_depth,
-                             svn_wc__db_wcroot_t *wcroot,
-                             const char *local_relpath,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool);
+svn_wc__db_scan_moved_to_internal(const char **move_src_relpath,
+                                  const char **move_dst_relpath,
+                                  const char **delete_relpath,
+                                  svn_wc__db_wcroot_t *wcroot,
+                                  const char *local_relpath,
+                                  int op_depth,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool);
 
 /* Like svn_wc__db_op_set_props, but updates ACTUAL_NODE directly without
    comparing with the pristine properties, etc.
@@ -496,12 +480,27 @@ svn_wc__db_bump_moved_away(svn_wc__db_wc
                            apr_pool_t *scratch_pool);
 
 /* Unbreak the move from LOCAL_RELPATH on op-depth in WCROOT, by making
-   the destination a normal copy */
+   the destination DST_RELPATH a normal copy. SRC_OP_DEPTH is the op-depth
+   where the move_to information is stored */
+svn_error_t *
+svn_wc__db_op_break_move_internal(svn_wc__db_wcroot_t *wcroot,
+                                  const char *src_relpath,
+                                  int src_op_depth,
+                                  const char *dst_relpath,
+                                  const svn_skel_t *work_items,
+                                  apr_pool_t *scratch_pool);
+
 svn_error_t *
-svn_wc__db_resolve_break_moved_away_internal(svn_wc__db_wcroot_t *wcroot,
-                                             const char *local_relpath,
-                                             int op_depth,
-                                             apr_pool_t *scratch_pool);
+svn_wc__db_op_raise_moved_away_internal(
+                        svn_wc__db_wcroot_t *wcroot,
+                        const char *local_relpath,
+                        int delete_op_depth,
+                        svn_wc__db_t *db,
+                        svn_wc_operation_t operation,
+                        svn_wc_conflict_action_t action,
+                        const svn_wc_conflict_version_t *old_version,
+                        const svn_wc_conflict_version_t *new_version,
+                        apr_pool_t *scratch_pool);
 
 svn_error_t *
 svn_wc__db_update_move_list_notify(svn_wc__db_wcroot_t *wcroot,

Modified: subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db_update_move.c?rev=1659238&r1=1659237&r2=1659238&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_wc/wc_db_update_move.c Thu Feb 12 12:21:31 2015
@@ -135,6 +135,44 @@ verify_write_lock(svn_wc__db_wcroot_t *w
   return SVN_NO_ERROR;
 }
 
+/* In our merge conflicts we record the move_op_src path, which is essentially
+   the depth at which what was moved is marked deleted. The problem is that
+   this depth is not guaranteed to be stable, because somebody might just
+   remove another ancestor, or revert one.
+
+   To work around this problem we locate the layer below this path, and use
+   that to pinpoint whatever is moved.
+
+   For a path SRC_RELPATH that was deleted by an operation rooted at
+   DELETE_OP_DEPTH find the op-depth at which the node was originally added.
+   */
+static svn_error_t *
+find_src_op_depth(int *src_op_depth,
+                  svn_wc__db_wcroot_t *wcroot,
+                  const char *src_relpath,
+                  int delete_op_depth,
+                  apr_pool_t *scratch_pool)
+{
+  svn_sqlite__stmt_t *stmt;
+  svn_boolean_t have_row;
+
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_SELECT_HIGHEST_WORKING_NODE));
+  SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
+                            src_relpath, delete_op_depth));
+
+  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+  if (have_row)
+    *src_op_depth = svn_sqlite__column_int(stmt, 0);
+  SVN_ERR(svn_sqlite__reset(stmt));
+  if (!have_row)
+    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                              _("'%s' is not deleted"),
+                              path_for_error_message(wcroot, src_relpath,
+                                                    scratch_pool));
+
+  return SVN_NO_ERROR;
+}
 
 /*
  * Receiver code.
@@ -159,6 +197,9 @@ typedef struct update_move_baton_t {
   svn_wc_operation_t operation;
   svn_wc_conflict_version_t *old_version;
   svn_wc_conflict_version_t *new_version;
+
+  svn_cancel_func_t cancel_func;
+  void *cancel_baton;
 } update_move_baton_t;
 
 /* Per node flags for tree conflict collection */
@@ -187,6 +228,7 @@ typedef struct node_move_baton_t
 static svn_error_t *
 update_move_list_add(svn_wc__db_wcroot_t *wcroot,
                      const char *local_relpath,
+                     svn_wc__db_t *db,
                      svn_wc_notify_action_t action,
                      svn_node_kind_t kind,
                      svn_wc_notify_state_t content_state,
@@ -199,15 +241,25 @@ update_move_list_add(svn_wc__db_wcroot_t
 
   if (conflict)
     {
-      action = svn_wc_notify_tree_conflict;
-      content_state = svn_wc_notify_state_inapplicable;
-      prop_state = svn_wc_notify_state_inapplicable;
+      svn_boolean_t tree_conflict;
+
+      SVN_ERR(svn_wc__conflict_read_info(NULL, NULL, NULL, NULL,
+                                         &tree_conflict,
+                                         db, wcroot->abspath, conflict,
+                                         scratch_pool, scratch_pool));
+      if (tree_conflict)
+        {
+          action = svn_wc_notify_tree_conflict;
+          content_state = svn_wc_notify_state_inapplicable;
+          prop_state = svn_wc_notify_state_inapplicable;
+        }
     }
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_INSERT_UPDATE_MOVE_LIST));
-  SVN_ERR(svn_sqlite__bindf(stmt, "sdddd", local_relpath,
-                            action, kind, content_state, prop_state));
+  SVN_ERR(svn_sqlite__bindf(stmt, "sdtdd", local_relpath,
+                            action, kind_map_none, kind,
+                            content_state, prop_state));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
   if (conflict)
@@ -256,7 +308,7 @@ svn_wc__db_update_move_list_notify(svn_w
                                                         local_relpath,
                                                         iterpool),
                                         action, iterpool);
-          notify->kind = svn_sqlite__column_int(stmt, 2);
+          notify->kind = svn_sqlite__column_token(stmt, 2, kind_map_none);
           notify->content_state = svn_sqlite__column_int(stmt, 3);
           notify->prop_state = svn_sqlite__column_int(stmt, 4);
           notify->old_revision = old_revision;
@@ -500,33 +552,33 @@ mark_tc_on_op_root(node_move_baton_t *nm
                    apr_pool_t *scratch_pool)
 {
   update_move_baton_t *b = nmb->umb;
-  const char *conflict_root_relpath = nmb->dst_relpath;
-  const char *move_dst_relpath, *dummy1;
-  const char *dummy2, *move_src_op_root_relpath;
+  const char *move_dst_relpath;
   svn_skel_t *conflict;
 
   SVN_ERR_ASSERT(nmb->shadowed && !nmb->pb->shadowed);
 
   nmb->skip = TRUE;
 
-  SVN_ERR(svn_wc__db_op_depth_moved_to(&move_dst_relpath,
-                                       &dummy1,
-                                       &dummy2,
-                                       &move_src_op_root_relpath,
-                                       b->dst_op_depth,
-                                       b->wcroot, conflict_root_relpath,
-                                       scratch_pool, scratch_pool));
+  if (old_kind == svn_node_none)
+    move_dst_relpath = NULL;
+  else
+    SVN_ERR(svn_wc__db_scan_moved_to_internal(NULL, &move_dst_relpath, NULL,
+                                              b->wcroot, nmb->dst_relpath,
+                                              b->dst_op_depth,
+                                              scratch_pool, scratch_pool));
 
-  SVN_ERR(create_node_tree_conflict(&conflict, nmb, conflict_root_relpath,
+  SVN_ERR(create_node_tree_conflict(&conflict, nmb, nmb->dst_relpath,
                                     old_kind, new_kind,
                                     old_repos_relpath,
                                     (move_dst_relpath
                                      ? svn_wc_conflict_reason_moved_away
                                      : svn_wc_conflict_reason_deleted),
-                                    action, move_src_op_root_relpath,
+                                    action, move_dst_relpath
+                                              ? nmb->dst_relpath
+                                              : NULL,
                                     scratch_pool, scratch_pool));
 
-  SVN_ERR(update_move_list_add(b->wcroot, conflict_root_relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, nmb->dst_relpath, b->db,
                                svn_wc_notify_tree_conflict,
                                new_kind,
                                svn_wc_notify_state_inapplicable,
@@ -671,7 +723,7 @@ tc_editor_add_directory(node_move_baton_
                                            scratch_pool, scratch_pool));
     }
 
-  SVN_ERR(update_move_list_add(b->wcroot, relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, relpath, b->db,
                                (old_kind == svn_node_none)
                                   ? svn_wc_notify_update_add
                                   : svn_wc_notify_update_replace,
@@ -763,7 +815,7 @@ tc_editor_add_file(node_move_baton_t *nm
                                             scratch_pool, scratch_pool));
     }
 
-  SVN_ERR(update_move_list_add(b->wcroot, relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, relpath, b->db,
                                (old_kind == svn_node_none)
                                   ? svn_wc_notify_update_add
                                   : svn_wc_notify_update_replace,
@@ -968,7 +1020,7 @@ tc_editor_alter_directory(node_move_bato
                                       scratch_pool, scratch_pool));
     }
 
-  SVN_ERR(update_move_list_add(b->wcroot, dst_relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, dst_relpath, b->db,
                                svn_wc_notify_update_update,
                                svn_node_dir,
                                svn_wc_notify_state_inapplicable,
@@ -1101,7 +1153,7 @@ tc_editor_alter_file(node_move_baton_t *
                                          NULL, /* diff3-cmd */
                                          NULL, /* merge options */
                                          propchanges,
-                                         NULL, NULL, /* cancel_func + baton */
+                                         b->cancel_func, b->cancel_baton,
                                          scratch_pool, scratch_pool));
 
           work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
@@ -1138,7 +1190,7 @@ tc_editor_alter_file(node_move_baton_t *
       work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
     }
 
-  SVN_ERR(update_move_list_add(b->wcroot, dst_relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, dst_relpath, b->db,
                                svn_wc_notify_update_update,
                                svn_node_file,
                                content_state,
@@ -1181,7 +1233,7 @@ tc_editor_delete(node_move_baton_t *nmb,
     {
       SVN_ERR(mark_tc_on_op_root(nmb,
                                  move_dst_kind,
-                                 svn_node_unknown,
+                                 new_kind,
                                  move_dst_repos_relpath,
                                  svn_wc_conflict_action_delete,
                                  scratch_pool));
@@ -1277,7 +1329,7 @@ tc_editor_delete(node_move_baton_t *nmb,
 
   /* Only notify if add_file/add_dir is not going to notify */
   if (conflict || (new_kind == svn_node_none))
-    SVN_ERR(update_move_list_add(b->wcroot, relpath,
+    SVN_ERR(update_move_list_add(b->wcroot, relpath, b->db,
                                  svn_wc_notify_update_delete,
                                  move_dst_kind,
                                  svn_wc_notify_state_inapplicable,
@@ -1384,30 +1436,26 @@ get_info(apr_hash_t **props,
          apr_pool_t *result_pool,
          apr_pool_t *scratch_pool)
 {
-  apr_hash_t *hash_children;
-  apr_array_header_t *sorted_children;
-  svn_error_t *err;
   svn_wc__db_status_t status;
   const char *repos_relpath;
-  int i;
+  svn_node_kind_t db_kind;
+  svn_error_t *err;
 
-  err = svn_wc__db_depth_get_info(&status, kind, NULL, &repos_relpath, NULL,
+  err = svn_wc__db_depth_get_info(&status, &db_kind, NULL, &repos_relpath, NULL,
                                   NULL, NULL, NULL, NULL, checksum, NULL,
                                   NULL, props,
                                   wcroot, local_relpath, op_depth,
                                   result_pool, scratch_pool);
 
   /* If there is no node at this depth, or only a node that describes a delete
-     of a lower layer we report this node as not existing.
-
-     But when a node is reported as DELETED, but has a repository location it
-     is really a not-present node that must be reported as being there */
+     of a lower layer we report this node as not existing. */
   if ((err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-      || (!err && status == svn_wc__db_status_deleted))
+      || (!err && status != svn_wc__db_status_added
+               && status != svn_wc__db_status_normal))
     {
       svn_error_clear(err);
 
-      if (kind && (err || !repos_relpath))
+      if (kind)
         *kind = svn_node_none;
       if (checksum)
         *checksum = NULL;
@@ -1421,21 +1469,33 @@ get_info(apr_hash_t **props,
   else
     SVN_ERR(err);
 
+  if (kind)
+    *kind = db_kind;
 
-  SVN_ERR(svn_wc__db_get_children_op_depth(&hash_children, wcroot,
-                                           local_relpath, op_depth,
-                                           scratch_pool, scratch_pool));
+  if (children && db_kind == svn_node_dir)
+    {
+      svn_sqlite__stmt_t *stmt;
+      svn_boolean_t have_row;
 
-  sorted_children = svn_sort__hash(hash_children,
-                                   svn_sort_compare_items_lexically,
-                                   scratch_pool);
-
-  *children = apr_array_make(result_pool, sorted_children->nelts,
-                             sizeof(const char *));
-  for (i = 0; i < sorted_children->nelts; ++i)
-    APR_ARRAY_PUSH(*children, const char *)
-      = apr_pstrdup(result_pool, APR_ARRAY_IDX(sorted_children, i,
-                                               svn_sort__item_t).key);
+      *children = apr_array_make(result_pool, 16, sizeof(const char *));
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_SELECT_OP_DEPTH_CHILDREN_EXISTS));
+      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, local_relpath,
+                                op_depth));
+      SVN_ERR(svn_sqlite__step(&have_row, stmt));
+      while (have_row)
+        {
+          const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
+
+          APR_ARRAY_PUSH(*children, const char *)
+              = svn_relpath_basename(child_relpath, result_pool);
+
+          SVN_ERR(svn_sqlite__step(&have_row, stmt));
+        }
+      SVN_ERR(svn_sqlite__reset(stmt));
+    }
+  else if (children)
+    *children = apr_array_make(result_pool, 0, sizeof(const char *));
 
   return SVN_NO_ERROR;
 }
@@ -1478,8 +1538,8 @@ update_moved_away_node(node_move_baton_t
   apr_hash_t *src_props, *dst_props;
   apr_array_header_t *src_children, *dst_children;
 
-  SVN_ERR(verify_write_lock(wcroot, src_relpath, scratch_pool));
-  SVN_ERR(verify_write_lock(wcroot, dst_relpath, scratch_pool));
+  if (b->cancel_func)
+    SVN_ERR(b->cancel_func(b->cancel_baton));
 
   SVN_ERR(get_info(&src_props, &src_checksum, &src_children, &src_kind,
                    src_relpath, b->src_op_depth,
@@ -1605,66 +1665,6 @@ update_moved_away_node(node_move_baton_t
   return SVN_NO_ERROR;
 }
 
-/* Transfer changes from the move source to the move destination.
- *
- * Drive the editor with the difference between DST_RELPATH
- * (at its own op-depth) and SRC_RELPATH (at op-depth zero).
- *
- * Then update the single op-depth layer in the move destination subtree
- * rooted at DST_RELPATH to make it match the move source subtree
- * rooted at SRC_RELPATH.
- *
- * ### And the other params?
- */
-static svn_error_t *
-drive_tree_conflict_editor(update_move_baton_t *b,
-                           const char *src_relpath,
-                           const char *dst_relpath,
-                           svn_wc_operation_t operation,
-                           svn_wc_conflict_reason_t local_change,
-                           svn_wc_conflict_action_t incoming_change,
-                           svn_wc_conflict_version_t *old_version,
-                           svn_wc_conflict_version_t *new_version,
-                           svn_wc__db_wcroot_t *wcroot,
-                           svn_cancel_func_t cancel_func,
-                           void *cancel_baton,
-                           apr_pool_t *scratch_pool)
-{
-  node_move_baton_t nmb = { 0 };
-  SVN_ERR(verify_write_lock(wcroot, src_relpath, scratch_pool));
-  SVN_ERR(verify_write_lock(wcroot, dst_relpath, scratch_pool));
-  /*
-   * Refuse to auto-resolve unsupported tree conflicts.
-   */
-  /* ### Only handle conflicts created by update/switch operations for now. */
-  if (operation != svn_wc_operation_update &&
-      operation != svn_wc_operation_switch)
-    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
-                            _("Cannot auto-resolve tree-conflict on '%s'"),
-                            path_for_error_message(wcroot, src_relpath,
-                                                   scratch_pool));
-
-  nmb.umb = b;
-  nmb.src_relpath = src_relpath;
-  nmb.dst_relpath = dst_relpath;
-  /* nmb.shadowed = FALSE; */
-  /* nmb.edited = FALSE; */
-  /* nmb.skip_children = FALSE; */
-
-  /* We walk the move source (i.e. the post-update tree), comparing each node
-   * with the equivalent node at the move destination and applying the update
-   * to nodes at the move destination. */
-  SVN_ERR(update_moved_away_node(&nmb, wcroot, src_relpath, dst_relpath,
-                                 scratch_pool));
-
-  SVN_ERR(svn_wc__db_op_copy_layer_internal(wcroot, src_relpath,
-                                            b->src_op_depth,
-                                            dst_relpath, NULL, NULL,
-                                            scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
 static svn_error_t *
 suitable_for_move(svn_wc__db_wcroot_t *wcroot,
                   const char *local_relpath,
@@ -1731,85 +1731,113 @@ suitable_for_move(svn_wc__db_wcroot_t *w
 /* The body of svn_wc__db_update_moved_away_conflict_victim(), which see.
  */
 static svn_error_t *
-update_moved_away_conflict_victim(svn_wc__db_t *db,
+update_moved_away_conflict_victim(svn_revnum_t *old_rev,
+                                  svn_revnum_t *new_rev,
+                                  svn_wc__db_t *db,
                                   svn_wc__db_wcroot_t *wcroot,
-                                  const char *victim_relpath,
+                                  const char *local_relpath,
+                                  const char *delete_relpath,
                                   svn_wc_operation_t operation,
-                                  svn_wc_conflict_reason_t local_change,
-                                  svn_wc_conflict_action_t incoming_change,
-                                  const char *move_src_op_root_relpath,
-                                  svn_wc_conflict_version_t *old_version,
-                                  svn_wc_conflict_version_t *new_version,
+                                  svn_wc_conflict_action_t action,
+                                  svn_wc_conflict_reason_t reason,
                                   svn_cancel_func_t cancel_func,
                                   void *cancel_baton,
                                   apr_pool_t *scratch_pool)
 {
   update_move_baton_t umb = { NULL };
-  svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
-  const char *dummy1, *dummy2, *dummy3;
-  const char *move_root_dst_abspath;
-  const char *move_root_dst_relpath;
+  const char *src_relpath, *dst_relpath;
+  svn_wc_conflict_version_t old_version;
+  svn_wc_conflict_version_t new_version;
+  apr_int64_t repos_id;
+  node_move_baton_t nmb = { 0 };
 
-  /* ### assumes wc write lock already held */
+  SVN_ERR_ASSERT(svn_relpath_skip_ancestor(delete_relpath, local_relpath));
 
   /* Construct editor baton. */
-  SVN_ERR(svn_wc__db_op_depth_moved_to(
-            &dummy1, &move_root_dst_relpath, &dummy2, &dummy3,
-            relpath_depth(move_src_op_root_relpath) - 1,
-            wcroot, victim_relpath, scratch_pool, scratch_pool));
-  if (move_root_dst_relpath == NULL)
+
+  SVN_ERR(find_src_op_depth(&umb.src_op_depth, wcroot,
+                            local_relpath, relpath_depth(delete_relpath),
+                            scratch_pool));
+
+  SVN_ERR(svn_wc__db_scan_moved_to_internal(&src_relpath, &dst_relpath, NULL,
+                                            wcroot, local_relpath,
+                                            umb.src_op_depth,
+                                            scratch_pool, scratch_pool));
+
+  if (dst_relpath == NULL)
     return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
                              _("The node '%s' has not been moved away"),
-                             path_for_error_message(wcroot, victim_relpath,
+                             path_for_error_message(wcroot, local_relpath,
                                                     scratch_pool));
 
-  move_root_dst_abspath
-    = svn_dirent_join(wcroot->abspath, move_root_dst_relpath, scratch_pool);
-  SVN_ERR(svn_wc__write_check(db, move_root_dst_abspath, scratch_pool));
+  umb.dst_op_depth = relpath_depth(dst_relpath);
+
+  SVN_ERR(verify_write_lock(wcroot, src_relpath, scratch_pool));
+  SVN_ERR(verify_write_lock(wcroot, dst_relpath, scratch_pool));
+
+
+  SVN_ERR(svn_wc__db_depth_get_info(NULL, &new_version.node_kind,
+                                    &new_version.peg_rev,
+                                    &new_version.path_in_repos, &repos_id,
+                                    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                    NULL,
+                                    wcroot, src_relpath, umb.src_op_depth,
+                                    scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_wc__db_fetch_repos_info(&new_version.repos_url,
+                                      &new_version.repos_uuid,
+                                      wcroot, repos_id,
+                                      scratch_pool));
+
+  SVN_ERR(svn_wc__db_depth_get_info(NULL, &old_version.node_kind,
+                                    &old_version.peg_rev,
+                                    &old_version.path_in_repos, &repos_id,
+                                    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                    NULL,
+                                    wcroot, dst_relpath, umb.dst_op_depth,
+                                    scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_wc__db_fetch_repos_info(&old_version.repos_url,
+                                      &old_version.repos_uuid,
+                                      wcroot, repos_id,
+                                      scratch_pool));
+  *old_rev = old_version.peg_rev;
+  *new_rev = new_version.peg_rev;
 
   umb.operation = operation;
-  umb.old_version= old_version;
-  umb.new_version= new_version;
+  umb.old_version= &old_version;
+  umb.new_version= &new_version;
   umb.db = db;
   umb.wcroot = wcroot;
-
-  umb.dst_op_depth = relpath_depth(move_root_dst_relpath);
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_SELECT_HIGHEST_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
-                            move_src_op_root_relpath,
-                            relpath_depth(move_src_op_root_relpath)));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  if (have_row)
-    umb.src_op_depth = svn_sqlite__column_int(stmt, 0);
-  SVN_ERR(svn_sqlite__reset(stmt));
-  if (!have_row)
-    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
-                             _("'%s' is not deleted"),
-                             path_for_error_message(wcroot, victim_relpath,
-                                                    scratch_pool));
+  umb.cancel_func = cancel_func;
+  umb.cancel_baton = cancel_baton;
 
   if (umb.src_op_depth == 0)
-    SVN_ERR(suitable_for_move(wcroot, victim_relpath, scratch_pool));
+    SVN_ERR(suitable_for_move(wcroot, src_relpath, scratch_pool));
 
   /* Create a new, and empty, list for notification information. */
   SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
                                       STMT_CREATE_UPDATE_MOVE_LIST));
-  /* Create the editor... */
 
-  /* ... and drive it. */
-  SVN_ERR(drive_tree_conflict_editor(&umb,
-                                     victim_relpath,
-                                     move_root_dst_relpath,
-                                     operation,
-                                     local_change, incoming_change,
-                                     umb.old_version,
-                                     umb.new_version,
-                                     wcroot,
-                                     cancel_func, cancel_baton,
-                                     scratch_pool));
+  /* Drive the editor... */
+
+  nmb.umb = &umb;
+  nmb.src_relpath = src_relpath;
+  nmb.dst_relpath = dst_relpath;
+  /* nmb.shadowed = FALSE; */
+  /* nmb.edited = FALSE; */
+  /* nmb.skip_children = FALSE; */
+
+  /* We walk the move source (i.e. the post-update tree), comparing each node
+    * with the equivalent node at the move destination and applying the update
+    * to nodes at the move destination. */
+  SVN_ERR(update_moved_away_node(&nmb, wcroot, src_relpath, dst_relpath,
+                                 scratch_pool));
+
+  SVN_ERR(svn_wc__db_op_copy_layer_internal(wcroot, src_relpath,
+                                            umb.src_op_depth,
+                                            dst_relpath, NULL, NULL,
+                                            scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1817,58 +1845,43 @@ update_moved_away_conflict_victim(svn_wc
 
 svn_error_t *
 svn_wc__db_update_moved_away_conflict_victim(svn_wc__db_t *db,
-                                             const char *victim_abspath,
-                                             svn_wc_notify_func2_t notify_func,
-                                             void *notify_baton,
+                                             const char *local_abspath,
+                                             const char *delete_op_abspath,
+                                             svn_wc_operation_t operation,
+                                             svn_wc_conflict_action_t action,
+                                             svn_wc_conflict_reason_t reason,
                                              svn_cancel_func_t cancel_func,
                                              void *cancel_baton,
+                                             svn_wc_notify_func2_t notify_func,
+                                             void *notify_baton,
                                              apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
+  svn_revnum_t old_rev, new_rev;
   const char *local_relpath;
-  svn_wc_operation_t operation;
-  svn_wc_conflict_reason_t local_change;
-  svn_wc_conflict_action_t incoming_change;
-  svn_wc_conflict_version_t *old_version;
-  svn_wc_conflict_version_t *new_version;
-  const char *move_src_op_root_abspath, *move_src_op_root_relpath;
+  const char *delete_relpath;
 
   /* ### Check for mixed-rev src or dst? */
 
-  SVN_ERR(get_tc_info(&operation, &local_change, &incoming_change,
-                      &move_src_op_root_abspath,
-                      &old_version, &new_version,
-                      db, victim_abspath,
-                      scratch_pool, scratch_pool));
-
-  SVN_ERR(svn_wc__write_check(db, move_src_op_root_abspath, scratch_pool));
-
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                                db, victim_abspath,
+                                                db, local_abspath,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  move_src_op_root_relpath
-    = svn_dirent_skip_ancestor(wcroot->abspath, move_src_op_root_abspath);
+  delete_relpath
+    = svn_dirent_skip_ancestor(wcroot->abspath, delete_op_abspath);
 
   SVN_WC__DB_WITH_TXN(
     update_moved_away_conflict_victim(
-      db, wcroot, local_relpath,
-      operation, local_change, incoming_change,
-      move_src_op_root_relpath,
-      old_version, new_version,
+      &old_rev, &new_rev,
+      db, wcroot, local_relpath, delete_relpath,
+      operation, action, reason,
       cancel_func, cancel_baton,
       scratch_pool),
     wcroot);
 
   /* Send all queued up notifications. */
-  SVN_ERR(svn_wc__db_update_move_list_notify(wcroot,
-                                             (old_version
-                                              ? old_version->peg_rev
-                                              : SVN_INVALID_REVNUM),
-                                             (new_version
-                                              ? new_version->peg_rev
-                                              : SVN_INVALID_REVNUM),
+  SVN_ERR(svn_wc__db_update_move_list_notify(wcroot, old_rev, new_rev,
                                              notify_func, notify_baton,
                                              scratch_pool));
   if (notify_func)
@@ -1883,7 +1896,7 @@ svn_wc__db_update_moved_away_conflict_vi
       notify->kind = svn_node_none;
       notify->content_state = svn_wc_notify_state_inapplicable;
       notify->prop_state = svn_wc_notify_state_inapplicable;
-      notify->revision = new_version->peg_rev;
+      notify->revision = new_rev;
       notify_func(notify_baton, notify, scratch_pool);
     }
 
@@ -1973,7 +1986,7 @@ bump_mark_tree_conflict(svn_wc__db_wcroo
                                             wcroot, move_src_op_root_relpath,
                                             scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__db_fetch_repos_info(&repos_root_url, &repos_uuid,
-                                      wcroot->sdb, repos_id, scratch_pool));
+                                      wcroot, repos_id, scratch_pool));
 
   /* Read old (pre-update) information from the move destination node.
 
@@ -2023,7 +2036,7 @@ bump_mark_tree_conflict(svn_wc__db_wcroo
                                move_src_op_root_relpath,
                                scratch_pool, scratch_pool));
 
-  SVN_ERR(update_move_list_add(wcroot, move_src_root_relpath,
+  SVN_ERR(update_move_list_add(wcroot, move_src_root_relpath, db,
                                svn_wc_notify_tree_conflict,
                                new_kind,
                                svn_wc_notify_state_inapplicable,
@@ -2279,17 +2292,27 @@ svn_wc__db_bump_moved_away(svn_wc__db_wc
 
   if (local_relpath[0] != '\0')
     {
-      const char *dummy1, *move_dst_op_root_relpath;
-      const char *move_src_root_relpath, *move_src_op_root_relpath;
+      const char *move_dst_op_root_relpath;
+      const char *move_src_root_relpath, *delete_relpath;
+      svn_error_t *err;
 
       /* Is the root of the update moved away? (Impossible for the wcroot) */
-      SVN_ERR(svn_wc__db_op_depth_moved_to(&dummy1, &move_dst_op_root_relpath,
-                                           &move_src_root_relpath,
-                                           &move_src_op_root_relpath, 0,
-                                           wcroot, local_relpath,
-                                           scratch_pool, scratch_pool));
 
-      if (move_src_root_relpath)
+      err = svn_wc__db_scan_moved_to_internal(&move_src_root_relpath,
+                                              &move_dst_op_root_relpath,
+                                              &delete_relpath,
+                                              wcroot, local_relpath,
+                                              0 /* BASE */,
+                                              scratch_pool, scratch_pool);
+
+      if (err)
+        {
+          if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+            return svn_error_trace(err);
+
+          svn_error_clear(err);
+        }
+      else if (move_src_root_relpath)
         {
           if (strcmp(move_src_root_relpath, local_relpath))
             {
@@ -2309,7 +2332,7 @@ svn_wc__db_bump_moved_away(svn_wc__db_wc
                 {
                   SVN_ERR(bump_mark_tree_conflict(wcroot,
                                                   move_src_root_relpath,
-                                                  move_src_op_root_relpath,
+                                                  delete_relpath,
                                                   move_dst_op_root_relpath,
                                                   db, scratch_pool));
                 }
@@ -2323,15 +2346,17 @@ svn_wc__db_bump_moved_away(svn_wc__db_wc
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *
-resolve_delete_raise_moved_away(svn_wc__db_wcroot_t *wcroot,
-                                const char *local_relpath,
-                                svn_wc__db_t *db,
-                                svn_wc_operation_t operation,
-                                svn_wc_conflict_action_t action,
-                                svn_wc_conflict_version_t *old_version,
-                                svn_wc_conflict_version_t *new_version,
-                                apr_pool_t *scratch_pool)
+svn_error_t *
+svn_wc__db_op_raise_moved_away_internal(
+                        svn_wc__db_wcroot_t *wcroot,
+                        const char *local_relpath,
+                        int delete_op_depth,
+                        svn_wc__db_t *db,
+                        svn_wc_operation_t operation,
+                        svn_wc_conflict_action_t action,
+                        const svn_wc_conflict_version_t *old_version,
+                        const svn_wc_conflict_version_t *new_version,
+                        apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
@@ -2341,17 +2366,17 @@ resolve_delete_raise_moved_away(svn_wc__
                                       STMT_CREATE_UPDATE_MOVE_LIST));
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_SELECT_OP_DEPTH_MOVED_PAIR));
+                                    STMT_SELECT_MOVED_DESCENDANTS_SHD));
   SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, local_relpath,
-                            relpath_depth(local_relpath)));
+                            delete_op_depth));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   while(have_row)
     {
       svn_error_t *err;
-      const char *src_relpath = svn_sqlite__column_text(stmt, 0, NULL);
-      svn_node_kind_t src_kind = svn_sqlite__column_token(stmt, 1, kind_map);
-      const char *dst_relpath = svn_sqlite__column_text(stmt, 2, NULL);
+      const char *src_relpath = svn_sqlite__column_text(stmt, 1, NULL);
+      svn_node_kind_t src_kind = svn_sqlite__column_token(stmt, 2, kind_map);
       const char *src_repos_relpath = svn_sqlite__column_text(stmt, 3, NULL);
+      const char *dst_relpath = svn_sqlite__column_text(stmt, 4, NULL);
       svn_skel_t *conflict;
       svn_pool_clear(iterpool);
 
@@ -2363,11 +2388,14 @@ resolve_delete_raise_moved_away(svn_wc__
                                  src_kind /* ### new kind */,
                                  src_repos_relpath,
                                  svn_wc_conflict_reason_moved_away,
-                                 action, local_relpath,
+                                 action,
+                                 svn_relpath_limit(src_relpath,
+                                                   delete_op_depth,
+                                                   iterpool),
                                  iterpool, iterpool);
 
       if (!err)
-        err = update_move_list_add(wcroot, src_relpath,
+        err = update_move_list_add(wcroot, src_relpath, db,
                                    svn_wc_notify_tree_conflict,
                                    src_kind,
                                    svn_wc_notify_state_inapplicable,
@@ -2410,10 +2438,11 @@ svn_wc__db_resolve_delete_raise_moved_aw
                       db, local_abspath, scratch_pool, scratch_pool));
 
   SVN_WC__DB_WITH_TXN(
-    resolve_delete_raise_moved_away(wcroot, local_relpath,
-                                    db, operation, action,
-                                    old_version, new_version,
-                                    scratch_pool),
+    svn_wc__db_op_raise_moved_away_internal(wcroot, local_relpath,
+                                            relpath_depth(local_relpath),
+                                            db, operation, action,
+                                            old_version, new_version,
+                                            scratch_pool),
     wcroot);
 
   SVN_ERR(svn_wc__db_update_move_list_notify(wcroot,
@@ -2430,63 +2459,41 @@ svn_wc__db_resolve_delete_raise_moved_aw
 }
 
 static svn_error_t *
-break_move(svn_wc__db_wcroot_t *wcroot,
-           const char *src_relpath,
-           int src_op_depth,
-           const char *dst_relpath,
-           apr_pool_t *scratch_pool)
+break_moved_away(svn_wc__db_wcroot_t *wcroot,
+                 const char *local_relpath,
+                 int op_depth,
+                 apr_pool_t *scratch_pool)
 {
-  svn_sqlite__stmt_t *stmt;
+  const char *dst_relpath;
+  int src_op_depth;
+  const char *delete_relpath;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_CLEAR_MOVED_TO_RELPATH));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, src_relpath,
-                            src_op_depth));
-  SVN_ERR(svn_sqlite__step_done(stmt));
+  SVN_ERR(find_src_op_depth(&src_op_depth, wcroot,
+                            local_relpath, op_depth,
+                            scratch_pool));
 
-  /* The destination is always an op-root, so we can calculate the depth
-     from there. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_CLEAR_MOVED_HERE_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
-                            dst_relpath, relpath_depth(dst_relpath)));
-  SVN_ERR(svn_sqlite__step_done(stmt));
 
-  return SVN_NO_ERROR;
-}
+  SVN_ERR(svn_wc__db_scan_moved_to_internal(NULL, &dst_relpath,
+                                            &delete_relpath,
+                                            wcroot, local_relpath,
+                                            src_op_depth,
+                                            scratch_pool, scratch_pool));
 
-svn_error_t *
-svn_wc__db_resolve_break_moved_away_internal(svn_wc__db_wcroot_t *wcroot,
-                                             const char *local_relpath,
-                                             int op_depth,
-                                             apr_pool_t *scratch_pool)
-{
-  const char *dummy1, *move_dst_op_root_relpath;
-  const char *dummy2, *move_src_op_root_relpath;
+  SVN_ERR_ASSERT(dst_relpath != NULL && delete_relpath != NULL);
 
-  /* We want to include the passed op-depth, but the function does a > check */
-  SVN_ERR(svn_wc__db_op_depth_moved_to(&dummy1, &move_dst_op_root_relpath,
-                                       &dummy2,
-                                       &move_src_op_root_relpath,
-                                       op_depth - 1,
-                                       wcroot, local_relpath,
-                                       scratch_pool, scratch_pool));
-
-  SVN_ERR_ASSERT(move_src_op_root_relpath != NULL
-                 && move_dst_op_root_relpath != NULL);
-
-  SVN_ERR(break_move(wcroot, local_relpath,
-                     relpath_depth(move_src_op_root_relpath),
-                     move_dst_op_root_relpath,
-                     scratch_pool));
+  SVN_ERR(svn_wc__db_op_break_move_internal(wcroot, local_relpath,
+                                            relpath_depth(delete_relpath),
+                                            dst_relpath, NULL,
+                                            scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
 static svn_error_t *
-break_moved_away_children_internal(svn_wc__db_wcroot_t *wcroot,
-                                   const char *local_relpath,
-                                   apr_pool_t *scratch_pool)
+break_moved_away_children(svn_wc__db_wcroot_t *wcroot,
+                          svn_wc__db_t *db,
+                          const char *local_relpath,
+                          apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
@@ -2496,7 +2503,7 @@ break_moved_away_children_internal(svn_w
                                       STMT_CREATE_UPDATE_MOVE_LIST));
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_SELECT_MOVED_DESCENDANTS));
+                                    STMT_SELECT_MOVED_DESCENDANTS_SRC));
   SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, local_relpath,
                             relpath_depth(local_relpath)));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
@@ -2504,21 +2511,23 @@ break_moved_away_children_internal(svn_w
   iterpool = svn_pool_create(scratch_pool);
   while (have_row)
     {
-      const char *src_relpath = svn_sqlite__column_text(stmt, 0, NULL);
-      const char *dst_relpath = svn_sqlite__column_text(stmt, 1, NULL);
-      int src_op_depth = svn_sqlite__column_int(stmt, 2);
+      int src_op_depth = svn_sqlite__column_int(stmt, 0) ;
+      const char *src_relpath = svn_sqlite__column_text(stmt, 1, NULL);
+      svn_node_kind_t src_kind = svn_sqlite__column_token(stmt, 2, kind_map);
+      const char *dst_relpath = svn_sqlite__column_text(stmt, 4, NULL);
       svn_error_t *err;
 
       svn_pool_clear(iterpool);
 
-      err = break_move(wcroot, src_relpath, src_op_depth, dst_relpath,
-                       iterpool);
+      err = svn_wc__db_op_break_move_internal(wcroot,
+                                              src_relpath, src_op_depth,
+                                              dst_relpath, NULL, iterpool);
 
       if (! err)
         {
-          err = update_move_list_add(wcroot, src_relpath,
+          err = update_move_list_add(wcroot, src_relpath, db,
                                      svn_wc_notify_move_broken,
-                                     svn_node_unknown,
+                                     src_kind,
                                      svn_wc_notify_state_inapplicable,
                                      svn_wc_notify_state_inapplicable,
                                      NULL, NULL, scratch_pool);
@@ -2560,11 +2569,10 @@ svn_wc__db_resolve_break_moved_away(svn_
   src_relpath = svn_dirent_skip_ancestor(wcroot->abspath, src_op_root_abspath);
   SVN_ERR_ASSERT(src_relpath != NULL);
 
-  SVN_WC__DB_WITH_TXN(
-    svn_wc__db_resolve_break_moved_away_internal(wcroot, local_relpath,
-                                                 relpath_depth(src_relpath),
-                                                 scratch_pool),
-    wcroot);
+  SVN_WC__DB_WITH_TXN(break_moved_away(wcroot, local_relpath,
+                                       relpath_depth(src_relpath),
+                                       scratch_pool),
+                      wcroot);
 
   if (notify_func)
     {
@@ -2602,7 +2610,7 @@ svn_wc__db_resolve_break_moved_away_chil
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_WC__DB_WITH_TXN(
-    break_moved_away_children_internal(wcroot, local_relpath, scratch_pool),
+    break_moved_away_children(wcroot, db, local_relpath, scratch_pool),
     wcroot);
 
   SVN_ERR(svn_wc__db_update_move_list_notify(wcroot,

Modified: subversion/branches/fsx-1.10/subversion/mod_dav_svn/deadprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/mod_dav_svn/deadprops.c?rev=1659238&r1=1659237&r2=1659238&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/mod_dav_svn/deadprops.c (original)
+++ subversion/branches/fsx-1.10/subversion/mod_dav_svn/deadprops.c Thu Feb 12 12:21:31 2015
@@ -638,16 +638,14 @@ static void get_name(dav_db *db, dav_pro
     }
   else
     {
-      const void *name;
-
-      apr_hash_this(db->hi, &name, NULL, NULL);
+      const char *name = apr_hash_this_key(db->hi);
 
 #define PREFIX_LEN (sizeof(SVN_PROP_PREFIX) - 1)
       if (strncmp(name, SVN_PROP_PREFIX, PREFIX_LEN) == 0)
 #undef PREFIX_LEN
         {
           pname->ns = SVN_DAV_PROP_NS_SVN;
-          pname->name = (const char *)name + 4;
+          pname->name = name + 4;
         }
       else
         {

Propchange: subversion/branches/fsx-1.10/subversion/svnbench/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Feb 12 12:21:31 2015
@@ -0,0 +1,3 @@
+svnbench
+svn.1
+.libs

Modified: subversion/branches/fsx-1.10/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svndumpfilter/svndumpfilter.c?rev=1659238&r1=1659237&r2=1659238&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/fsx-1.10/subversion/svndumpfilter/svndumpfilter.c Thu Feb 12 12:21:31 2015
@@ -278,7 +278,7 @@ struct node_baton_t
   svn_filesize_t tcl;
 
   /* Pointers to dumpfile data. */
-  apr_array_header_t *headers;
+  svn_repos__dumpfile_headers_t *headers;
   svn_stringbuf_t *props;
 
   /* Expect deltas? */

Modified: subversion/branches/fsx-1.10/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnrdump/dump_editor.c?rev=1659238&r1=1659237&r2=1659238&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/fsx-1.10/subversion/svnrdump/dump_editor.c Thu Feb 12 12:21:31 2015
@@ -58,7 +58,7 @@ struct dir_baton
   svn_revnum_t copyfrom_rev;
 
   /* Headers accumulated so far for this directory */
-  apr_array_header_t *headers;
+  svn_repos__dumpfile_headers_t *headers;
 
   /* Properties which were modified during change_dir_prop. */
   apr_hash_t *props;
@@ -72,9 +72,8 @@ struct dir_baton
      us, although they're all really within this directory. */
   apr_hash_t *deleted_entries;
 
-  /* Flags to trigger dumping props and record termination newlines. */
+  /* Flag to trigger dumping props. */
   svn_boolean_t dump_props;
-  svn_boolean_t dump_newlines;
 };
 
 /* A file baton used by all file-related callback functions in the dump
@@ -223,7 +222,7 @@ make_file_baton(const char *path,
  * content section, to represent the property delta of PROPS/DELETED_PROPS.
  */
 static svn_error_t *
-get_props_content(apr_array_header_t *headers,
+get_props_content(svn_repos__dumpfile_headers_t *headers,
                   svn_stringbuf_t **content,
                   apr_hash_t *props,
                   apr_hash_t *deleted_props,
@@ -262,7 +261,8 @@ dump_node_delete(svn_stream_t *stream,
                  const char *node_relpath,
                  apr_pool_t *pool)
 {
-  apr_array_header_t *headers = svn_repos__dumpfile_headers_create(pool);
+  svn_repos__dumpfile_headers_t *headers
+    = svn_repos__dumpfile_headers_create(pool);
 
   assert(svn_relpath_is_canonical(node_relpath));
 
@@ -274,7 +274,9 @@ dump_node_delete(svn_stream_t *stream,
   svn_repos__dumpfile_header_push(
     headers, SVN_REPOS_DUMPFILE_NODE_ACTION, "delete");
 
-  SVN_ERR(svn_repos__dump_headers(stream, headers, TRUE, pool));
+  SVN_ERR(svn_repos__dump_node_record(stream, headers,
+                                      NULL, FALSE, 0,  /* props & text */
+                                      FALSE /*content_length_always*/, pool));
   return SVN_NO_ERROR;
 }
 
@@ -296,7 +298,7 @@ dump_node_delete(svn_stream_t *stream,
  * header block.)
  */
 static svn_error_t *
-dump_node(apr_array_header_t **headers_p,
+dump_node(svn_repos__dumpfile_headers_t **headers_p,
           struct dump_edit_baton *eb,
           const char *repos_relpath,
           struct dir_baton *db,
@@ -308,7 +310,8 @@ dump_node(apr_array_header_t **headers_p
           apr_pool_t *pool)
 {
   const char *node_relpath = repos_relpath;
-  apr_array_header_t *headers = svn_repos__dumpfile_headers_create(pool);
+  svn_repos__dumpfile_headers_t *headers
+    = svn_repos__dumpfile_headers_create(pool);
 
   assert(svn_relpath_is_canonical(repos_relpath));
   assert(!copyfrom_path || svn_relpath_is_canonical(copyfrom_path));
@@ -394,16 +397,6 @@ dump_node(apr_array_header_t **headers_p
             headers, SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV, "%ld", copyfrom_rev);
           svn_repos__dumpfile_header_push(
             headers, SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH, copyfrom_path);
-
-          /* Ugly hack: If a directory was copied from a previous
-             revision, nothing like close_file() will be called to write two
-             blank lines. If change_dir_prop() is called, props are dumped
-             (along with the necessary PROPS-END\n\n and we're good. So
-             set DUMP_NEWLINES here to print the newlines unless
-             change_dir_prop() is called next otherwise the `svnadmin load`
-             parser will fail.  */
-          if (db)
-            db->dump_newlines = TRUE;
         }
       else
         {
@@ -445,7 +438,8 @@ dump_mkdir(struct dump_edit_baton *eb,
            apr_pool_t *pool)
 {
   svn_stringbuf_t *prop_content;
-  apr_array_header_t *headers = svn_repos__dumpfile_headers_create(pool);
+  svn_repos__dumpfile_headers_t *headers
+    = svn_repos__dumpfile_headers_create(pool);
 
   /* Node-path: ... */
   svn_repos__dumpfile_header_push(
@@ -496,25 +490,18 @@ dump_pending_dir(struct dump_edit_baton
                                       FALSE, 0, FALSE /*content_length_always*/,
                                       scratch_pool));
 
+  /* No text is going to be dumped. Write a couple of newlines and
+       wait for the next node/ revision. */
+  SVN_ERR(svn_stream_puts(eb->stream, "\n\n"));
+
   if (db->dump_props)
     {
-      /* No text is going to be dumped. Write a couple of newlines and
-         wait for the next node/ revision. */
-      SVN_ERR(svn_stream_puts(eb->stream, "\n\n"));
-
       /* Cleanup so that data is never dumped twice. */
       apr_hash_clear(db->props);
       apr_hash_clear(db->deleted_props);
       db->dump_props = FALSE;
     }
 
-  /* Some pending newlines to dump? */
-  if (db->dump_newlines)
-    {
-      SVN_ERR(svn_stream_puts(eb->stream, "\n\n"));
-      db->dump_newlines = FALSE;
-    }
-
   /* Anything that was pending is pending no longer. */
   eb->pending_db = NULL;
 
@@ -828,9 +815,7 @@ change_dir_prop(void *parent_baton,
   else
     svn_hash_sets(db->deleted_props, apr_pstrdup(db->pool, name), "");
 
-  /* Make sure we eventually output the props, and disable printing
-     a couple of extra newlines */
-  db->dump_newlines = FALSE;
+  /* Make sure we eventually output the props */
   db->dump_props = TRUE;
 
   return SVN_NO_ERROR;
@@ -896,7 +881,7 @@ close_file(void *file_baton,
   struct dump_edit_baton *eb = fb->eb;
   apr_finfo_t *info = apr_pcalloc(pool, sizeof(apr_finfo_t));
   svn_stringbuf_t *propstring = NULL;
-  apr_array_header_t *headers;
+  svn_repos__dumpfile_headers_t *headers;
 
   SVN_ERR(dump_pending_dir(eb, pool));
 



Mime
View raw message