You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/02/10 17:56:34 UTC

svn commit: r1069465 [2/2] - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1069465&r1=1069464&r2=1069465&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Feb 10 16:56:33 2011
@@ -242,7 +242,7 @@ insert_incomplete_children(svn_sqlite__d
 
 static svn_error_t *
 db_read_pristine_props(apr_hash_t **props,
-                       svn_wc__db_pdh_t *pdh,
+                       svn_wc__db_wcroot_t *wcroot,
                        const char *local_relpath,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool);
@@ -270,7 +270,7 @@ read_info(svn_wc__db_status_t *status,
           svn_boolean_t *have_work,
           svn_boolean_t *conflicted,
           svn_wc__db_lock_t **lock,
-          svn_wc__db_pdh_t *pdh,
+          svn_wc__db_wcroot_t *wcroot,
           const char *local_relpath,
           apr_pool_t *result_pool,
           apr_pool_t *scratch_pool);
@@ -283,7 +283,7 @@ scan_addition(svn_wc__db_status_t *statu
               const char **original_repos_relpath,
               apr_int64_t *original_repos_id,
               svn_revnum_t *original_revision,
-              svn_wc__db_pdh_t *pdh,
+              svn_wc__db_wcroot_t *wcroot,
               const char *local_relpath,
               apr_pool_t *result_pool,
               apr_pool_t *scratch_pool);
@@ -292,7 +292,7 @@ static svn_error_t *
 scan_deletion(const char **base_del_relpath,
               const char **moved_to_relpath,
               const char **work_del_relpath,
-              svn_wc__db_pdh_t *pdh,
+              svn_wc__db_wcroot_t *wcroot,
               const char *local_relpath,
               apr_pool_t *result_pool,
               apr_pool_t *scratch_pool);
@@ -303,7 +303,7 @@ convert_to_working_status(svn_wc__db_sta
 
 static svn_error_t *
 wclock_owns_lock(svn_boolean_t *own_lock,
-                 svn_wc__db_pdh_t *pdh,
+                 svn_wc__db_wcroot_t *wcroot,
                  const char *local_relpath,
                  svn_boolean_t exact,
                  apr_pool_t *scratch_pool);
@@ -996,7 +996,7 @@ add_children_to_hash(apr_hash_t *childre
    of any status, in all op-depths in the NODES table. */
 static svn_error_t *
 gather_children(const apr_array_header_t **children,
-                svn_wc__db_pdh_t *pdh,
+                svn_wc__db_wcroot_t *wcroot,
                 const char *local_relpath,
                 apr_pool_t *result_pool,
                 apr_pool_t *scratch_pool)
@@ -1008,7 +1008,7 @@ gather_children(const apr_array_header_t
      appears to be faster to use the hash to remove duplicates than to
      use DISTINCT in the SQL query. */
   SVN_ERR(add_children_to_hash(names_hash, STMT_SELECT_NODE_CHILDREN,
-                               pdh->wcroot->sdb, pdh->wcroot->wc_id,
+                               wcroot->sdb, wcroot->wc_id,
                                local_relpath, result_pool));
 
   SVN_ERR(svn_hash_keys(&names_array, names_hash, result_pool));
@@ -1017,11 +1017,11 @@ gather_children(const apr_array_header_t
 }
 
 /* Set *CHILDREN to a new array of (const char *) names of the repository
-   children of the directory PDH:LOCAL_RELPATH - that is, the children at
+   children of the directory WCROOT:LOCAL_RELPATH - that is, the children at
    the same op-depth. */
 static svn_error_t *
 gather_repo_children(const apr_array_header_t **children,
-                     svn_wc__db_pdh_t *pdh,
+                     svn_wc__db_wcroot_t *wcroot,
                      const char *local_relpath,
                      apr_int64_t op_depth,
                      apr_pool_t *result_pool,
@@ -1032,9 +1032,9 @@ gather_repo_children(const apr_array_hea
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_OP_DEPTH_CHILDREN));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isi", pdh->wcroot->wc_id, local_relpath,
+  SVN_ERR(svn_sqlite__bindf(stmt, "isi", wcroot->wc_id, local_relpath,
                             op_depth));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   while (have_row)
@@ -1288,14 +1288,14 @@ svn_wc__db_to_relpath(const char **local
                       apr_pool_t *result_pool,
                       apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, local_relpath, db,
                               local_abspath, svn_sqlite__mode_readonly,
                               result_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
   return SVN_NO_ERROR;
 }
@@ -1309,19 +1309,19 @@ svn_wc__db_from_relpath(const char **loc
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *unused_relpath;
 
 #if 0
   SVN_ERR_ASSERT(svn_relpath_is_canonical(local_abspath));
 #endif
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &unused_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &unused_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
-  *local_abspath = svn_dirent_join(pdh->wcroot->abspath,
+  *local_abspath = svn_dirent_join(wcroot->abspath,
                                    local_relpath,
                                    result_pool);
   return SVN_NO_ERROR;
@@ -1334,23 +1334,23 @@ svn_wc__db_get_wcroot(const char **wcroo
                       apr_pool_t *result_pool,
                       apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *unused_relpath;
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &unused_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &unused_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
 
   /* Can't use VERIFY_USABLE_WCROOT, as this should be usable to detect
      where call upgrade */
 
-  if (pdh->wcroot == NULL)
+  if (wcroot == NULL)
     return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
                              _("The node '%s' is not in a workingcopy."),
                              svn_dirent_local_style(wri_abspath,
                                                     scratch_pool));
 
-  *wcroot_abspath = apr_pstrdup(result_pool, pdh->wcroot->abspath);
+  *wcroot_abspath = apr_pstrdup(result_pool, wcroot->abspath);
 
   return SVN_NO_ERROR;
 }
@@ -1379,18 +1379,18 @@ svn_wc__db_with_sqlite_lock(svn_wc__db_t
                             void *cb_baton,
                             apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *unused_relpath;
   struct with_sqlite_lock_baton baton;
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &unused_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &unused_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
 
   /* Can't use VERIFY_USABLE_WCROOT, as this should be usable to detect
      where call upgrade */
 
-  if (pdh->wcroot == NULL || !pdh->wcroot->sdb)
+  if (wcroot == NULL || !wcroot->sdb)
     return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
                              _("The node '%s' is not in a workingcopy."),
                              svn_dirent_local_style(wri_abspath,
@@ -1401,7 +1401,7 @@ svn_wc__db_with_sqlite_lock(svn_wc__db_t
   baton.lock_baton = cb_baton;
 
   return svn_error_return(
-            svn_sqlite__with_lock(pdh->wcroot->sdb,
+            svn_sqlite__with_lock(wcroot->sdb,
                                   call_sqlite_lock_cb,
                                   &baton,
                                   scratch_pool));
@@ -1805,7 +1805,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
   return SVN_NO_ERROR;
 }
 
-/* Like svn_wc__db_base_get_info(), but taking PDH+LOCAL_RELPATH instead of
+/* Like svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH instead of
  * DB+LOCAL_ABSPATH and outputting REPOS_ID instead of URL+UUID. */
 static svn_error_t *
 base_get_info(svn_wc__db_status_t *status,
@@ -1822,7 +1822,7 @@ base_get_info(svn_wc__db_status_t *statu
               svn_filesize_t *translated_size,
               const char **target,
               svn_wc__db_lock_t **lock,
-              svn_wc__db_pdh_t *pdh,
+              svn_wc__db_wcroot_t *wcroot,
               const char *local_relpath,
               apr_pool_t *result_pool,
               apr_pool_t *scratch_pool)
@@ -1831,10 +1831,10 @@ base_get_info(svn_wc__db_status_t *statu
   svn_boolean_t have_row;
   svn_error_t *err = SVN_NO_ERROR;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     lock ? STMT_SELECT_BASE_NODE_WITH_LOCK
                                          : STMT_SELECT_BASE_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
   if (have_row)
@@ -1905,7 +1905,7 @@ base_get_info(svn_wc__db_status_t *statu
                 err = svn_error_createf(
                         err->apr_err, err,
                         _("The node '%s' has a corrupt checksum value."),
-                        path_for_error_message(pdh->wcroot, local_relpath,
+                        path_for_error_message(wcroot, local_relpath,
                                                scratch_pool));
             }
         }
@@ -1925,7 +1925,7 @@ base_get_info(svn_wc__db_status_t *statu
     {
       err = svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                               _("The node '%s' was not found."),
-                              path_for_error_message(pdh->wcroot, local_relpath,
+                              path_for_error_message(wcroot, local_relpath,
                                                      scratch_pool));
     }
 
@@ -1955,25 +1955,25 @@ svn_wc__db_base_get_info(svn_wc__db_stat
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
   apr_int64_t repos_id;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               local_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(base_get_info(status, kind, revision, repos_relpath, &repos_id,
                         changed_rev, changed_date, changed_author,
                         last_mod_time, depth, checksum, translated_size,
                         target, lock,
-                        pdh, local_relpath, result_pool, scratch_pool));
+                        wcroot, local_relpath, result_pool, scratch_pool));
   SVN_ERR_ASSERT(repos_id != INVALID_REPOS_ID);
   SVN_ERR(fetch_repos_info(repos_root_url, repos_uuid,
-                           pdh->wcroot->sdb, repos_id, result_pool));
+                           wcroot->sdb, repos_id, result_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2047,18 +2047,18 @@ svn_wc__db_base_get_children(const apr_a
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                                              local_abspath,
                                              svn_sqlite__mode_readonly,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
-  return gather_repo_children(children, pdh, local_relpath, 0,
+  return gather_repo_children(children, wcroot, local_relpath, 0,
                               result_pool, scratch_pool);
 }
 
@@ -2120,22 +2120,22 @@ svn_wc__db_base_clear_dav_cache_recursiv
                                           const char *local_abspath,
                                           apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
   const char *like_arg;
   svn_sqlite__stmt_t *stmt;
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                              db, local_abspath,
                                              svn_sqlite__mode_readwrite,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
   like_arg = construct_like_arg(local_relpath, scratch_pool);
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss", pdh->wcroot->wc_id, local_relpath,
+  SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
                             like_arg));
 
   SVN_ERR(svn_sqlite__step_done(stmt));
@@ -2146,9 +2146,9 @@ svn_wc__db_base_clear_dav_cache_recursiv
 /* Helper for svn_wc__db_op_copy to handle copying from one db to
    another */
 static svn_error_t *
-cross_db_copy(svn_wc__db_pdh_t *src_pdh,
+cross_db_copy(svn_wc__db_wcroot_t *src_wcroot,
               const char *src_relpath,
-              svn_wc__db_pdh_t *dst_pdh,
+              svn_wc__db_wcroot_t *dst_wcroot,
               const char *dst_relpath,
               svn_wc__db_status_t dst_status,
               apr_int64_t dst_op_depth,
@@ -2193,15 +2193,15 @@ cross_db_copy(svn_wc__db_pdh_t *src_pdh,
                     NULL /* have_work */,
                     NULL /* conflicted */,
                     NULL /* lock */,
-                    src_pdh, src_relpath, scratch_pool, scratch_pool));
+                    src_wcroot, src_relpath, scratch_pool, scratch_pool));
 
-  SVN_ERR(db_read_pristine_props(&props, src_pdh, src_relpath,
+  SVN_ERR(db_read_pristine_props(&props, src_wcroot, src_relpath,
                                  scratch_pool, scratch_pool));
 
   blank_iwb(&iwb);
   iwb.presence = dst_status;
   iwb.kind = kind;
-  iwb.wc_id = dst_pdh->wcroot->wc_id;
+  iwb.wc_id = dst_wcroot->wc_id;
   iwb.local_relpath = dst_relpath;
 
   iwb.props = props;
@@ -2219,11 +2219,11 @@ cross_db_copy(svn_wc__db_pdh_t *src_pdh,
   iwb.children = children;
   iwb.depth = depth;
 
-  SVN_ERR(insert_working_node(&iwb, dst_pdh->wcroot->sdb, scratch_pool));
+  SVN_ERR(insert_working_node(&iwb, dst_wcroot->sdb, scratch_pool));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
                                     STMT_SELECT_ACTUAL_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", src_pdh->wcroot->wc_id, src_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", src_wcroot->wc_id, src_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
     {
@@ -2245,10 +2245,10 @@ cross_db_copy(svn_wc__db_pdh_t *src_pdh,
       const char *properties = svn_sqlite__column_blob(stmt, 6, &props_size,
                                                        scratch_pool);
       SVN_ERR(svn_sqlite__reset(stmt));
-      SVN_ERR(svn_sqlite__get_statement(&stmt, dst_pdh->wcroot->sdb,
+      SVN_ERR(svn_sqlite__get_statement(&stmt, dst_wcroot->sdb,
                                         STMT_INSERT_ACTUAL_NODE));
       SVN_ERR(svn_sqlite__bindf(stmt, "issbsssss",
-                                dst_pdh->wcroot->wc_id, dst_relpath,
+                                dst_wcroot->wc_id, dst_relpath,
                                 svn_relpath_dirname(dst_relpath, scratch_pool),
                                 properties, props_size,
                                 conflict_old, conflict_new, conflict_working,
@@ -2271,7 +2271,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
                   svn_wc__db_status_t *status,
                   svn_wc__db_kind_t *kind,
                   svn_boolean_t *have_work,
-                  svn_wc__db_pdh_t *pdh,
+                  svn_wc__db_wcroot_t *wcroot,
                   const char *local_relpath,
                   apr_pool_t *result_pool,
                   apr_pool_t *scratch_pool)
@@ -2297,7 +2297,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
                     have_work,
                     NULL /* conflicted */,
                     NULL /* lock */,
-                    pdh, local_relpath, result_pool, scratch_pool));
+                    wcroot, local_relpath, result_pool, scratch_pool));
 
   if (*status == svn_wc__db_status_excluded)
     {
@@ -2312,7 +2312,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
                        scratch_pool);
       SVN_ERR(get_info_for_copy(copyfrom_id, copyfrom_relpath, copyfrom_rev,
                                 &parent_status, &parent_kind, &parent_have_work,
-                                pdh, parent_relpath,
+                                wcroot, parent_relpath,
                                 scratch_pool, scratch_pool));
       if (*copyfrom_relpath)
         *copyfrom_relpath = svn_relpath_join(*copyfrom_relpath, base_name,
@@ -2325,7 +2325,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
       SVN_ERR(scan_addition(NULL, &op_root_relpath,
                             NULL, NULL, /* repos_* */
                             copyfrom_relpath, copyfrom_id, copyfrom_rev,
-                            pdh, local_relpath,
+                            wcroot, local_relpath,
                             scratch_pool, scratch_pool));
       if (*copyfrom_relpath)
         {
@@ -2341,7 +2341,8 @@ get_info_for_copy(apr_int64_t *copyfrom_
       const char *base_del_relpath, *work_del_relpath;
 
       SVN_ERR(scan_deletion(&base_del_relpath, NULL, &work_del_relpath,
-                            pdh, local_relpath, scratch_pool, scratch_pool));
+                            wcroot, local_relpath, scratch_pool,
+                            scratch_pool));
       if (work_del_relpath)
         {
           const char *op_root_relpath;
@@ -2353,7 +2354,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
           SVN_ERR(scan_addition(NULL, &op_root_relpath,
                                 NULL, NULL, /* repos_* */
                                 copyfrom_relpath, copyfrom_id, copyfrom_rev,
-                                pdh, parent_del_relpath,
+                                wcroot, parent_del_relpath,
                                 scratch_pool, scratch_pool));
           *copyfrom_relpath
             = svn_relpath_join(*copyfrom_relpath,
@@ -2367,7 +2368,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
                                 copyfrom_id,
                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                 NULL, NULL,
-                                pdh, base_del_relpath,
+                                wcroot, base_del_relpath,
                                 result_pool, scratch_pool));
         }
       else
@@ -2384,7 +2385,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
 
 static svn_error_t *
 op_depth_of(apr_int64_t *op_depth,
-            svn_wc__db_pdh_t *pdh,
+            svn_wc__db_wcroot_t *wcroot,
             const char *local_relpath);
 
 static svn_error_t *
@@ -2392,16 +2393,16 @@ op_depth_for_copy(apr_int64_t *op_depth,
                   apr_int64_t copyfrom_repos_id,
                   const char *copyfrom_relpath,
                   svn_revnum_t copyfrom_revision,
-                  svn_wc__db_pdh_t *pdh,
+                  svn_wc__db_wcroot_t *wcroot,
                   const char *local_relpath,
                   apr_pool_t *scratch_pool);
 
 /* Like svn_wc__db_op_copy(), but with PDH+LOCAL_RELPATH instead of
  * DB+LOCAL_ABSPATH. */
 static svn_error_t *
-db_op_copy(svn_wc__db_pdh_t *src_pdh,
+db_op_copy(svn_wc__db_wcroot_t *src_wcroot,
            const char *src_relpath,
-           svn_wc__db_pdh_t *dst_pdh,
+           svn_wc__db_wcroot_t *dst_wcroot,
            const char *dst_relpath,
            const svn_skel_t *work_items,
            apr_pool_t *scratch_pool)
@@ -2416,12 +2417,12 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
   const apr_array_header_t *children;
 
   SVN_ERR(get_info_for_copy(&copyfrom_id, &copyfrom_relpath, &copyfrom_rev,
-                            &status, &kind, &have_work,
-                            src_pdh, src_relpath, scratch_pool, scratch_pool));
+                            &status, &kind, &have_work, src_wcroot,
+                            src_relpath, scratch_pool, scratch_pool));
 
   SVN_ERR(op_depth_for_copy(&dst_op_depth, copyfrom_id,
                             copyfrom_relpath, copyfrom_rev,
-                            dst_pdh, dst_relpath, scratch_pool));
+                            dst_wcroot, dst_relpath, scratch_pool));
 
   SVN_ERR_ASSERT(kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_dir);
 
@@ -2444,13 +2445,13 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
     case svn_wc__db_status_absent:
       return svn_error_createf(SVN_ERR_AUTHZ_UNREADABLE, NULL,
                                _("Cannot copy '%s' excluded by server"),
-                               path_for_error_message(src_pdh->wcroot,
+                               path_for_error_message(src_wcroot,
                                                       src_relpath,
                                                       scratch_pool));
     default:
       return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
                                _("Cannot handle status of '%s'"),
-                               path_for_error_message(src_pdh->wcroot,
+                               path_for_error_message(src_wcroot,
                                                       src_relpath,
                                                       scratch_pool));
     }
@@ -2459,28 +2460,28 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
     {
       apr_int64_t src_op_depth;
 
-      SVN_ERR(op_depth_of(&src_op_depth, src_pdh, src_relpath));
-      SVN_ERR(gather_repo_children(&children, src_pdh, src_relpath,
+      SVN_ERR(op_depth_of(&src_op_depth, src_wcroot, src_relpath));
+      SVN_ERR(gather_repo_children(&children, src_wcroot, src_relpath,
                                    src_op_depth, scratch_pool, scratch_pool));
     }
   else
     children = NULL;
 
-  if (src_pdh->wcroot == dst_pdh->wcroot)
+  if (src_wcroot == dst_wcroot)
     {
       svn_sqlite__stmt_t *stmt;
       const char *dst_parent_relpath = svn_relpath_dirname(dst_relpath,
                                                            scratch_pool);
 
       if (have_work)
-        SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
+        SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
                          STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING));
       else
-        SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
+        SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
                           STMT_INSERT_WORKING_NODE_COPY_FROM_BASE));
 
       SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
-                    src_pdh->wcroot->wc_id, src_relpath,
+                    src_wcroot->wc_id, src_relpath,
                     dst_relpath,
                     dst_op_depth,
                     dst_parent_relpath,
@@ -2495,10 +2496,9 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
       SVN_ERR(svn_sqlite__step_done(stmt));
 
       /* ### Copying changelist is OK for a move but what about a copy? */
-      SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
+      SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
                                   STMT_INSERT_ACTUAL_NODE_FROM_ACTUAL_NODE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isss",
-                                src_pdh->wcroot->wc_id, src_relpath,
+      SVN_ERR(svn_sqlite__bindf(stmt, "isss", src_wcroot->wc_id, src_relpath,
                                 dst_relpath, dst_parent_relpath));
       SVN_ERR(svn_sqlite__step_done(stmt));
 
@@ -2507,8 +2507,8 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
          (The only time we'd want a different depth is during a recursive
          simple add, but we never insert children here during a simple add.) */
       if (kind == svn_wc__db_kind_dir)
-        SVN_ERR(insert_incomplete_children(dst_pdh->wcroot->sdb,
-                                           dst_pdh->wcroot->wc_id,
+        SVN_ERR(insert_incomplete_children(dst_wcroot->sdb,
+                                           dst_wcroot->wc_id,
                                            dst_relpath,
                                            INVALID_REPOS_ID /* inherit repos_id */,
                                            NULL /* inherit repos_path */,
@@ -2519,14 +2519,13 @@ db_op_copy(svn_wc__db_pdh_t *src_pdh,
     }
   else
     {
-      SVN_ERR(cross_db_copy(src_pdh, src_relpath,
-                            dst_pdh, dst_relpath, dst_status, dst_op_depth,
-                            kind, children,
-                            copyfrom_id, copyfrom_relpath, copyfrom_rev,
-                            scratch_pool));
+      SVN_ERR(cross_db_copy(src_wcroot, src_relpath, dst_wcroot,
+                            dst_relpath, dst_status, dst_op_depth, kind,
+                            children, copyfrom_id, copyfrom_relpath,
+                            copyfrom_rev, scratch_pool));
     }
 
-  SVN_ERR(add_work_items(dst_pdh->wcroot->sdb, work_items, scratch_pool));
+  SVN_ERR(add_work_items(dst_wcroot->sdb, work_items, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2539,43 +2538,44 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
                    const svn_skel_t *work_items,
                    apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *src_pdh, *dst_pdh;
+  svn_wc__db_wcroot_t *src_wcroot;
+  svn_wc__db_wcroot_t *dst_wcroot;
   const char *src_relpath, *dst_relpath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&src_pdh, &src_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&src_wcroot, &src_relpath, db,
                                              src_abspath,
                                              svn_sqlite__mode_readwrite,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(src_pdh->wcroot);
+  VERIFY_USABLE_WCROOT(src_wcroot);
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&dst_pdh, &dst_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&dst_wcroot, &dst_relpath, db,
                                              dst_abspath,
                                              svn_sqlite__mode_readwrite,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(dst_pdh->wcroot);
+  VERIFY_USABLE_WCROOT(dst_wcroot);
 
   /* ### This should all happen in one transaction. */
-  SVN_ERR(db_op_copy(src_pdh, src_relpath, dst_pdh, dst_relpath,
-                     work_items, scratch_pool));
+  SVN_ERR(db_op_copy(src_wcroot, src_relpath, dst_wcroot,
+                     dst_relpath, work_items, scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
-/* Set *OP_DEPTH to the highest op depth of PDH:LOCAL_RELPATH. */
+/* Set *OP_DEPTH to the highest op depth of WCROOT:LOCAL_RELPATH. */
 static svn_error_t *
 op_depth_of(apr_int64_t *op_depth,
-            svn_wc__db_pdh_t *pdh,
+            svn_wc__db_wcroot_t *wcroot,
             const char *local_relpath)
 {
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_NODE_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   SVN_ERR_ASSERT(have_row);
   *op_depth = svn_sqlite__column_int64(stmt, 0);
@@ -2587,7 +2587,7 @@ op_depth_of(apr_int64_t *op_depth,
    copy must fail as it's not possible to commit such a copy.  Return
    an error if there are any absent nodes. */
 static svn_error_t *
-catch_copy_of_absent(svn_wc__db_pdh_t *pdh,
+catch_copy_of_absent(svn_wc__db_wcroot_t *wcroot,
                      const char *local_relpath,
                      apr_pool_t *scratch_pool)
 {
@@ -2595,10 +2595,10 @@ catch_copy_of_absent(svn_wc__db_pdh_t *p
   svn_boolean_t have_row;
   const char *absent_relpath;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_ABSENT_NODES));
   SVN_ERR(svn_sqlite__bindf(stmt, "iss",
-                            pdh->wcroot->wc_id,
+                            wcroot->wc_id,
                             local_relpath,
                             construct_like_arg(local_relpath,
                                                scratch_pool)));
@@ -2609,8 +2609,7 @@ catch_copy_of_absent(svn_wc__db_pdh_t *p
   if (have_row)
     return svn_error_createf(SVN_ERR_AUTHZ_UNREADABLE, NULL,
                              _("Cannot copy '%s' excluded by server"),
-                             path_for_error_message(pdh->wcroot,
-                                                    absent_relpath,
+                             path_for_error_message(wcroot, absent_relpath,
                                                     scratch_pool));
 
   return SVN_NO_ERROR;
@@ -2628,7 +2627,7 @@ op_depth_for_copy(apr_int64_t *op_depth,
                   apr_int64_t copyfrom_repos_id,
                   const char *copyfrom_relpath,
                   svn_revnum_t copyfrom_revision,
-                  svn_wc__db_pdh_t *pdh,
+                  svn_wc__db_wcroot_t *wcroot,
                   const char *local_relpath,
                   apr_pool_t *scratch_pool)
 {
@@ -2641,9 +2640,9 @@ op_depth_for_copy(apr_int64_t *op_depth,
   if (!copyfrom_relpath)
     return SVN_NO_ERROR;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
     {
@@ -2659,9 +2658,9 @@ op_depth_for_copy(apr_int64_t *op_depth,
   SVN_ERR(svn_sqlite__reset(stmt));
 
   svn_relpath_split(&parent_relpath, &name, local_relpath, scratch_pool);
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, parent_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, parent_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
     {
@@ -2752,7 +2751,7 @@ svn_wc__db_op_copy_dir(svn_wc__db_t *db,
   /* ### Should we do this inside the transaction? */
   SVN_ERR(op_depth_for_copy(&iwb.op_depth, iwb.original_repos_id,
                             original_repos_relpath, original_revision,
-                            pdh, local_relpath, scratch_pool));
+                            pdh->wcroot, local_relpath, scratch_pool));
 
   iwb.children = children;
   iwb.depth = depth;
@@ -2829,7 +2828,7 @@ svn_wc__db_op_copy_file(svn_wc__db_t *db
   /* ### Should we do this inside the transaction? */
   SVN_ERR(op_depth_for_copy(&iwb.op_depth, iwb.original_repos_id,
                             original_repos_relpath, original_revision,
-                            pdh, local_relpath, scratch_pool));
+                            pdh->wcroot, local_relpath, scratch_pool));
 
   iwb.checksum = checksum;
 
@@ -2901,7 +2900,7 @@ svn_wc__db_op_copy_symlink(svn_wc__db_t 
   /* ### Should we do this inside the transaction? */
   SVN_ERR(op_depth_for_copy(&iwb.op_depth, iwb.original_repos_id,
                             original_repos_relpath, original_revision,
-                            pdh, local_relpath, scratch_pool));
+                            pdh->wcroot, local_relpath, scratch_pool));
 
   iwb.target = target;
 
@@ -3032,7 +3031,7 @@ struct set_props_baton
 {
   apr_hash_t *props;
 
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   const svn_skel_t *conflict;
@@ -3092,7 +3091,8 @@ set_props_txn(void *baton, svn_sqlite__d
   /* Check if the props are modified. If no changes, then wipe out the
      ACTUAL props.  PRISTINE_PROPS==NULL means that any
      ACTUAL props are okay as provided, so go ahead and set them.  */
-  SVN_ERR(db_read_pristine_props(&pristine_props, spb->pdh, spb->local_relpath,
+  SVN_ERR(db_read_pristine_props(&pristine_props, spb->wcroot,
+                                 spb->local_relpath,
                                  scratch_pool, scratch_pool));
   if (spb->props && pristine_props)
     {
@@ -3104,7 +3104,7 @@ set_props_txn(void *baton, svn_sqlite__d
         spb->props = NULL;
     }
 
-  SVN_ERR(set_actual_props(spb->pdh->wcroot->wc_id, spb->local_relpath,
+  SVN_ERR(set_actual_props(spb->wcroot->wc_id, spb->local_relpath,
                            spb->props, db, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -3119,22 +3119,22 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
                         apr_pool_t *scratch_pool)
 {
   struct set_props_baton spb;
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &spb.local_relpath, db,
-                              local_abspath, svn_sqlite__mode_readwrite,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &spb.local_relpath,
+                              db, local_abspath, svn_sqlite__mode_readwrite,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
   spb.props = props;
-  spb.pdh = pdh;
+  spb.wcroot = wcroot;
   spb.conflict = conflict;
   spb.work_items = work_items;
 
   return svn_error_return(
-            svn_sqlite__with_transaction(pdh->wcroot->sdb,
+            svn_sqlite__with_transaction(wcroot->sdb,
                                          set_props_txn,
                                          &spb,
                                          scratch_pool));
@@ -3538,14 +3538,14 @@ svn_wc__db_op_revert_actual(svn_wc__db_t
 }
 
 static svn_error_t *
-remove_children(svn_wc__db_pdh_t *pdh,
+remove_children(svn_wc__db_wcroot_t *wcroot,
                 const char *local_relpath,
                 svn_wc__db_status_t status,
                 apr_int64_t op_depth,
                 apr_pool_t *scratch_pool);
 
 struct op_revert_baton {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 };
 
@@ -3558,15 +3558,15 @@ op_revert_txn(void *baton, svn_sqlite__d
   apr_int64_t op_depth;
   svn_wc__db_status_t status;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, b->pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
                                     STMT_SELECT_NODE_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", b->pdh->wcroot->wc_id,
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", b->wcroot->wc_id,
                             b->local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (!have_row)
     return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, svn_sqlite__reset(stmt),
                              _("The node '%s' was not found."),
-                             path_for_error_message(b->pdh->wcroot,
+                             path_for_error_message(b->wcroot,
                                                     b->local_relpath,
                                                     scratch_pool));
   op_depth = svn_sqlite__column_int64(stmt, 0);
@@ -3579,7 +3579,7 @@ op_revert_txn(void *baton, svn_sqlite__d
         return svn_error_createf(SVN_ERR_WC_INVALID_OPERATION_DEPTH, NULL,
                                  _("Can't revert '%s' without"
                                    " reverting parent"),
-                                 path_for_error_message(b->pdh->wcroot,
+                                 path_for_error_message(b->wcroot,
                                                         b->local_relpath,
                                                         scratch_pool));
 
@@ -3588,9 +3588,9 @@ op_revert_txn(void *baton, svn_sqlite__d
       if (status == svn_wc__db_status_added)
         {
           /* Check for children */
-          SVN_ERR(svn_sqlite__get_statement(&stmt, b->pdh->wcroot->sdb,
+          SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
                                             STMT_SELECT_GE_OP_DEPTH_CHILDREN));
-          SVN_ERR(svn_sqlite__bindf(stmt, "isi", b->pdh->wcroot->wc_id,
+          SVN_ERR(svn_sqlite__bindf(stmt, "isi", b->wcroot->wc_id,
                                     b->local_relpath, op_depth));
           SVN_ERR(svn_sqlite__step(&have_row, stmt));
           SVN_ERR(svn_sqlite__reset(stmt));
@@ -3598,7 +3598,7 @@ op_revert_txn(void *baton, svn_sqlite__d
             return svn_error_createf(SVN_ERR_WC_INVALID_OPERATION_DEPTH, NULL,
                                      _("Can't revert '%s' without"
                                        " reverting children"),
-                                     path_for_error_message(b->pdh->wcroot,
+                                     path_for_error_message(b->wcroot,
                                                             b->local_relpath,
                                                             scratch_pool));
         }
@@ -3609,23 +3609,23 @@ op_revert_txn(void *baton, svn_sqlite__d
           const char *like_arg = construct_like_arg(b->local_relpath,
                                                     scratch_pool);
           
-          SVN_ERR(svn_sqlite__get_statement(&stmt, b->pdh->wcroot->sdb,
+          SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
                                       STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE));
-          SVN_ERR(svn_sqlite__bindf(stmt, "isi", b->pdh->wcroot->wc_id,
+          SVN_ERR(svn_sqlite__bindf(stmt, "isi", b->wcroot->wc_id,
                                     like_arg, op_depth));
           SVN_ERR(svn_sqlite__step_done(stmt));
         }
 
-      SVN_ERR(svn_sqlite__get_statement(&stmt, b->pdh->wcroot->sdb,
+      SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
                                         STMT_DELETE_WORKING_NODE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", b->pdh->wcroot->wc_id,
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", b->wcroot->wc_id,
                                 b->local_relpath));
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, b->pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
                                     STMT_DELETE_ACTUAL_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", b->pdh->wcroot->wc_id,
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", b->wcroot->wc_id,
                             b->local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
@@ -3642,12 +3642,12 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&b.pdh, &b.local_relpath, db,
-                              local_abspath, svn_sqlite__mode_readwrite,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&b.wcroot, &b.local_relpath,
+                              db, local_abspath, svn_sqlite__mode_readwrite,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(b.pdh->wcroot);
+  VERIFY_USABLE_WCROOT(b.wcroot);
 
-  SVN_ERR(svn_sqlite__with_transaction(b.pdh->wcroot->sdb, op_revert_txn,
+  SVN_ERR(svn_sqlite__with_transaction(b.wcroot->sdb, op_revert_txn,
                                        &b, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -3659,7 +3659,7 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
  * produced by svn_wc__write_tree_conflicts(). */
 static svn_error_t *
 read_all_tree_conflicts(apr_hash_t **tree_conflicts,
-                        svn_wc__db_pdh_t *pdh,
+                        svn_wc__db_wcroot_t *wcroot,
                         const char *local_relpath,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
@@ -3671,9 +3671,9 @@ read_all_tree_conflicts(apr_hash_t **tre
   *tree_conflicts = apr_hash_make(result_pool);
 
   /* Get the conflict information for children of LOCAL_ABSPATH. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                STMT_SELECT_ACTUAL_CHILDREN_TREE_CONFLICT));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   while (have_row)
     {
@@ -3690,8 +3690,7 @@ read_all_tree_conflicts(apr_hash_t **tre
 
       conflict_data = svn_sqlite__column_text(stmt, 1, NULL);
       skel = svn_skel__parse(conflict_data, strlen(conflict_data), iterpool);
-      SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel,
-                                           pdh->wcroot->abspath,
+      SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, wcroot->abspath,
                                            result_pool, iterpool));
 
       apr_hash_set(*tree_conflicts, child_basename, APR_HASH_KEY_STRING,
@@ -3712,27 +3711,27 @@ svn_wc__db_op_read_all_tree_conflicts(ap
                                       apr_pool_t *result_pool,
                                       apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               local_abspath, svn_sqlite__mode_readwrite,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(read_all_tree_conflicts(tree_conflicts, pdh, local_relpath,
+  SVN_ERR(read_all_tree_conflicts(tree_conflicts, wcroot, local_relpath,
                                   result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
-/* Like svn_wc__db_op_read_tree_conflict(), but with PDH+LOCAL_RELPATH
+/* Like svn_wc__db_op_read_tree_conflict(), but with WCROOT+LOCAL_RELPATH
  * instead of DB+LOCAL_ABSPATH. */
 static svn_error_t *
 read_tree_conflict(const svn_wc_conflict_description2_t **tree_conflict,
-                   svn_wc__db_pdh_t *pdh,
+                   svn_wc__db_wcroot_t *wcroot,
                    const char *local_relpath,
                    apr_pool_t *result_pool,
                    apr_pool_t *scratch_pool)
@@ -3748,9 +3747,9 @@ read_tree_conflict(const svn_wc_conflict
   if (!local_relpath[0])
     return SVN_NO_ERROR;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_ACTUAL_TREE_CONFLICT));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
   if (!have_row)
@@ -3759,7 +3758,7 @@ read_tree_conflict(const svn_wc_conflict
   conflict_data = svn_sqlite__column_text(stmt, 0, NULL);
   skel = svn_skel__parse(conflict_data, strlen(conflict_data), scratch_pool);
   err = svn_wc__deserialize_conflict(tree_conflict, skel,
-                                     pdh->wcroot->abspath, result_pool,
+                                     wcroot->abspath, result_pool,
                                      scratch_pool);
 
   return svn_error_compose_create(err,
@@ -3774,16 +3773,16 @@ svn_wc__db_op_read_tree_conflict(
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               local_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
 
-  SVN_ERR(read_tree_conflict(tree_conflict, pdh, local_relpath,
+  SVN_ERR(read_tree_conflict(tree_conflict, wcroot, local_relpath,
                              result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -3921,7 +3920,7 @@ svn_wc__db_temp_op_set_dir_depth(svn_wc_
 
    ### Do we need to handle incomplete here? */
 static svn_error_t *
-remove_children(svn_wc__db_pdh_t *pdh,
+remove_children(svn_wc__db_wcroot_t *wcroot,
                 const char *local_relpath,
                 svn_wc__db_status_t status,
                 apr_int64_t op_depth,
@@ -3929,9 +3928,9 @@ remove_children(svn_wc__db_pdh_t *pdh,
 {
   svn_sqlite__stmt_t *stmt;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_DELETE_CHILD_NODES_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isit", pdh->wcroot->wc_id,
+  SVN_ERR(svn_sqlite__bindf(stmt, "isit", wcroot->wc_id,
                             construct_like_arg(local_relpath,
                                                scratch_pool),
                             op_depth, presence_map, status));
@@ -3941,7 +3940,7 @@ remove_children(svn_wc__db_pdh_t *pdh,
 }
 
 static svn_error_t *
-db_working_actual_remove(svn_wc__db_pdh_t *pdh,
+db_working_actual_remove(svn_wc__db_wcroot_t *wcroot,
                          const char *local_relpath,
                          apr_pool_t *scratch_pool);
 
@@ -3949,7 +3948,7 @@ static svn_error_t *
 info_below_working(svn_boolean_t *have_base,
                    svn_boolean_t *have_work,
                    svn_wc__db_status_t *status,
-                   svn_wc__db_pdh_t *pdh,
+                   svn_wc__db_wcroot_t *wcroot,
                    const char *local_relpath,
                    apr_pool_t *scratch_pool);
 
@@ -3957,15 +3956,15 @@ info_below_working(svn_boolean_t *have_b
 static svn_error_t *
 db_working_update_presence(apr_int64_t op_depth,
                            svn_wc__db_status_t status,
-                           svn_wc__db_pdh_t *pdh,
+                           svn_wc__db_wcroot_t *wcroot,
                            const char *local_relpath,
                            apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_UPDATE_NODE_WORKING_PRESENCE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "ist", pdh->wcroot->wc_id, local_relpath,
+  SVN_ERR(svn_sqlite__bindf(stmt, "ist", wcroot->wc_id, local_relpath,
                             presence_map, status));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
@@ -3979,14 +3978,14 @@ db_working_update_presence(apr_int64_t o
 
       /* Children of the copy will be marked deleted in the layer
          above. */
-      SVN_ERR(remove_children(pdh, local_relpath,
+      SVN_ERR(remove_children(wcroot, local_relpath,
                               svn_wc__db_status_base_deleted, op_depth + 1,
                               scratch_pool));
 
       /* Children of the copy that overlay a lower level become
          base_deleted, otherwise they get removed. */
-      SVN_ERR(gather_repo_children(&children, pdh, local_relpath, op_depth,
-                                   scratch_pool, scratch_pool));
+      SVN_ERR(gather_repo_children(&children, wcroot, local_relpath,
+                                   op_depth, scratch_pool, scratch_pool));
       iterpool = svn_pool_create(scratch_pool);
       for (i = 0; i < children->nelts; ++i)
         {
@@ -3999,24 +3998,25 @@ db_working_update_presence(apr_int64_t o
 
           child_relpath = svn_relpath_join(local_relpath, name, iterpool);
           SVN_ERR(info_below_working(&below_base, &below_work, &below_status,
-                                     pdh, child_relpath, iterpool));
+                                     wcroot, child_relpath, iterpool));
           if ((below_base || below_work)
               && (below_status == svn_wc__db_status_normal
                   || below_status == svn_wc__db_status_added
                   || below_status == svn_wc__db_status_incomplete))
             SVN_ERR(db_working_update_presence(op_depth,
                                                svn_wc__db_status_base_deleted,
-                                               pdh, child_relpath, iterpool));
+                                               wcroot, child_relpath,
+                                               iterpool));
           else
-            SVN_ERR(db_working_actual_remove(pdh, child_relpath, iterpool));
+            SVN_ERR(db_working_actual_remove(wcroot, child_relpath, iterpool));
         }
       svn_pool_destroy(iterpool);
 
       /* Reset the copyfrom in case this was a copy.
          ### What else should be reset? Properties? Or copy the node again? */
-      SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_UPDATE_COPYFROM_TO_INHERIT));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
@@ -4030,7 +4030,7 @@ db_working_update_presence(apr_int64_t o
    remaining working child sub-trees should be presence=not-present
    and will be deleted. */
 static svn_error_t *
-db_working_actual_remove(svn_wc__db_pdh_t *pdh,
+db_working_actual_remove(svn_wc__db_wcroot_t *wcroot,
                          const char *local_relpath,
                          apr_pool_t *scratch_pool)
 {
@@ -4042,37 +4042,38 @@ db_working_actual_remove(svn_wc__db_pdh_
   {
     svn_boolean_t have_row;
 
-    SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+    SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                       STMT_SELECT_WORKING_NODE));
-    SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+    SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
     SVN_ERR(svn_sqlite__step(&have_row, stmt));
     SVN_ERR_ASSERT(have_row);
     op_depth = svn_sqlite__column_int64(stmt, 0);
     SVN_ERR(svn_sqlite__reset(stmt));
   }
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_DELETE_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_CLEAR_ACTUAL_NODE_LEAVING_CONFLICT));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_DELETE_ACTUAL_NODE_WITHOUT_CONFLICT));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
-  SVN_ERR(remove_children(pdh, local_relpath, svn_wc__db_status_base_deleted,
+  SVN_ERR(remove_children(wcroot, local_relpath,
+                          svn_wc__db_status_base_deleted,
                           op_depth + 1, scratch_pool));
-  SVN_ERR(remove_children(pdh, local_relpath, svn_wc__db_status_normal,
+  SVN_ERR(remove_children(wcroot, local_relpath, svn_wc__db_status_normal,
                           op_depth, scratch_pool));
-  SVN_ERR(remove_children(pdh, local_relpath, svn_wc__db_status_not_present,
+  SVN_ERR(remove_children(wcroot, local_relpath, svn_wc__db_status_not_present,
                           op_depth, scratch_pool));
-  SVN_ERR(remove_children(pdh, local_relpath, svn_wc__db_status_incomplete,
+  SVN_ERR(remove_children(wcroot, local_relpath, svn_wc__db_status_incomplete,
                           op_depth, scratch_pool));
 
   /* Postcondition: There are no NODES rows in this subtree, at same or
@@ -4080,9 +4081,9 @@ db_working_actual_remove(svn_wc__db_pdh_
   {
     svn_boolean_t have_row;
 
-    SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+    SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                       STMT_SELECT_NODES_GE_OP_DEPTH_RECURSIVE));
-    SVN_ERR(svn_sqlite__bindf(stmt, "issi", pdh->wcroot->wc_id, local_relpath,
+    SVN_ERR(svn_sqlite__bindf(stmt, "issi", wcroot->wc_id, local_relpath,
                               construct_like_arg(local_relpath, scratch_pool),
                               op_depth));
     SVN_ERR(svn_sqlite__step(&have_row, stmt));
@@ -4094,9 +4095,9 @@ db_working_actual_remove(svn_wc__db_pdh_
   {
     svn_boolean_t have_row;
 
-    SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+    SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                       STMT_SELECT_ACTUAL_NODE_RECURSIVE));
-    SVN_ERR(svn_sqlite__bindf(stmt, "iss", pdh->wcroot->wc_id, local_relpath,
+    SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
                               construct_like_arg(local_relpath, scratch_pool)));
     SVN_ERR(svn_sqlite__step(&have_row, stmt));
     SVN_ERR_ASSERT(! have_row);
@@ -4112,7 +4113,7 @@ db_working_actual_remove(svn_wc__db_pdh_
 /* Insert a working node for LOCAL_ABSPATH with presence=STATUS. */
 static svn_error_t *
 db_working_insert(svn_wc__db_status_t status,
-                  svn_wc__db_pdh_t *pdh,
+                  svn_wc__db_wcroot_t *wcroot,
                   const char *local_relpath,
                   apr_pool_t *scratch_pool)
 {
@@ -4120,9 +4121,9 @@ db_working_insert(svn_wc__db_status_t st
   const char *like_arg = construct_like_arg(local_relpath, scratch_pool);
   apr_int64_t op_depth = relpath_depth(local_relpath);
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_INSERT_WORKING_NODE_FROM_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isit", pdh->wcroot->wc_id,
+  SVN_ERR(svn_sqlite__bindf(stmt, "isit", wcroot->wc_id,
                             local_relpath, op_depth, presence_map, status));
   SVN_ERR(svn_sqlite__insert(NULL, stmt));
 
@@ -4135,10 +4136,10 @@ db_working_insert(svn_wc__db_status_t st
      ### that the recursion gets moved from adm_ops.c to wc_db.c and
      ### one transaction does the whole tree and thus each op_depth
      ### only gets written once. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_UPDATE_OP_DEPTH_REDUCE_RECURSIVE));
   SVN_ERR(svn_sqlite__bindf(stmt, "isi",
-                            pdh->wcroot->wc_id, like_arg, op_depth + 1));
+                            wcroot->wc_id, like_arg, op_depth + 1));
   SVN_ERR(svn_sqlite__update(NULL, stmt));
 
   return SVN_NO_ERROR;
@@ -4149,7 +4150,7 @@ db_working_insert(svn_wc__db_status_t st
    a copy, to FALSE otherwise. */
 static svn_error_t*
 is_add_or_root_of_copy(svn_boolean_t *add_or_root_of_copy,
-                       svn_wc__db_pdh_t *pdh,
+                       svn_wc__db_wcroot_t *wcroot,
                        const char *local_relpath,
                        apr_pool_t *scratch_pool)
 {
@@ -4161,10 +4162,8 @@ is_add_or_root_of_copy(svn_boolean_t *ad
 
   SVN_ERR(scan_addition(&status, &op_root_relpath, NULL, NULL,
                         &original_repos_relpath,
-                        &original_repos_id,
-                        &original_revision,
-                        pdh, local_relpath,
-                        scratch_pool, scratch_pool));
+                        &original_repos_id, &original_revision,
+                        wcroot, local_relpath, scratch_pool, scratch_pool));
 
   SVN_ERR_ASSERT(status == svn_wc__db_status_added
                  || status == svn_wc__db_status_copied);
@@ -4192,10 +4191,8 @@ is_add_or_root_of_copy(svn_boolean_t *ad
 
       err = scan_addition(&parent_status, NULL, NULL, NULL,
                           &parent_original_repos_relpath,
-                          &parent_original_repos_id,
-                          &parent_original_revision,
-                          pdh, parent_relpath,
-                          scratch_pool, scratch_pool);
+                          &parent_original_repos_id, &parent_original_revision,
+                          wcroot, parent_relpath, scratch_pool, scratch_pool);
       if (err)
         {
           if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
@@ -4276,7 +4273,7 @@ static svn_error_t *
 info_below_working(svn_boolean_t *have_base,
                    svn_boolean_t *have_work,
                    svn_wc__db_status_t *status,
-                   svn_wc__db_pdh_t *pdh,
+                   svn_wc__db_wcroot_t *wcroot,
                    const char *local_relpath,
                    apr_pool_t *scratch_pool)
 {
@@ -4285,10 +4282,9 @@ info_below_working(svn_boolean_t *have_b
 
   *have_base = *have_work =  FALSE;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_NODE_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is",
-                            pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
     {
@@ -4314,7 +4310,7 @@ info_below_working(svn_boolean_t *have_b
 }
 
 struct temp_op_delete_baton {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   /* The following two are only needed for svn_wc__db_temp_forget_directory */
@@ -4335,7 +4331,7 @@ temp_op_delete_txn(void *baton, svn_sqli
                     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                     &have_work,
                     NULL, NULL,
-                    b->pdh, b->local_relpath,
+                    b->wcroot, b->local_relpath,
                     scratch_pool, scratch_pool));
 
   if (!have_work)
@@ -4352,15 +4348,16 @@ temp_op_delete_txn(void *baton, svn_sqli
       /* ADD/COPY-HERE/MOVE-HERE that could be a replace */
       svn_boolean_t add_or_root_of_copy;
 
-      SVN_ERR(is_add_or_root_of_copy(&add_or_root_of_copy,
-                                     b->pdh, b->local_relpath, scratch_pool));
+      SVN_ERR(is_add_or_root_of_copy(&add_or_root_of_copy, b->wcroot,
+                                     b->local_relpath, scratch_pool));
       if (add_or_root_of_copy)
         {
           svn_boolean_t below_base, below_work;
           svn_wc__db_status_t below_status;
 
           SVN_ERR(info_below_working(&below_base, &below_work, &below_status,
-                                     b->pdh, b->local_relpath, scratch_pool));
+                                     b->wcroot, b->local_relpath,
+                                     scratch_pool));
 
           if ((below_base || below_work)
               && below_status != svn_wc__db_status_not_present)
@@ -4376,8 +4373,8 @@ temp_op_delete_txn(void *baton, svn_sqli
   else if (status == svn_wc__db_status_incomplete)
     {
       svn_boolean_t add_or_root_of_copy;
-      SVN_ERR(is_add_or_root_of_copy(&add_or_root_of_copy,
-                                     b->pdh, b->local_relpath, scratch_pool));
+      SVN_ERR(is_add_or_root_of_copy(&add_or_root_of_copy, b->wcroot,
+                                     b->local_relpath, scratch_pool));
       if (add_or_root_of_copy)
         del_work = TRUE;
       else
@@ -4386,7 +4383,8 @@ temp_op_delete_txn(void *baton, svn_sqli
 
   if (del_work)
     {
-      SVN_ERR(db_working_actual_remove(b->pdh, b->local_relpath, scratch_pool));
+      SVN_ERR(db_working_actual_remove(b->wcroot, b->local_relpath,
+                                       scratch_pool));
 
       /* This is needed for access batons? */
       SVN_ERR(svn_wc__db_temp_forget_directory(b->db, b->local_abspath,
@@ -4395,14 +4393,14 @@ temp_op_delete_txn(void *baton, svn_sqli
   else if (add_work)
     {
       new_working_status = svn_wc__db_status_base_deleted;
-      SVN_ERR(db_working_insert(new_working_status, b->pdh, b->local_relpath,
-                                scratch_pool));
+      SVN_ERR(db_working_insert(new_working_status, b->wcroot,
+                                b->local_relpath, scratch_pool));
     }
   else if (mod_work)
     {
       new_working_status = svn_wc__db_status_base_deleted;
       SVN_ERR(db_working_update_presence(relpath_depth(b->local_relpath),
-                                         new_working_status, b->pdh,
+                                         new_working_status, b->wcroot,
                                          b->local_relpath, scratch_pool));
     }
   else
@@ -4420,22 +4418,24 @@ svn_wc__db_temp_op_delete(svn_wc__db_t *
                           apr_pool_t *scratch_pool)
 {
   struct temp_op_delete_baton b;
+  svn_wc__db_pdh_t *pdh;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&b.pdh, &b.local_relpath, db,
+  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &b.local_relpath, db,
                               local_abspath, svn_sqlite__mode_readwrite,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(b.pdh->wcroot);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   /* These two for svn_wc__db_temp_forget_directory */
   b.db = db;
+  b.wcroot = pdh->wcroot;
   b.local_abspath = local_abspath;
 
-  SVN_ERR(svn_sqlite__with_transaction(b.pdh->wcroot->sdb, temp_op_delete_txn,
+  SVN_ERR(svn_sqlite__with_transaction(b.wcroot->sdb, temp_op_delete_txn,
                                        &b, scratch_pool));
 
-  SVN_ERR(flush_entries(db, b.pdh, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(db, pdh, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -4465,7 +4465,7 @@ read_info(svn_wc__db_status_t *status,
           svn_boolean_t *have_work,
           svn_boolean_t *conflicted,
           svn_wc__db_lock_t **lock,
-          svn_wc__db_pdh_t *pdh,
+          svn_wc__db_wcroot_t *wcroot,
           const char *local_relpath,
           apr_pool_t *result_pool,
           apr_pool_t *scratch_pool)
@@ -4478,19 +4478,17 @@ read_info(svn_wc__db_status_t *status,
 
   /* Obtain the most likely to exist record first, to make sure we don't
      have to obtain the SQLite read-lock multiple times */
-  SVN_ERR(svn_sqlite__get_statement(&stmt_info, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt_info, wcroot->sdb,
                                     lock ? STMT_SELECT_NODE_INFO_WITH_LOCK
                                          : STMT_SELECT_NODE_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt_info, "is",
-                            pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt_info, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_info, stmt_info));
 
   if (changelist || conflicted || props_mod)
     {
-      SVN_ERR(svn_sqlite__get_statement(&stmt_act, pdh->wcroot->sdb,
+      SVN_ERR(svn_sqlite__get_statement(&stmt_act, wcroot->sdb,
                                         STMT_SELECT_ACTUAL_NODE));
-      SVN_ERR(svn_sqlite__bindf(stmt_act, "is",
-                                pdh->wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__bindf(stmt_act, "is", wcroot->wc_id, local_relpath));
       SVN_ERR(svn_sqlite__step(&have_act, stmt_act));
     }
   else
@@ -4595,8 +4593,7 @@ read_info(svn_wc__db_status_t *status,
                          svn_error_createf(
                                err->apr_err, err2,
                               _("The node '%s' has a corrupt checksum value."),
-                              path_for_error_message(pdh->wcroot,
-                                                     local_relpath,
+                              path_for_error_message(wcroot, local_relpath,
                                                      scratch_pool)));
             }
         }
@@ -4686,8 +4683,7 @@ read_info(svn_wc__db_status_t *status,
       if (svn_sqlite__column_is_null(stmt_act, 5)) /* conflict_data */
           err = svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
                                   _("Corrupt data for '%s'"),
-                                  path_for_error_message(pdh->wcroot,
-                                                         local_relpath,
+                                  path_for_error_message(wcroot, local_relpath,
                                                          scratch_pool));
       /* ### What should we return?  Should we have a separate
              function for reading actual-only nodes? */
@@ -4744,8 +4740,7 @@ read_info(svn_wc__db_status_t *status,
     {
       err = svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                               _("The node '%s' was not found."),
-                              path_for_error_message(pdh->wcroot,
-                                                     local_relpath,
+                              path_for_error_message(wcroot, local_relpath,
                                                      scratch_pool));
     }
 
@@ -4787,16 +4782,16 @@ svn_wc__db_read_info(svn_wc__db_status_t
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
   apr_int64_t repos_id, original_repos_id;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               local_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(read_info(status, kind, revision, repos_relpath, &repos_id,
                     changed_rev, changed_date, changed_author,
@@ -4804,11 +4799,11 @@ svn_wc__db_read_info(svn_wc__db_status_t
                     changelist, original_repos_relpath, &original_repos_id,
                     original_revision, props_mod, have_base,
                     have_work, conflicted, lock,
-                    pdh, local_relpath, result_pool, scratch_pool));
+                    wcroot, local_relpath, result_pool, scratch_pool));
   SVN_ERR(fetch_repos_info(repos_root_url, repos_uuid,
-                           pdh->wcroot->sdb, repos_id, result_pool));
+                           wcroot->sdb, repos_id, result_pool));
   SVN_ERR(fetch_repos_info(original_root_url, original_uuid,
-                           pdh->wcroot->sdb, original_repos_id, result_pool));
+                           wcroot->sdb, original_repos_id, result_pool));
 
   return SVN_NO_ERROR;
 }
@@ -4821,7 +4816,7 @@ svn_wc__db_read_children_info(apr_hash_t
                               apr_pool_t *result_pool,
                               apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *dir_relpath;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
@@ -4831,15 +4826,15 @@ svn_wc__db_read_children_info(apr_hash_t
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dir_abspath));
   *conflicts = apr_hash_make(result_pool);
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &dir_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &dir_relpath, db,
                                              dir_abspath,
                                              svn_sqlite__mode_readonly,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_NODE_CHILDREN_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, dir_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, dir_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
   *nodes = apr_hash_make(result_pool);
@@ -4902,8 +4897,7 @@ svn_wc__db_read_children_info(apr_hash_t
               if (!repos_root_url)
                 {
                   err = fetch_repos_info(&repos_root_url, NULL,
-                                         pdh->wcroot->sdb, repos_id,
-                                         result_pool);
+                                         wcroot->sdb, repos_id, result_pool);
                   if (err)
                     SVN_ERR(svn_error_compose_create(err,
                                                      svn_sqlite__reset(stmt)));
@@ -4972,9 +4966,9 @@ svn_wc__db_read_children_info(apr_hash_t
 
   SVN_ERR(svn_sqlite__reset(stmt));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_ACTUAL_CHILDREN_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, dir_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, dir_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
   while (have_row)
@@ -5038,7 +5032,7 @@ svn_wc__db_read_children_walker_info(apr
                                      apr_pool_t *result_pool,
                                      apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *dir_relpath;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
@@ -5046,15 +5040,15 @@ svn_wc__db_read_children_walker_info(apr
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dir_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &dir_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &dir_relpath, db,
                                              dir_abspath,
                                              svn_sqlite__mode_readonly,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_NODE_CHILDREN_WALKER_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, dir_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, dir_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
   *nodes = apr_hash_make(result_pool);
@@ -5124,7 +5118,7 @@ svn_wc__db_read_props(apr_hash_t **props
                       apr_pool_t *result_pool,
                       apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
@@ -5132,14 +5126,14 @@ svn_wc__db_read_props(apr_hash_t **props
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               local_abspath, svn_sqlite__mode_readwrite,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_ACTUAL_PROPS));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
   if (have_row && !svn_sqlite__column_is_null(stmt, 0))
@@ -5156,7 +5150,7 @@ svn_wc__db_read_props(apr_hash_t **props
     return SVN_NO_ERROR;
 
   /* No local changes. Return the pristine props for this node.  */
-  SVN_ERR(db_read_pristine_props(props, pdh, local_relpath,
+  SVN_ERR(db_read_pristine_props(props, wcroot, local_relpath,
                                  result_pool, scratch_pool));
   if (*props == NULL)
     {
@@ -5222,7 +5216,7 @@ read_props_of_children(svn_wc__db_t *db,
                        void *receiver_baton,
                        apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
   const char *prev_child_relpath;
   svn_sqlite__stmt_t *stmt;
@@ -5236,11 +5230,11 @@ read_props_of_children(svn_wc__db_t *db,
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR_ASSERT(receiver_func);
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                                              local_abspath,
                                              svn_sqlite__mode_readwrite,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
   props_per_child = apr_hash_make(scratch_pool);
   not_present = apr_hash_make(scratch_pool);
@@ -5249,9 +5243,9 @@ read_props_of_children(svn_wc__db_t *db,
   else
     files = NULL;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_NODE_PROPS_OF_CHILDREN));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   prev_child_relpath = NULL;
   while (have_row)
@@ -5297,7 +5291,7 @@ read_props_of_children(svn_wc__db_t *db,
             }
 
           SVN_ERR(maybe_add_child_props(props_per_child, prop_data, len,
-                                        child_relpath, pdh->wcroot->abspath,
+                                        child_relpath, wcroot->abspath,
                                         scratch_pool, scratch_pool));
         }
 
@@ -5306,9 +5300,9 @@ read_props_of_children(svn_wc__db_t *db,
 
   SVN_ERR(svn_sqlite__reset(stmt));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_ACTUAL_PROPS_OF_CHILDREN));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   while (have_row)
     {
@@ -5329,7 +5323,7 @@ read_props_of_children(svn_wc__db_t *db,
                 continue;
             }
           SVN_ERR(maybe_add_child_props(props_per_child, prop_data, len,
-                                        child_relpath, pdh->wcroot->abspath,
+                                        child_relpath, wcroot->abspath,
                                         scratch_pool, scratch_pool));
         }
 
@@ -5384,7 +5378,7 @@ svn_wc__db_read_props_of_immediates(svn_
 
 static svn_error_t *
 db_read_pristine_props(apr_hash_t **props,
-                       svn_wc__db_pdh_t *pdh,
+                       svn_wc__db_wcroot_t *wcroot,
                        const char *local_relpath,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
@@ -5393,8 +5387,8 @@ db_read_pristine_props(apr_hash_t **prop
   svn_boolean_t have_row;
   svn_wc__db_status_t presence;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb, STMT_SELECT_NODE_PROPS));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_SELECT_NODE_PROPS));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
 
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
@@ -5403,7 +5397,7 @@ db_read_pristine_props(apr_hash_t **prop
       return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND,
                                svn_sqlite__reset(stmt),
                                _("The node '%s' was not found."),
-                               path_for_error_message(pdh->wcroot,
+                               path_for_error_message(wcroot,
                                                       local_relpath,
                                                       scratch_pool));
     }
@@ -5453,17 +5447,17 @@ svn_wc__db_read_pristine_props(apr_hash_
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               local_abspath, svn_sqlite__mode_readwrite,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(db_read_pristine_props(props, pdh, local_relpath,
+  SVN_ERR(db_read_pristine_props(props, wcroot, local_relpath,
                                  result_pool, scratch_pool));
   return SVN_NO_ERROR;
 }
@@ -5476,19 +5470,19 @@ svn_wc__db_read_children(const apr_array
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                                              local_abspath,
                                              svn_sqlite__mode_readonly,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
 
-  return gather_children(children,
-                         pdh, local_relpath, result_pool, scratch_pool);
+  return gather_children(children, wcroot, local_relpath,
+                         result_pool, scratch_pool);
 }
 
 struct relocate_baton
@@ -5556,7 +5550,7 @@ svn_wc__db_global_relocate(svn_wc__db_t 
                            const char *repos_root_url,
                            apr_pool_t *scratch_pool)
 {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_dir_relpath;
   svn_wc__db_status_t status;
   struct relocate_baton rb;
@@ -5565,10 +5559,10 @@ svn_wc__db_global_relocate(svn_wc__db_t 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_dir_abspath));
   /* ### assert that we were passed a directory?  */
 
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_dir_relpath, db,
-                              local_dir_abspath, svn_sqlite__mode_readonly,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_dir_relpath,
+                              db, local_dir_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(pdh->wcroot);
+  VERIFY_USABLE_WCROOT(wcroot);
   rb.local_relpath = local_dir_relpath;
 
   SVN_ERR(read_info(&status,
@@ -5578,7 +5572,7 @@ svn_wc__db_global_relocate(svn_wc__db_t 
                     NULL, NULL, NULL, NULL, NULL,
                     &rb.have_base_node,
                     NULL, NULL, NULL,
-                    pdh, rb.local_relpath,
+                    wcroot, rb.local_relpath,
                     scratch_pool, scratch_pool));
 
   if (status == svn_wc__db_status_excluded)
@@ -5593,7 +5587,7 @@ svn_wc__db_global_relocate(svn_wc__db_t 
                         NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                         NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                         NULL, NULL, NULL,
-                        pdh, parent_relpath,
+                        wcroot, parent_relpath,
                         scratch_pool, scratch_pool));
       stored_local_dir_relpath = rb.local_relpath;
       local_dir_relpath = parent_relpath;
@@ -5612,7 +5606,7 @@ svn_wc__db_global_relocate(svn_wc__db_t 
         {
           const char *work_del_relpath;
           SVN_ERR(scan_deletion(NULL, NULL, &work_del_relpath,
-                                pdh, local_dir_relpath,
+                                wcroot, local_dir_relpath,
                                 scratch_pool, scratch_pool));
           if (work_del_relpath)
             {
@@ -5632,17 +5626,17 @@ svn_wc__db_global_relocate(svn_wc__db_t 
           SVN_ERR(scan_addition(NULL, NULL,
                                 &rb.repos_relpath, &rb.old_repos_id,
                                 NULL, NULL, NULL,
-                                pdh, local_dir_relpath,
+                                wcroot, local_dir_relpath,
                                 scratch_pool, scratch_pool));
         }
       else
         SVN_ERR(scan_upwards_for_repos(&rb.old_repos_id, &rb.repos_relpath,
-                                       pdh->wcroot, local_dir_relpath,
+                                       wcroot, local_dir_relpath,
                                        scratch_pool, scratch_pool));
     }
 
   SVN_ERR(fetch_repos_info(NULL, &rb.repos_uuid,
-                           pdh->wcroot->sdb, rb.old_repos_id, scratch_pool));
+                           wcroot->sdb, rb.old_repos_id, scratch_pool));
   SVN_ERR_ASSERT(rb.repos_relpath && rb.repos_uuid);
 
   if (stored_local_dir_relpath)
@@ -5654,10 +5648,10 @@ svn_wc__db_global_relocate(svn_wc__db_t 
                                           scratch_pool);
     }
 
-  rb.wc_id = pdh->wcroot->wc_id;
+  rb.wc_id = wcroot->wc_id;
   rb.repos_root_url = repos_root_url;
 
-  SVN_ERR(svn_sqlite__with_transaction(pdh->wcroot->sdb, relocate_txn, &rb,
+  SVN_ERR(svn_sqlite__with_transaction(wcroot->sdb, relocate_txn, &rb,
                                        scratch_pool));
 
   return SVN_NO_ERROR;
@@ -5665,7 +5659,7 @@ svn_wc__db_global_relocate(svn_wc__db_t 
 
 
 struct commit_baton {
-  svn_wc__db_pdh_t *pdh;
+  svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   svn_revnum_t new_revision;
@@ -5705,21 +5699,21 @@ commit_node(void *baton, svn_sqlite__db_
   svn_sqlite__stmt_t *stmt;
 
   /* ### is it better to select only the data needed?  */
-  SVN_ERR(svn_sqlite__get_statement(&stmt_base, cb->pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt_base, cb->wcroot->sdb,
                                     STMT_SELECT_BASE_NODE));
-  SVN_ERR(svn_sqlite__get_statement(&stmt_work, cb->pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt_work, cb->wcroot->sdb,
                                     STMT_SELECT_WORKING_NODE));
   SVN_ERR(svn_sqlite__bindf(stmt_base, "is",
-                            cb->pdh->wcroot->wc_id, cb->local_relpath));
+                            cb->wcroot->wc_id, cb->local_relpath));
   SVN_ERR(svn_sqlite__bindf(stmt_work, "is",
-                            cb->pdh->wcroot->wc_id, cb->local_relpath));
+                            cb->wcroot->wc_id, cb->local_relpath));
   SVN_ERR(svn_sqlite__step(&have_base, stmt_base));
   SVN_ERR(svn_sqlite__step(&have_work, stmt_work));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt_act, cb->pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt_act, cb->wcroot->sdb,
                                     STMT_SELECT_ACTUAL_NODE));
   SVN_ERR(svn_sqlite__bindf(stmt_act, "is",
-                            cb->pdh->wcroot->wc_id, cb->local_relpath));
+                            cb->wcroot->wc_id, cb->local_relpath));
   SVN_ERR(svn_sqlite__step(&have_act, stmt_act));
 
   /* There should be something to commit!  */
@@ -5788,11 +5782,11 @@ commit_node(void *baton, svn_sqlite__db_
   /* ### other presences? or reserve that for separate functions?  */
   new_presence = svn_wc__db_status_normal;
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, cb->pdh->wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, cb->wcroot->sdb,
                                     STMT_APPLY_CHANGES_TO_BASE_NODE));
   /* symlink_target not yet used */
   SVN_ERR(svn_sqlite__bindf(stmt, "issisrtstrisnbn",
-                            cb->pdh->wcroot->wc_id, cb->local_relpath,
+                            cb->wcroot->wc_id, cb->local_relpath,
                             parent_relpath,
                             cb->repos_id,
                             cb->repos_relpath,
@@ -5816,10 +5810,10 @@ commit_node(void *baton, svn_sqlite__db_
     {
       /* This removes all op_depth > 0 and so does both layers of a
          two-layer replace. */
-      SVN_ERR(svn_sqlite__get_statement(&stmt, cb->pdh->wcroot->sdb,
+      SVN_ERR(svn_sqlite__get_statement(&stmt, cb->wcroot->sdb,
                                         STMT_DELETE_ALL_WORKING_NODES));
       SVN_ERR(svn_sqlite__bindf(stmt, "is",
-                                cb->pdh->wcroot->wc_id, cb->local_relpath));
+                                cb->wcroot->wc_id, cb->local_relpath));
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
@@ -5832,11 +5826,10 @@ commit_node(void *baton, svn_sqlite__db_
           /* The user told us to keep the changelist. Replace the row in
              ACTUAL_NODE with the basic keys and the changelist.  */
           SVN_ERR(svn_sqlite__get_statement(
-                    &stmt, cb->pdh->wcroot->sdb,
+                    &stmt, cb->wcroot->sdb,
                     STMT_RESET_ACTUAL_WITH_CHANGELIST));
           SVN_ERR(svn_sqlite__bindf(stmt, "isss",
-                                    cb->pdh->wcroot->wc_id,
-                                    cb->local_relpath,
+                                    cb->wcroot->wc_id, cb->local_relpath,
                                     svn_relpath_dirname(cb->local_relpath,
                                                         scratch_pool),
                                     changelist));
@@ -5845,11 +5838,10 @@ commit_node(void *baton, svn_sqlite__db_
       else
         {
           /* Toss the ACTUAL_NODE row.  */
-          SVN_ERR(svn_sqlite__get_statement(&stmt, cb->pdh->wcroot->sdb,
+          SVN_ERR(svn_sqlite__get_statement(&stmt, cb->wcroot->sdb,
                                             STMT_DELETE_ACTUAL_NODE));
           SVN_ERR(svn_sqlite__bindf(stmt, "is",
-                                    cb->pdh->wcroot->wc_id,
-                                    cb->local_relpath));
+                                    cb->wcroot->wc_id, cb->local_relpath));
           SVN_ERR(svn_sqlite__step_done(stmt));
         }
     }
@@ -5889,7 +5881,7 @@ commit_node(void *baton, svn_sqlite__db_
 static svn_error_t *
 determine_repos_info(apr_int64_t *repos_id,
                      const char **repos_relpath,

[... 1098 lines stripped ...]