You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/07/20 01:06:07 UTC

svn commit: r1148581 [9/12] - in /subversion/branches/gpg-agent-password-store: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/hook-scripts/ contrib/hook-scripts/enforcer/ contrib/server-side/ contrib/server-side/fsfsfix...

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-queries.sql?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-queries.sql Tue Jul 19 23:05:44 2011
@@ -473,7 +473,10 @@ WHERE wc_id = ?1 AND (parent_relpath = ?
 INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind)
 SELECT wc_id, local_relpath, parent_relpath, kind
 FROM nodes_current
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+WHERE wc_id = ?1
+       AND (?2 = ''
+            OR local_relpath = ?2 
+            OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
 
 -- STMT_INSERT_TARGET_WITH_CHANGELIST
 INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind)
@@ -503,8 +506,11 @@ INSERT INTO targets_list(wc_id, local_re
 SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind
   FROM actual_node AS A JOIN nodes_current AS N
     ON A.wc_id = N.wc_id AND A.local_relpath = N.local_relpath
- WHERE N.wc_id = ?1 AND A.changelist = ?3
-       AND (N.local_relpath = ?2 OR N.local_relpath LIKE ?4 ESCAPE '#')
+ WHERE N.wc_id = ?1
+       AND (?2 = ''
+            OR N.local_relpath = ?2 
+            OR (N.local_relpath > ?2 || '/' AND N.local_relpath < ?2 || '0'))
+       AND A.changelist = ?3
 
 -- STMT_SELECT_TARGETS
 SELECT local_relpath, parent_relpath from targets_list
@@ -581,7 +587,10 @@ WHERE wc_id = ?1 AND local_relpath = ?2
 
 -- STMT_DELETE_ACTUAL_NODE_RECURSIVE
 DELETE FROM actual_node
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
 
 -- STMT_DELETE_ACTUAL_NODE_WITHOUT_CONFLICT
 DELETE FROM actual_node
@@ -590,21 +599,23 @@ WHERE wc_id = ?1 AND local_relpath = ?2
 
 -- STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST
 DELETE FROM actual_node
-WHERE wc_id = ?1 AND local_relpath = ?2
-      AND (changelist IS NULL
-           OR local_relpath NOT IN (SELECT local_relpath FROM nodes_current
-                                     WHERE wc_id  = ?1 AND local_relpath = ?2
-                                       AND kind = 'file'))
+WHERE wc_id = ?1
+  AND local_relpath = ?2
+  AND (changelist IS NULL
+       OR NOT EXISTS (SELECT 1 FROM nodes_current c
+                      WHERE c.wc_id = ?1 AND c.local_relpath = local_relpath
+                        AND kind = 'file'))
 
 -- STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE
 DELETE FROM actual_node
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
-      AND (changelist IS NULL
-           OR local_relpath NOT IN (SELECT local_relpath FROM nodes_current
-                                    WHERE wc_id = ?1
-                                      AND (local_relpath = ?2
-                                           OR local_relpath LIKE ?3 ESCAPE '#')
-                                      AND kind = 'file'))
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
+  AND (changelist IS NULL
+       OR NOT EXISTS (SELECT 1 FROM nodes_current c
+                      WHERE c.wc_id = ?1 AND c.local_relpath = local_relpath
+                        AND kind = 'file'))
 
 -- STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST
 UPDATE actual_node
@@ -632,7 +643,10 @@ SET properties = NULL,
     older_checksum = NULL,
     left_checksum = NULL,
     right_checksum = NULL
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
 
 -- STMT_UPDATE_NODE_BASE_DEPTH
 UPDATE nodes SET depth = ?3
@@ -762,10 +776,12 @@ AND NOT EXISTS (SELECT 1 FROM nodes
 -- STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE
 DELETE FROM wc_lock
 WHERE wc_id = ?1
-AND (local_dir_relpath = ?2 OR local_dir_relpath LIKE ?3 ESCAPE '#')
-AND NOT EXISTS (SELECT 1 FROM nodes
-                 WHERE nodes.wc_id = ?1
-                   AND nodes.local_relpath = wc_lock.local_dir_relpath)
+  AND (?2 = ''
+       OR local_dir_relpath = ?2
+       OR (local_dir_relpath > ?2 || '/' AND local_dir_relpath < ?2 || '0'))
+  AND NOT EXISTS (SELECT 1 FROM nodes
+                   WHERE nodes.wc_id = ?1
+                     AND nodes.local_relpath = wc_lock.local_dir_relpath)
 
 -- STMT_APPLY_CHANGES_TO_BASE_NODE
 /* translated_size and last_mod_time are not mentioned here because they will
@@ -823,31 +839,42 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 
 -- STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE
 UPDATE nodes SET op_depth = ?3 + 1
-WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth = ?3
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
+ AND op_depth = ?3
 
 -- STMT_DOES_NODE_EXIST
 SELECT 1 FROM nodes WHERE wc_id = ?1 AND local_relpath = ?2
 LIMIT 1
 
--- STMT_HAS_ABSENT_NODES
+-- STMT_HAS_SERVER_EXCLUDED_NODES
 SELECT local_relpath FROM nodes
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
-  AND op_depth = 0 AND presence = 'absent' LIMIT 1
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
+  AND op_depth = 0 AND presence = 'absent'
+LIMIT 1
 
-/* ### Select all absent nodes. */
--- STMT_SELECT_ALL_ABSENT_NODES
+/* ### Select all server-excluded nodes. */
+-- STMT_SELECT_ALL_SERVER_EXCLUDED_NODES
 SELECT local_relpath FROM nodes
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
-  AND op_depth = 0 AND presence = 'absent'
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
+  AND op_depth = 0
+  AND presence = 'absent'
 
 -- STMT_INSERT_WORKING_NODE_COPY_FROM_BASE
 INSERT OR REPLACE INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, repos_id,
-    repos_path, revision, presence, depth, kind, changed_revision,
+    repos_path, revision, presence, depth, moved_here, kind, changed_revision,
     changed_date, changed_author, checksum, properties, translated_size,
     last_mod_time, symlink_target )
 SELECT wc_id, ?3 /*local_relpath*/, ?4 /*op_depth*/, ?5 /*parent_relpath*/,
-    repos_id, repos_path, revision, ?6 /*presence*/, depth,
+    repos_id, repos_path, revision, ?6 /*presence*/, depth, ?7/*moved_here*/,
     kind, changed_revision, changed_date, changed_author, checksum, properties,
     translated_size, last_mod_time, symlink_target
 FROM nodes
@@ -856,11 +883,11 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 -- STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING
 INSERT OR REPLACE INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
-    revision, presence, depth, kind, changed_revision, changed_date,
+    revision, presence, depth, moved_here, kind, changed_revision, changed_date,
     changed_author, checksum, properties, translated_size, last_mod_time,
     symlink_target )
 SELECT wc_id, ?3 /*local_relpath*/, ?4 /*op_depth*/, ?5 /*parent_relpath*/,
-    repos_id, repos_path, revision, ?6 /*presence*/, depth,
+    repos_id, repos_path, revision, ?6 /*presence*/, depth, ?7 /*moved_here*/,
     kind, changed_revision, changed_date, changed_author, checksum, properties,
     translated_size, last_mod_time, symlink_target
 FROM nodes
@@ -871,15 +898,15 @@ LIMIT 1
 -- STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH
 INSERT OR REPLACE INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
-    revision, presence, depth, kind, changed_revision, changed_date,
+    revision, presence, depth, moved_here, kind, changed_revision, changed_date,
     changed_author, checksum, properties, translated_size, last_mod_time,
     symlink_target )
 SELECT wc_id, ?3 /*local_relpath*/, ?4 /*op_depth*/, ?5 /*parent_relpath*/,
-    repos_id, repos_path, revision, ?6 /*presence*/,
-    depth, kind, changed_revision, changed_date, changed_author, checksum,
+    repos_id, repos_path, revision, ?6 /*presence*/, depth, ?7 /*moved_here*/,
+    kind, changed_revision, changed_date, changed_author, checksum,
     properties, translated_size, last_mod_time, symlink_target
 FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?7
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?8
 
 -- STMT_INSERT_ACTUAL_NODE_FROM_ACTUAL_NODE
 INSERT OR REPLACE INTO actual_node (
@@ -985,15 +1012,8 @@ WHERE tree_conflict_data IS NOT NULL
 UPDATE actual_node SET tree_conflict_data = NULL
 
 -- STMT_SELECT_ALL_FILES
-/* Should this select on wc_id as well? */
 SELECT DISTINCT local_relpath FROM nodes
-WHERE kind = 'file' AND parent_relpath = ?1
-
--- STMT_SELECT_NODE_UPGRADE
-SELECT op_depth, presence, wc_id, kind
-FROM nodes
-WHERE local_relpath = ?1
-ORDER BY op_depth DESC
+WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = 'file'
 
 -- STMT_UPDATE_NODE_PROPS
 UPDATE nodes SET properties = ?4
@@ -1001,12 +1021,14 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 
 -- STMT_HAS_WORKING_NODES
 SELECT 1 FROM nodes WHERE op_depth > 0
+LIMIT 1
 
 -- STMT_HAS_ACTUAL_NODES_CONFLICTS
 SELECT 1 FROM actual_node
 WHERE NOT ((prop_reject IS NULL) AND (conflict_old IS NULL)
            AND (conflict_new IS NULL) AND (conflict_working IS NULL)
            AND (tree_conflict_data IS NULL))
+LIMIT 1
 
 /* ------------------------------------------------------------------------- */
 /* PROOF OF CONCEPT: Complex queries for callback walks, caching results
@@ -1182,14 +1204,19 @@ DROP TABLE IF EXISTS delete_list
 SELECT MIN(revision), MAX(revision),
        MIN(changed_revision), MAX(changed_revision) FROM nodes
   WHERE wc_id = ?1
-  AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
-  AND presence IN ('normal', 'incomplete')
-  AND file_external IS NULL
-  AND op_depth = 0
+    AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
+    AND presence IN ('normal', 'incomplete')
+    AND file_external IS NULL
+    AND op_depth = 0
 
 -- STMT_HAS_SPARSE_NODES
 SELECT 1 FROM nodes
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
   AND op_depth = 0
   AND (presence IN ('absent', 'excluded')
         OR depth NOT IN ('infinity', 'unknown'))
@@ -1198,13 +1225,19 @@ LIMIT 1
 
 -- STMT_SUBTREE_HAS_TREE_MODIFICATIONS
 SELECT 1 FROM nodes
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
   AND op_depth > 0
 LIMIT 1
 
 -- STMT_SUBTREE_HAS_PROP_MODIFICATIONS
 SELECT 1 FROM actual_node
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+WHERE wc_id = ?1
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
   AND properties IS NOT NULL
 LIMIT 1
 
@@ -1280,7 +1313,9 @@ LIMIT 1
 -- STMT_SELECT_BASE_FILES_RECURSIVE
 SELECT local_relpath, translated_size, last_mod_time FROM nodes AS n
 WHERE wc_id = ?1
-  AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+  AND (?2 = ''
+       OR local_relpath = ?2
+       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
   AND op_depth = 0
   AND kind='file'
   AND presence='normal'

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.c Tue Jul 19 23:05:44 2011
@@ -1212,17 +1212,17 @@ gather_repo_children(const apr_array_hea
 }
 
 
-/* Return TRUE if CHILD_ABSPATH is an immediate child of PARENT_ABSPATH
- * which has PARENT_COMPONENT_COUNT path components.
+/* Return TRUE if CHILD_ABSPATH is an immediate child of PARENT_ABSPATH.
  * Else, return FALSE. */
 static svn_boolean_t
-is_immediate_child_path(const char *parent_abspath,
-                        apr_size_t parent_component_count,
-                        const char *child_abspath)
-{
-  return (svn_dirent_is_ancestor(parent_abspath, child_abspath) &&
-            parent_component_count ==
-            svn_path_component_count(child_abspath) - 1);
+is_immediate_child_path(const char *parent_abspath, const char *child_abspath)
+{
+  const char *local_relpath = svn_dirent_skip_ancestor(parent_abspath,
+                                                       child_abspath);
+
+  /* To be an immediate child local_relpath should have one (not empty)
+     component */
+  return local_relpath && *local_relpath && !strchr(local_relpath, '/');
 }
 
 
@@ -1263,7 +1263,6 @@ flush_entries(svn_wc__db_wcroot_t *wcroo
   if (depth > svn_depth_empty)
     {
       apr_hash_index_t *hi;
-      apr_size_t component_count = svn_path_component_count(local_abspath);
 
       /* Flush access batons of children within the specified depth. */
       for (hi = apr_hash_first(scratch_pool, wcroot->access_cache);
@@ -1273,8 +1272,7 @@ flush_entries(svn_wc__db_wcroot_t *wcroo
           const char *item_abspath = svn__apr_hash_index_key(hi);
 
           if ((depth == svn_depth_files || depth == svn_depth_immediates) &&
-              is_immediate_child_path(local_abspath, component_count,
-                                      item_abspath))
+              is_immediate_child_path(local_abspath, item_abspath))
             {
               remove_from_access_cache(wcroot->access_cache, item_abspath);
             }
@@ -1797,17 +1795,17 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
 
 
 static svn_error_t *
-add_absent_excluded_not_present_node(svn_wc__db_t *db,
-                                     const char *local_abspath,
-                                     const char *repos_relpath,
-                                     const char *repos_root_url,
-                                     const char *repos_uuid,
-                                     svn_revnum_t revision,
-                                     svn_wc__db_kind_t kind,
-                                     svn_wc__db_status_t status,
-                                     const svn_skel_t *conflict,
-                                     const svn_skel_t *work_items,
-                                     apr_pool_t *scratch_pool)
+add_excluded_or_not_present_node(svn_wc__db_t *db,
+                                 const char *local_abspath,
+                                 const char *repos_relpath,
+                                 const char *repos_root_url,
+                                 const char *repos_uuid,
+                                 svn_revnum_t revision,
+                                 svn_wc__db_kind_t kind,
+                                 svn_wc__db_status_t status,
+                                 const svn_skel_t *conflict,
+                                 const svn_skel_t *work_items,
+                                 apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
@@ -1869,22 +1867,22 @@ add_absent_excluded_not_present_node(svn
 
 
 svn_error_t *
-svn_wc__db_base_add_absent_node(svn_wc__db_t *db,
-                                const char *local_abspath,
-                                const char *repos_relpath,
-                                const char *repos_root_url,
-                                const char *repos_uuid,
-                                svn_revnum_t revision,
-                                svn_wc__db_kind_t kind,
-                                svn_wc__db_status_t status,
-                                const svn_skel_t *conflict,
-                                const svn_skel_t *work_items,
-                                apr_pool_t *scratch_pool)
+svn_wc__db_base_add_excluded_node(svn_wc__db_t *db,
+                                  const char *local_abspath,
+                                  const char *repos_relpath,
+                                  const char *repos_root_url,
+                                  const char *repos_uuid,
+                                  svn_revnum_t revision,
+                                  svn_wc__db_kind_t kind,
+                                  svn_wc__db_status_t status,
+                                  const svn_skel_t *conflict,
+                                  const svn_skel_t *work_items,
+                                  apr_pool_t *scratch_pool)
 {
   SVN_ERR_ASSERT(status == svn_wc__db_status_server_excluded
                  || status == svn_wc__db_status_excluded);
 
-  return add_absent_excluded_not_present_node(
+  return add_excluded_or_not_present_node(
     db, local_abspath, repos_relpath, repos_root_url, repos_uuid, revision,
     kind, status, conflict, work_items, scratch_pool);
 }
@@ -1902,7 +1900,7 @@ svn_wc__db_base_add_not_present_node(svn
                                      const svn_skel_t *work_items,
                                      apr_pool_t *scratch_pool)
 {
-  return add_absent_excluded_not_present_node(
+  return add_excluded_or_not_present_node(
     db, local_abspath, repos_relpath, repos_root_url, repos_uuid, revision,
     kind, svn_wc__db_status_not_present, conflict, work_items, scratch_pool);
 }
@@ -3130,7 +3128,7 @@ svn_wc__db_externals_gather_definitions(
   while (have_row)
     {
       apr_hash_t *node_props;
-      const svn_string_t *external_value;
+      const char *external_value;
 
       svn_pool_clear(iterpool);
       err = svn_sqlite__column_properties(&node_props, stmt, 0, iterpool,
@@ -3139,10 +3137,7 @@ svn_wc__db_externals_gather_definitions(
       if (err)
         break;
 
-      external_value = node_props
-                            ? apr_hash_get(node_props, SVN_PROP_EXTERNALS,
-                                           APR_HASH_KEY_STRING)
-                            : NULL;
+      external_value = svn_prop_get_value(node_props, SVN_PROP_EXTERNALS);
 
       if (external_value)
         {
@@ -3152,9 +3147,8 @@ svn_wc__db_externals_gather_definitions(
           node_abspath = svn_dirent_join(wcroot->abspath, node_relpath,
                                          result_pool);
 
-          apr_hash_set(*externals, node_abspath,
-                       APR_HASH_KEY_STRING,
-                       apr_pstrdup(result_pool, external_value->data));
+          apr_hash_set(*externals, node_abspath, APR_HASH_KEY_STRING,
+                       apr_pstrdup(result_pool, external_value));
 
           if (depths)
             {
@@ -3176,7 +3170,7 @@ svn_wc__db_externals_gather_definitions(
   svn_pool_destroy(iterpool);
 
   return svn_error_trace(svn_error_compose_create(err,
-                                                   svn_sqlite__reset(stmt)));
+                                                  svn_sqlite__reset(stmt)));
 }
 
 /* Copy the ACTUAL data for SRC_RELPATH and tweak it to refer to DST_RELPATH.
@@ -3428,14 +3422,15 @@ op_depth_for_copy(apr_int64_t *op_depth,
                   apr_pool_t *scratch_pool);
 
 
-/* Like svn_wc__db_op_copy(), but with WCROOT+LOCAL_RELPATH instead of
-   DB+LOCAL_ABSPATH.  */
+/* Like svn_wc__db_op_copy()/svn_wc__db_op_move(), but with
+   WCROOT+LOCAL_RELPATH instead of DB+LOCAL_ABSPATH.  */
 static svn_error_t *
 db_op_copy(svn_wc__db_wcroot_t *src_wcroot,
            const char *src_relpath,
            svn_wc__db_wcroot_t *dst_wcroot,
            const char *dst_relpath,
            const svn_skel_t *work_items,
+           svn_boolean_t is_move,
            apr_pool_t *scratch_pool)
 {
   const char *copyfrom_relpath;
@@ -3545,17 +3540,18 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
 
       if (have_work)
         SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
-                         STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING));
+                          STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING));
       else
         SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
                           STMT_INSERT_WORKING_NODE_COPY_FROM_BASE));
 
-      SVN_ERR(svn_sqlite__bindf(stmt, "issist",
+      SVN_ERR(svn_sqlite__bindf(stmt, "issisti",
                     src_wcroot->wc_id, src_relpath,
                     dst_relpath,
                     dst_op_depth,
                     dst_parent_relpath,
-                    presence_map, dst_presence));
+                    presence_map, dst_presence,
+                    (apr_int64_t)(is_move ? 1 : 0)));
 
       SVN_ERR(svn_sqlite__step_done(stmt));
 
@@ -3625,6 +3621,7 @@ struct op_copy_baton
   const char *dst_relpath;
 
   const svn_skel_t *work_items;
+  svn_boolean_t is_move;
 };
 
 /* Helper for svn_wc__db_op_copy.
@@ -3648,7 +3645,7 @@ op_copy_txn(void * baton, svn_sqlite__db
 
   SVN_ERR(db_op_copy(ocb->src_wcroot, ocb->src_relpath,
                      ocb->dst_wcroot, ocb->dst_relpath,
-                     ocb->work_items, scratch_pool));
+                     ocb->work_items, ocb->is_move, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -3661,7 +3658,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
                    const svn_skel_t *work_items,
                    apr_pool_t *scratch_pool)
 {
-   struct op_copy_baton ocb = {0};
+  struct op_copy_baton ocb = {0};
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
@@ -3679,6 +3676,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
   VERIFY_USABLE_WCROOT(ocb.dst_wcroot);
 
   ocb.work_items = work_items;
+  ocb.is_move = FALSE;
 
   /* Call with the sdb in src_wcroot. It might call itself again to
      also obtain a lock in dst_wcroot */
@@ -3818,15 +3816,16 @@ db_op_copy_shadowed_layer(svn_wc__db_wcr
         SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
                              STMT_INSERT_WORKING_NODE_COPY_FROM_BASE));
 
-      SVN_ERR(svn_sqlite__bindf(stmt, "issist",
+      SVN_ERR(svn_sqlite__bindf(stmt, "issisti",
                         src_wcroot->wc_id, src_relpath,
                         dst_relpath,
                         dst_op_depth,
                         svn_relpath_dirname(dst_relpath, iterpool),
-                        presence_map, dst_presence));
+                        presence_map, dst_presence,
+                        (apr_int64_t)0));
 
       if (src_op_depth > 0)
-        SVN_ERR(svn_sqlite__bind_int64(stmt, 7, src_op_depth));
+        SVN_ERR(svn_sqlite__bind_int64(stmt, 8, src_op_depth));
 
       SVN_ERR(svn_sqlite__step_done(stmt));
 
@@ -4021,33 +4020,32 @@ op_depth_of(apr_int64_t *op_depth,
 }
 
 
-/* If there are any absent (excluded by authz) base nodes then the
-   copy must fail as it's not possible to commit such a copy.  Return
-   an error if there are any absent nodes. */
+/* If there are any server-excluded base nodes then the copy must fail
+   as it's not possible to commit such a copy.
+   Return an error if there are any server-excluded nodes. */
 static svn_error_t *
-catch_copy_of_absent(svn_wc__db_wcroot_t *wcroot,
-                     const char *local_relpath,
-                     apr_pool_t *scratch_pool)
+catch_copy_of_server_excluded(svn_wc__db_wcroot_t *wcroot,
+                              const char *local_relpath,
+                              apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
-  const char *absent_relpath;
+  const char *server_excluded_relpath;
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_HAS_ABSENT_NODES));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss",
+                                    STMT_HAS_SERVER_EXCLUDED_NODES));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is",
                             wcroot->wc_id,
-                            local_relpath,
-                            construct_like_arg(local_relpath,
-                                               scratch_pool)));
+                            local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
-    absent_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
+    server_excluded_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
   SVN_ERR(svn_sqlite__reset(stmt));
   if (have_row)
     return svn_error_createf(SVN_ERR_AUTHZ_UNREADABLE, NULL,
                              _("Cannot copy '%s' excluded by server"),
-                             path_for_error_message(wcroot, absent_relpath,
+                             path_for_error_message(wcroot,
+                                                    server_excluded_relpath,
                                                     scratch_pool));
 
   return SVN_NO_ERROR;
@@ -4650,8 +4648,8 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
   spb.work_items = work_items;
 
   return svn_error_trace(svn_wc__db_with_txn(wcroot, local_relpath,
-                                              set_props_txn, &spb,
-                                              scratch_pool));
+                                             set_props_txn, &spb,
+                                             scratch_pool));
 }
 
 
@@ -4720,12 +4718,36 @@ svn_error_t *
 svn_wc__db_op_move(svn_wc__db_t *db,
                    const char *src_abspath,
                    const char *dst_abspath,
+                   const char *dst_op_root_abspath,
+                   const svn_skel_t *work_items,
                    apr_pool_t *scratch_pool)
 {
+  struct op_copy_baton ocb = {0};
+
   SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
 
-  NOT_IMPLEMENTED();
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.src_wcroot,
+                                                &ocb.src_relpath, db,
+                                                src_abspath,
+                                                scratch_pool, scratch_pool));
+  VERIFY_USABLE_WCROOT(ocb.src_wcroot);
+
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.dst_wcroot,
+                                                &ocb.dst_relpath,
+                                                db, dst_abspath,
+                                                scratch_pool, scratch_pool));
+  VERIFY_USABLE_WCROOT(ocb.dst_wcroot);
+
+  ocb.work_items = work_items;
+  ocb.is_move = TRUE;
+
+  /* Call with the sdb in src_wcroot. It might call itself again to
+     also obtain a lock in dst_wcroot */
+  SVN_ERR(svn_sqlite__with_lock(ocb.src_wcroot->sdb, op_copy_txn, &ocb,
+                                scratch_pool));
+
+  return SVN_NO_ERROR;
 }
 
 
@@ -4748,14 +4770,7 @@ populate_targets_tree(svn_wc__db_wcroot_
                       apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
-  const char *like_arg;
-
-  if (depth == svn_depth_infinity)
-    {
-      /* Calculate a value we're going to need later. */
-      like_arg = construct_like_arg(local_relpath, scratch_pool);
-    }
-
+  int affected_rows = 0;
   SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
                                       STMT_CREATE_TARGETS_LIST));
 
@@ -4793,15 +4808,16 @@ populate_targets_tree(svn_wc__db_wcroot_
 
       for (i = 0; i < changelist_filter->nelts; i++)
         {
+          int sub_affected;
           const char *changelist = APR_ARRAY_IDX(changelist_filter, i,
                                                  const char *);
 
           SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, stmt_idx));
           SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
                                     local_relpath, changelist));
-          if (depth == svn_depth_infinity)
-            SVN_ERR(svn_sqlite__bind_text(stmt, 4, like_arg));
-          SVN_ERR(svn_sqlite__step_done(stmt));
+          SVN_ERR(svn_sqlite__update(&sub_affected, stmt));
+
+          affected_rows += sub_affected;
         }
     }
   else /* No changelist filtering */
@@ -4834,9 +4850,21 @@ populate_targets_tree(svn_wc__db_wcroot_
 
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, stmt_idx));
       SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-      if (depth == svn_depth_infinity)
-        SVN_ERR(svn_sqlite__bind_text(stmt, 3, like_arg));
-      SVN_ERR(svn_sqlite__step_done(stmt));
+      SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+    }
+
+  /* Does the target exist? */
+  if (affected_rows == 0)
+    {
+      svn_boolean_t exists;
+      SVN_ERR(does_node_exist(&exists, wcroot, local_relpath));
+
+      if (!exists)
+        return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                                 _("The node '%s' was not found."),
+                                 path_for_error_message(wcroot,
+                                                        local_relpath,
+                                                        scratch_pool));
     }
 
   return SVN_NO_ERROR;
@@ -5003,12 +5031,12 @@ svn_wc__db_op_set_changelist(svn_wc__db_
   /* Perform the set-changelist operation (transactionally), perform any
      notifications necessary, and then clean out our temporary tables.  */
   return svn_error_trace(with_finalization(wcroot, local_relpath,
-                                            set_changelist_txn, &scb,
-                                            do_changelist_notify, NULL,
-                                            cancel_func, cancel_baton,
-                                            notify_func, notify_baton,
-                                            STMT_FINALIZE_CHANGELIST,
-                                            scratch_pool));
+                                           set_changelist_txn, &scb,
+                                           do_changelist_notify, NULL,
+                                           cancel_func, cancel_baton,
+                                           notify_func, notify_baton,
+                                           STMT_FINALIZE_CHANGELIST,
+                                           scratch_pool));
 }
 
 
@@ -5243,8 +5271,7 @@ op_revert_txn(void *baton,
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                      STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE));
       SVN_ERR(svn_sqlite__bindf(stmt, "isi", wcroot->wc_id,
-                                construct_like_arg(local_relpath,
-                                                   scratch_pool),
+                                local_relpath,
                                 op_depth));
       SVN_ERR(svn_sqlite__step_done(stmt));
 
@@ -5287,7 +5314,6 @@ op_revert_recursive_txn(void *baton,
   svn_boolean_t have_row;
   apr_int64_t op_depth;
   int affected_rows;
-  const char *like_arg = construct_like_arg(local_relpath, scratch_pool);
 
   /* ### Similar structure to op_revert_txn, should they be
          combined? */
@@ -5302,8 +5328,8 @@ op_revert_recursive_txn(void *baton,
 
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_DELETE_ACTUAL_NODE_RECURSIVE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
-                                local_relpath, like_arg));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                                local_relpath));
       SVN_ERR(svn_sqlite__step(&affected_rows, stmt));
 
       if (affected_rows)
@@ -5338,21 +5364,21 @@ op_revert_recursive_txn(void *baton,
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                         STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
-                            local_relpath, like_arg));
+  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, wcroot->sdb,
                         STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
-                            local_relpath, like_arg));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                            local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
   /* ### This removes the locks, but what about the access batons? */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
-                            local_relpath, like_arg));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                            local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
   return SVN_NO_ERROR;
@@ -5741,8 +5767,6 @@ remove_node_txn(void *baton,
   apr_int64_t repos_id;
   const char *repos_relpath;
 
-  const char *like_arg = construct_like_arg(local_relpath, scratch_pool);
-
   SVN_ERR_ASSERT(*local_relpath != '\0'); /* Never on a wcroot */
 
   /* Need info for not_present node? */
@@ -5765,9 +5789,8 @@ remove_node_txn(void *baton,
                                     STMT_DELETE_ACTUAL_NODE_RECURSIVE));
 
   /* Delete all actual nodes at or below local_relpath */
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
-                                         local_relpath,
-                                         like_arg));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                                         local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
   /* Should we leave a not-present node? */
@@ -6041,7 +6064,6 @@ op_delete_txn(void *baton,
   svn_boolean_t have_row, op_root;
   svn_boolean_t add_work = FALSE;
   svn_sqlite__stmt_t *stmt;
-  const char *like_arg;
   apr_int64_t select_depth; /* Depth of what is to be deleted */
   svn_boolean_t refetch_depth = FALSE;
 
@@ -6059,12 +6081,10 @@ op_delete_txn(void *baton,
       || status == svn_wc__db_status_not_present)
     return SVN_NO_ERROR;
 
-  like_arg = construct_like_arg(local_relpath, scratch_pool);
-
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_HAS_ABSENT_NODES));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss",
-                            wcroot->wc_id, local_relpath, like_arg));
+                                    STMT_HAS_SERVER_EXCLUDED_NODES));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is",
+                            wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
     {
@@ -6126,20 +6146,20 @@ op_delete_txn(void *baton,
      and a NODES row. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                          STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss",
-                            wcroot->wc_id, local_relpath, like_arg));
+  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, wcroot->sdb,
                          STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss",
-                            wcroot->wc_id, local_relpath, like_arg));
+  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, wcroot->sdb,
                                     STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
-                            local_relpath, like_arg));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                            local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
   if (add_work)
@@ -6231,12 +6251,12 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
   /* Perform the deletion operation (transactionally), perform any
      notifications necessary, and then clean out our temporary tables.  */
   return svn_error_trace(with_finalization(wcroot, local_relpath,
-                                            op_delete_txn, &odb,
-                                            do_delete_notify, NULL,
-                                            cancel_func, cancel_baton,
-                                            notify_func, notify_baton,
-                                            STMT_FINALIZE_DELETE,
-                                            scratch_pool));
+                                           op_delete_txn, &odb,
+                                           do_delete_notify, NULL,
+                                           cancel_func, cancel_baton,
+                                           notify_func, notify_baton,
+                                           STMT_FINALIZE_DELETE,
+                                           scratch_pool));
 }
 
 
@@ -6677,6 +6697,7 @@ read_children_info(void *baton,
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
   const char *repos_root_url = NULL;
+  const char *repos_uuid = NULL;
   apr_int64_t last_repos_id;
   apr_hash_t *nodes = rci->nodes;
   apr_hash_t *conflicts = rci->conflicts;
@@ -6739,13 +6760,14 @@ read_children_info(void *baton,
           if (op_depth != 0 || svn_sqlite__column_is_null(stmt, 1))
             {
               child->repos_root_url = NULL;
+              child->repos_uuid = NULL;
             }
           else
             {
               apr_int64_t repos_id = svn_sqlite__column_int64(stmt, 1);
               if (!repos_root_url)
                 {
-                  err = fetch_repos_info(&repos_root_url, NULL,
+                  err = fetch_repos_info(&repos_root_url, &repos_uuid,
                                          wcroot->sdb, repos_id, result_pool);
                   if (err)
                     SVN_ERR(svn_error_compose_create(err,
@@ -6757,6 +6779,7 @@ read_children_info(void *baton,
                  single cached value is sufficient. */
               SVN_ERR_ASSERT(repos_id == last_repos_id);
               child->repos_root_url = repos_root_url;
+              child->repos_uuid = repos_uuid;
             }
 
           child->changed_rev = svn_sqlite__column_revnum(stmt, 8);
@@ -7355,7 +7378,7 @@ svn_wc__db_read_url(const char **url,
   VERIFY_USABLE_WCROOT(wcroot);
 
   return svn_error_trace(read_url(url, wcroot, local_relpath, result_pool,
-                                   scratch_pool));
+                                  scratch_pool));
 }
 
 
@@ -8431,6 +8454,7 @@ svn_wc__db_global_commit(svn_wc__db_t *d
 }
 
 
+#if 0
 struct update_baton_t {
   const char *new_repos_relpath;
   svn_revnum_t new_revision;
@@ -8444,6 +8468,7 @@ struct update_baton_t {
   const svn_skel_t *conflict;
   const svn_skel_t *work_items;
 };
+#endif
 
 
 svn_error_t *
@@ -8616,16 +8641,16 @@ bump_node_revision(svn_wc__db_wcroot_t *
   /* If the node is still marked 'not-present', then the server did not
      re-add it.  So it's really gone in this revision, thus we remove the node.
 
-     If the node is still marked 'absent' and yet is not the same
+     If the node is still marked 'server-excluded' and yet is not the same
      revision as new_rev, then the server did not re-add it, nor
-     re-absent it, so we can remove the node. */
+     re-server-exclude it, so we can remove the node. */
   if (!is_root
       && (status == svn_wc__db_status_not_present
           || (status == svn_wc__db_status_server_excluded &&
               revision != new_rev)))
     {
       return svn_error_trace(db_base_remove(NULL, wcroot, local_relpath,
-                                             scratch_pool));
+                                            scratch_pool));
     }
 
   if (new_repos_relpath != NULL && strcmp(repos_relpath, new_repos_relpath))
@@ -9018,7 +9043,7 @@ scan_addition_txn(void *baton,
       {
         /* Calculate the path of the operation root */
         repos_prefix_path =
-          svn_relpath_join(svn_dirent_basename(current_relpath, NULL),
+          svn_relpath_join(svn_relpath_basename(current_relpath, NULL),
                            repos_prefix_path,
                            scratch_pool);
         current_relpath = svn_relpath_dirname(current_relpath, scratch_pool);
@@ -9097,7 +9122,7 @@ scan_addition_txn(void *baton,
 
         /* Pointing at op_depth, look at the parent */
         repos_prefix_path =
-          svn_relpath_join(svn_dirent_basename(current_relpath, NULL),
+          svn_relpath_join(svn_relpath_basename(current_relpath, NULL),
                            repos_prefix_path,
                            scratch_pool);
         current_relpath = svn_relpath_dirname(current_relpath, scratch_pool);
@@ -9116,7 +9141,7 @@ scan_addition_txn(void *baton,
           {
             /* Calculate the path of the operation root */
             repos_prefix_path =
-              svn_relpath_join(svn_dirent_basename(current_relpath, NULL),
+              svn_relpath_join(svn_relpath_basename(current_relpath, NULL),
                                repos_prefix_path,
                                scratch_pool);
             current_relpath =
@@ -9211,8 +9236,8 @@ scan_addition(svn_wc__db_status_t *statu
   sab.result_pool = result_pool;
 
   return svn_error_trace(svn_wc__db_with_txn(wcroot, local_relpath,
-                                              scan_addition_txn,
-                                              &sab, scratch_pool));
+                                             scan_addition_txn,
+                                             &sab, scratch_pool));
 }
 
 
@@ -9486,8 +9511,8 @@ scan_deletion(const char **base_del_relp
   sd_baton.result_pool = result_pool;
 
   return svn_error_trace(svn_wc__db_with_txn(wcroot, local_relpath,
-                                              scan_deletion_txn, &sd_baton,
-                                              scratch_pool));
+                                             scan_deletion_txn, &sd_baton,
+                                             scratch_pool));
 }
 
 
@@ -9551,9 +9576,9 @@ svn_wc__db_upgrade_begin(svn_sqlite__db_
                          apr_pool_t *scratch_pool)
 {
   return svn_error_trace(create_db(sdb, repos_id, wc_id, dir_abspath,
-                                    repos_root_url, repos_uuid,
-                                    SDB_FILE,
-                                    result_pool, scratch_pool));
+                                   repos_root_url, repos_uuid,
+                                   SDB_FILE,
+                                   result_pool, scratch_pool));
 }
 
 
@@ -9605,11 +9630,11 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
                                apr_hash_t *revert_props,
                                apr_hash_t *working_props,
                                int original_format,
+                               apr_int64_t wc_id,
                                apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
-  apr_int64_t wc_id;
   apr_int64_t top_op_depth = -1;
   apr_int64_t below_op_depth = -1;
   svn_wc__db_status_t top_presence;
@@ -9644,20 +9669,19 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
      the handling of our inputs, relative to the state of this node.
   */
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_NODE_UPGRADE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "s", local_relpath));
+  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_NODE_INFO));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
     {
       top_op_depth = svn_sqlite__column_int64(stmt, 0);
-      top_presence = svn_sqlite__column_token(stmt, 1, presence_map);
-      wc_id = svn_sqlite__column_int64(stmt, 2);
-      kind = svn_sqlite__column_token(stmt, 3, kind_map);
+      top_presence = svn_sqlite__column_token(stmt, 3, presence_map);
+      kind = svn_sqlite__column_token(stmt, 4, kind_map);
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
       if (have_row)
         {
           below_op_depth = svn_sqlite__column_int64(stmt, 0);
-          below_presence = svn_sqlite__column_token(stmt, 1, presence_map);
+          below_presence = svn_sqlite__column_token(stmt, 3, presence_map);
         }
     }
   SVN_ERR(svn_sqlite__reset(stmt));
@@ -9743,15 +9767,13 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
 
   if (kind == svn_wc__db_kind_dir)
     {
-      const svn_string_t *externals = NULL;
+      const char *externals;
       apr_hash_t *props = working_props;
 
       if (props == NULL)
         props = base_props;
 
-      if (props != NULL)
-        externals = apr_hash_get(props, SVN_PROP_EXTERNALS,
-                                 APR_HASH_KEY_STRING);
+      externals = svn_prop_get_value(props, SVN_PROP_EXTERNALS);
 
       if (externals != NULL)
         {
@@ -9763,7 +9785,7 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
           SVN_ERR(svn_wc_parse_externals_description3(
                             &ext, svn_dirent_join(dir_abspath, local_relpath,
                                                   scratch_pool),
-                            externals->data, FALSE, scratch_pool));
+                            externals, FALSE, scratch_pool));
           for (i = 0; i < ext->nelts; i++)
             {
               const svn_wc_external_item2_t *item;
@@ -9837,7 +9859,7 @@ svn_wc__db_wq_add(svn_wc__db_t *db,
 
   /* Add the work item(s) to the WORK_QUEUE.  */
   return svn_error_trace(add_work_items(wcroot->sdb, work_item,
-                                         scratch_pool));
+                                        scratch_pool));
 }
 
 /* Baton for wq_fetch_next */
@@ -10156,7 +10178,7 @@ svn_wc__db_read_conflict_victims(const a
       const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
 
       APR_ARRAY_PUSH(new_victims, const char *) =
-                            svn_dirent_basename(child_relpath, result_pool);
+                            svn_relpath_basename(child_relpath, result_pool);
 
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
     }
@@ -10208,7 +10230,7 @@ svn_wc__db_get_conflict_marker_files(apr
           marker_relpath = svn_sqlite__column_text(stmt, i, scratch_pool);
           if (marker_relpath)
             {
-              base_name = svn_dirent_basename(marker_relpath, result_pool);
+              base_name = svn_relpath_basename(marker_relpath, result_pool);
               apr_hash_set(*marker_files, base_name, APR_HASH_KEY_STRING,
                            base_name);
             }
@@ -10703,8 +10725,8 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
   baton.levels_to_lock = levels_to_lock;
 
   return svn_error_trace(svn_wc__db_with_txn(wcroot, local_relpath,
-                                              wclock_obtain_cb, &baton,
-                                              scratch_pool));
+                                             wclock_obtain_cb, &baton,
+                                             scratch_pool));
 }
 
 
@@ -11211,9 +11233,9 @@ svn_wc__db_temp_op_make_copy(svn_wc__db_
                                                     local_relpath,
                                                     scratch_pool));
 
-  /* We don't allow copies to contain absent (denied by authz) nodes;
+  /* We don't allow copies to contain server-excluded nodes;
      the update editor is going to have to bail out. */
-  SVN_ERR(catch_copy_of_absent(wcroot, local_relpath, scratch_pool));
+  SVN_ERR(catch_copy_of_server_excluded(wcroot, local_relpath, scratch_pool));
 
   mcb.op_depth = relpath_depth(local_relpath);
 
@@ -11517,8 +11539,7 @@ get_min_max_revisions(svn_revnum_t *min_
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_MIN_MAX_REVISIONS));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
-                            construct_like_arg(local_relpath, scratch_pool)));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
     {
@@ -11572,8 +11593,8 @@ svn_wc__db_min_max_revisions(svn_revnum_
   VERIFY_USABLE_WCROOT(wcroot);
 
   return svn_error_trace(get_min_max_revisions(min_revision, max_revision,
-                                                wcroot, local_relpath,
-                                                committed, scratch_pool));
+                                               wcroot, local_relpath,
+                                               committed, scratch_pool));
 }
 
 
@@ -11590,11 +11611,9 @@ is_sparse_checkout_internal(svn_boolean_
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_HAS_SPARSE_NODES));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss",
+  SVN_ERR(svn_sqlite__bindf(stmt, "is",
                             wcroot->wc_id,
-                            local_relpath,
-                            construct_like_arg(local_relpath,
-                                               scratch_pool)));
+                            local_relpath));
   /* If this query returns a row, the working copy is sparse. */
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   *is_sparse_checkout = have_row;
@@ -11621,8 +11640,8 @@ svn_wc__db_is_sparse_checkout(svn_boolea
   VERIFY_USABLE_WCROOT(wcroot);
 
   return svn_error_trace(is_sparse_checkout_internal(is_sparse_checkout,
-                                                      wcroot, local_relpath,
-                                                      scratch_pool));
+                                                     wcroot, local_relpath,
+                                                     scratch_pool));
 }
 
 
@@ -11732,16 +11751,16 @@ svn_wc__db_has_switched_subtrees(svn_boo
   VERIFY_USABLE_WCROOT(wcroot);
 
   return svn_error_trace(has_switched_subtrees(is_switched, wcroot,
-                                                local_relpath, trail_url,
-                                                scratch_pool));
+                                               local_relpath, trail_url,
+                                               scratch_pool));
 }
 
 svn_error_t *
-svn_wc__db_get_absent_subtrees(apr_hash_t **absent_subtrees,
-                               svn_wc__db_t *db,
-                               const char *local_abspath,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool)
+svn_wc__db_get_server_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
+                                        svn_wc__db_t *db,
+                                        const char *local_abspath,
+                                        apr_pool_t *result_pool,
+                                        apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
@@ -11754,18 +11773,16 @@ svn_wc__db_get_absent_subtrees(apr_hash_
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_SELECT_ALL_ABSENT_NODES));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss",
+                                    STMT_SELECT_ALL_SERVER_EXCLUDED_NODES));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is",
                             wcroot->wc_id,
-                            local_relpath,
-                            construct_like_arg(local_relpath,
-                                               scratch_pool)));
+                            local_relpath));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
   if (have_row)
-    *absent_subtrees = apr_hash_make(result_pool);
+    *server_excluded_subtrees = apr_hash_make(result_pool);
   else
-    *absent_subtrees = NULL;
+    *server_excluded_subtrees = NULL;
 
   while (have_row)
     {
@@ -11773,7 +11790,8 @@ svn_wc__db_get_absent_subtrees(apr_hash_
         svn_dirent_join(wcroot->abspath,
                         svn_sqlite__column_text(stmt, 0, scratch_pool),
                         result_pool);
-      apr_hash_set(*absent_subtrees, abs_path, APR_HASH_KEY_STRING, abs_path);
+      apr_hash_set(*server_excluded_subtrees, abs_path, APR_HASH_KEY_STRING,
+                   abs_path);
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
     }
 
@@ -11798,8 +11816,7 @@ has_local_mods(svn_boolean_t *is_modifie
   /* Check for additions or deletions. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SUBTREE_HAS_TREE_MODIFICATIONS));
-  SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
-                            construct_like_arg(local_relpath, scratch_pool)));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
   /* If this query returns a row, the working copy is modified. */
   SVN_ERR(svn_sqlite__step(is_modified, stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
@@ -11812,9 +11829,7 @@ has_local_mods(svn_boolean_t *is_modifie
       /* Check for property modifications. */
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_SUBTREE_HAS_PROP_MODIFICATIONS));
-      SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
-                                construct_like_arg(local_relpath,
-                                                   scratch_pool)));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
       /* If this query returns a row, the working copy is modified. */
       SVN_ERR(svn_sqlite__step(is_modified, stmt));
       SVN_ERR(svn_sqlite__reset(stmt));
@@ -11831,9 +11846,7 @@ has_local_mods(svn_boolean_t *is_modifie
       /* Check for text modifications. */
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_SELECT_BASE_FILES_RECURSIVE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
-                                construct_like_arg(local_relpath,
-                                                   scratch_pool)));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
       if (have_row)
         iterpool = svn_pool_create(scratch_pool);
@@ -11918,8 +11931,8 @@ svn_wc__db_has_local_mods(svn_boolean_t 
   VERIFY_USABLE_WCROOT(wcroot);
 
   return svn_error_trace(has_local_mods(is_modified, wcroot, local_relpath,
-                                         db, cancel_func, cancel_baton,
-                                         scratch_pool));
+                                        db, cancel_func, cancel_baton,
+                                        scratch_pool));
 }
 
 
@@ -12029,8 +12042,8 @@ svn_wc__db_revision_status(svn_revnum_t 
   VERIFY_USABLE_WCROOT(wcroot);
 
   return svn_error_trace(svn_wc__db_with_txn(wcroot, local_relpath,
-                                              revision_status_txn, &rsb,
-                                              scratch_pool));
+                                             revision_status_txn, &rsb,
+                                             scratch_pool));
 }
 
 

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.h Tue Jul 19 23:05:44 2011
@@ -610,7 +610,7 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
    at revision REVISION.
 
    The node's kind is described by KIND, and the reason for its absence
-   is specified by STATUS. Only three values are allowed for STATUS:
+   is specified by STATUS. Only these values are allowed for STATUS:
 
      svn_wc__db_status_server_excluded
      svn_wc__db_status_excluded
@@ -624,17 +624,17 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
    All temporary allocations will be made in SCRATCH_POOL.
 */
 svn_error_t *
-svn_wc__db_base_add_absent_node(svn_wc__db_t *db,
-                                const char *local_abspath,
-                                const char *repos_relpath,
-                                const char *repos_root_url,
-                                const char *repos_uuid,
-                                svn_revnum_t revision,
-                                svn_wc__db_kind_t kind,
-                                svn_wc__db_status_t status,
-                                const svn_skel_t *conflict,
-                                const svn_skel_t *work_items,
-                                apr_pool_t *scratch_pool);
+svn_wc__db_base_add_excluded_node(svn_wc__db_t *db,
+                                  const char *local_abspath,
+                                  const char *repos_relpath,
+                                  const char *repos_root_url,
+                                  const char *repos_uuid,
+                                  svn_revnum_t revision,
+                                  svn_wc__db_kind_t kind,
+                                  svn_wc__db_status_t status,
+                                  const svn_skel_t *conflict,
+                                  const svn_skel_t *work_items,
+                                  apr_pool_t *scratch_pool);
 
 
 /* Create a node in the BASE tree that is present in name only.
@@ -1227,7 +1227,8 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
  * properly deleted.
  *
  * Usually this operation is directly followed by a call to svn_wc__db_op_copy
- * which performs the real copy from src_abspath to dst_abspath.
+ * or svn_wc__db_op_move which performs the real copy from src_abspath to
+ * dst_abspath.
  */
 svn_error_t *
 svn_wc__db_op_copy_shadowed_layer(svn_wc__db_t *db,
@@ -1427,12 +1428,20 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
                      apr_pool_t *scratch_pool);
 
 
-/* ### KFF: Would like to know behavior when dst_path already exists
-   ### and is a) a dir or b) a non-dir. */
+/* Move the node at SRC_ABSPATH (in NODES and ACTUAL_NODE tables) to
+ * DST_ABSPATH, both in DB but not necessarily in the same WC.  The parent
+ * of DST_ABSPATH must be a versioned directory.
+ *
+ * This move is NOT recursive. It simply establishes this one node, plus
+ * incomplete nodes for the children.
+ *
+ * Add WORK_ITEMS to the work queue. */
 svn_error_t *
 svn_wc__db_op_move(svn_wc__db_t *db,
                    const char *src_abspath,
                    const char *dst_abspath,
+                   const char *dst_op_root_abspath,
+                   const svn_skel_t *work_items,
                    apr_pool_t *scratch_pool);
 
 
@@ -1817,6 +1826,7 @@ struct svn_wc__db_info_t {
   svn_revnum_t revnum;
   const char *repos_relpath;
   const char *repos_root_url;
+  const char *repos_uuid;
   svn_revnum_t changed_rev;
   const char *changed_author;
   apr_time_t changed_date;
@@ -2597,6 +2607,7 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
                                apr_hash_t *revert_props,
                                apr_hash_t *working_props,
                                int original_format,
+                               apr_int64_t wc_id,
                                apr_pool_t *scratch_pool);
 
 
@@ -2981,18 +2992,19 @@ svn_wc__db_has_switched_subtrees(svn_boo
                                  const char *trail_url,
                                  apr_pool_t *scratch_pool);
 
-/* Set @a *absent_subtrees to a hash mapping <tt>const char *</tt> local
- * absolute paths to <tt>const char *</tt> local absolute paths for every
- * path at or under @a local_abspath in @a db which are absent (excluded
- * by authz).  If no absent paths are found then @a *absent_subtrees is set
- * to @c NULL.  Allocate the hash and all items therein from @a result_pool.
+/* Set @a *server_excluded_subtrees to a hash mapping <tt>const char *</tt>
+ * local absolute paths to <tt>const char *</tt> local absolute paths for
+ * every path at or under @a local_abspath in @a db which are excluded by
+ * the server (e.g. due to authz).  If no such paths are found then
+ * @a *server_excluded_subtrees is set to @c NULL.
+ * Allocate the hash and all items therein from @a result_pool.
  */
 svn_error_t *
-svn_wc__db_get_absent_subtrees(apr_hash_t **absent_subtrees,
-                               svn_wc__db_t *db,
-                               const char *local_abspath,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool);
+svn_wc__db_get_server_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
+                                        svn_wc__db_t *db,
+                                        const char *local_abspath,
+                                        apr_pool_t *result_pool,
+                                        apr_pool_t *scratch_pool);
 
 /* Indicate in *IS_MODIFIED whether the working copy has local modifications,
  * using DB. Use SCRATCH_POOL for temporary allocations.

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db_wcroot.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db_wcroot.c Tue Jul 19 23:05:44 2011
@@ -225,7 +225,7 @@ svn_wc__db_close(svn_wc__db_t *db)
 
   /* Run the cleanup for each WCROOT.  */
   return svn_error_trace(svn_wc__db_close_many_wcroots(roots, db->state_pool,
-                                                        scratch_pool));
+                                                       scratch_pool));
 }
 
 

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/workqueue.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/workqueue.c Tue Jul 19 23:05:44 2011
@@ -87,9 +87,9 @@ get_and_record_fileinfo(svn_wc__db_t *db
     }
 
   return svn_error_trace(svn_wc__db_global_record_fileinfo(
-                            db, local_abspath,
-                            dirent->filesize, dirent->mtime,
-                            scratch_pool));
+                           db, local_abspath,
+                           dirent->filesize, dirent->mtime,
+                           scratch_pool));
 }
 
 
@@ -737,7 +737,35 @@ run_file_install(svn_wc__db_t *db,
 
   /* All done. Move the file into place.  */
   /* ### fix this. we should delay the rename.  */
-  SVN_ERR(svn_io_file_rename(dst_abspath, local_abspath, scratch_pool));
+
+  {
+    svn_error_t *err;
+
+    err = svn_io_file_rename(dst_abspath, local_abspath, scratch_pool);
+
+    /* With a single db we might want to install files in a missing directory.
+       Simply trying this scenario on error won't do any harm and at least
+       one user reported this problem on IRC. */
+    if (err && APR_STATUS_IS_ENOENT(err->apr_err))
+      {
+        svn_error_t *err2;
+
+        err2 = svn_io_make_dir_recursively(svn_dirent_dirname(dst_abspath,
+                                                              scratch_pool),
+                                           scratch_pool);
+
+        if (err2)
+          /* Creating directory didn't work: Return all errors */
+          return svn_error_trace(svn_error_compose_create(err, err2));
+        else
+          /* We could create a directory: retry install */
+          svn_error_clear(err);
+
+        SVN_ERR(svn_io_file_rename(dst_abspath, local_abspath, scratch_pool));
+      }
+    else
+      SVN_ERR(err);
+  }
 
   /* Tweak the on-disk file according to its properties.  */
   if (props
@@ -828,7 +856,7 @@ run_file_remove(svn_wc__db_t *db,
 
   /* Remove the path, no worrying if it isn't there.  */
   return svn_error_trace(svn_io_remove_file2(local_abspath, TRUE,
-                                              scratch_pool));
+                                             scratch_pool));
 }
 
 
@@ -1204,8 +1232,8 @@ run_record_fileinfo(svn_wc__db_t *db,
 
 
   return svn_error_trace(get_and_record_fileinfo(db, local_abspath,
-                                                  TRUE /* ignore_enoent */,
-                                                  scratch_pool));
+                                                 TRUE /* ignore_enoent */,
+                                                 scratch_pool));
 }
 
 
@@ -1379,9 +1407,9 @@ run_set_property_conflict_marker(svn_wc_
 
   return svn_error_trace(
           svn_wc__db_temp_op_set_property_conflict_marker_file(db,
-                                                                local_abspath,
-                                                                prej_abspath,
-                                                                scratch_pool));
+                                                               local_abspath,
+                                                               prej_abspath,
+                                                               scratch_pool));
 }
 
 svn_error_t *

Modified: subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/dav_svn.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/dav_svn.h Tue Jul 19 23:05:44 2011
@@ -283,9 +283,6 @@ struct dav_resource_private {
 
   /* Cache any revprop change error */
   svn_error_t *revprop_error;
-
-  /* Pool to allocate temporary data from */
-  apr_pool_t *pool;
 };
 
 

Modified: subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/liveprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/liveprops.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/liveprops.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/liveprops.c Tue Jul 19 23:05:44 2011
@@ -268,15 +268,15 @@ get_last_modified_time(const char **date
 }
 
 static dav_prop_insert
-insert_prop(const dav_resource *resource,
-            int propid,
-            dav_prop_insert what,
-            apr_text_header *phdr)
+insert_prop_internal(const dav_resource *resource,
+                     int propid,
+                     dav_prop_insert what,
+                     apr_text_header *phdr,
+                     apr_pool_t *scratch_pool,
+                     apr_pool_t *result_pool)
 {
   const char *value = NULL;
   const char *s;
-  apr_pool_t *response_pool = resource->pool;
-  apr_pool_t *p = resource->info->pool;
   const dav_liveprop_spec *info;
   int global_ns;
   svn_error_t *serr;
@@ -338,12 +338,12 @@ insert_prop(const dav_resource *resource
           }
 
         if (0 != get_last_modified_time(&datestring, &timeval,
-                                        resource, format, p))
+                                        resource, format, scratch_pool))
           {
             return DAV_PROP_INSERT_NOTDEF;
           }
 
-        value = apr_xml_quote_string(p, datestring, 1);
+        value = apr_xml_quote_string(scratch_pool, datestring, 1);
         break;
       }
 
@@ -373,7 +373,8 @@ insert_prop(const dav_resource *resource
                root object might be an ID root -or- a revision root. */
             serr = svn_fs_node_created_rev(&committed_rev,
                                            resource->info->root.root,
-                                           resource->info->repos_path, p);
+                                           resource->info->repos_path,
+                                           scratch_pool);
             if (serr != NULL)
               {
                 /* ### what to do? */
@@ -391,7 +392,7 @@ insert_prop(const dav_resource *resource
                                 resource,
                                 committed_rev,
                                 SVN_PROP_REVISION_AUTHOR,
-                                p);
+                                scratch_pool);
         if (serr)
           {
             /* ### what to do? */
@@ -403,7 +404,7 @@ insert_prop(const dav_resource *resource
         if (last_author == NULL)
           return DAV_PROP_INSERT_NOTDEF;
 
-        value = apr_xml_quote_string(p, last_author->data, 1);
+        value = apr_xml_quote_string(scratch_pool, last_author->data, 1);
         break;
       }
 
@@ -421,7 +422,7 @@ insert_prop(const dav_resource *resource
           return DAV_PROP_INSERT_NOTSUPP;
 
         serr = svn_fs_file_length(&len, resource->info->root.root,
-                                  resource->info->repos_path, p);
+                                  resource->info->repos_path, scratch_pool);
         if (serr != NULL)
           {
             svn_error_clear(serr);
@@ -429,7 +430,7 @@ insert_prop(const dav_resource *resource
             break;
           }
 
-        value = apr_psprintf(p, "%" SVN_FILESIZE_T_FMT, len);
+        value = apr_psprintf(scratch_pool, "%" SVN_FILESIZE_T_FMT, len);
         break;
       }
 
@@ -462,7 +463,7 @@ insert_prop(const dav_resource *resource
           {
             if ((serr = svn_fs_node_prop(&pval, resource->info->root.root,
                                          resource->info->repos_path,
-                                         SVN_PROP_MIME_TYPE, p)))
+                                         SVN_PROP_MIME_TYPE, scratch_pool)))
               {
                 svn_error_clear(serr);
                 pval = NULL;
@@ -476,7 +477,7 @@ insert_prop(const dav_resource *resource
             else
               mime_type = "text/plain";
 
-            if ((serr = svn_mime_type_validate(mime_type, p)))
+            if ((serr = svn_mime_type_validate(mime_type, scratch_pool)))
               {
                 /* Probably serr->apr == SVN_ERR_BAD_MIME_TYPE, but
                    there's no point even checking.  No matter what the
@@ -499,7 +500,7 @@ insert_prop(const dav_resource *resource
           return DAV_PROP_INSERT_NOTSUPP;
         }
 
-      value = dav_svn__getetag(resource, p);
+      value = dav_svn__getetag(resource, scratch_pool);
       break;
 
     case DAV_PROPID_auto_version:
@@ -519,7 +520,7 @@ insert_prop(const dav_resource *resource
         return DAV_PROP_INSERT_NOTSUPP;
       value = dav_svn__build_uri(resource->info->repos, DAV_SVN__BUILD_URI_BC,
                                  resource->info->root.rev, NULL,
-                                 1 /* add_href */, p);
+                                 1 /* add_href */, scratch_pool);
       break;
 
     case DAV_PROPID_checked_in:
@@ -531,7 +532,8 @@ insert_prop(const dav_resource *resource
         {
           svn_revnum_t revnum;
 
-          serr = svn_fs_youngest_rev(&revnum, resource->info->repos->fs, p);
+          serr = svn_fs_youngest_rev(&revnum, resource->info->repos->fs,
+                                     scratch_pool);
           if (serr != NULL)
             {
               /* ### what to do? */
@@ -541,9 +543,9 @@ insert_prop(const dav_resource *resource
             }
           s = dav_svn__build_uri(resource->info->repos,
                                  DAV_SVN__BUILD_URI_BASELINE,
-                                 revnum, NULL, 0 /* add_href */, p);
-          value = apr_psprintf(p, "<D:href>%s</D:href>",
-                               apr_xml_quote_string(p, s, 1));
+                                 revnum, NULL, 0 /* add_href */, scratch_pool);
+          value = apr_psprintf(scratch_pool, "<D:href>%s</D:href>",
+                               apr_xml_quote_string(scratch_pool, s, 1));
         }
       else if (resource->type != DAV_RESOURCE_TYPE_REGULAR)
         {
@@ -554,14 +556,14 @@ insert_prop(const dav_resource *resource
         {
           svn_revnum_t rev_to_use =
             dav_svn__get_safe_cr(resource->info->root.root,
-                                 resource->info->repos_path, p);
+                                 resource->info->repos_path, scratch_pool);
 
           s = dav_svn__build_uri(resource->info->repos,
                                  DAV_SVN__BUILD_URI_VERSION,
                                  rev_to_use, resource->info->repos_path,
-                                0 /* add_href */, p);
-          value = apr_psprintf(p, "<D:href>%s</D:href>",
-                               apr_xml_quote_string(p, s, 1));
+                                0 /* add_href */, scratch_pool);
+          value = apr_psprintf(scratch_pool, "<D:href>%s</D:href>",
+                               apr_xml_quote_string(scratch_pool, s, 1));
         }
       break;
 
@@ -573,7 +575,7 @@ insert_prop(const dav_resource *resource
         return DAV_PROP_INSERT_NOTSUPP;
       value = dav_svn__build_uri(resource->info->repos, DAV_SVN__BUILD_URI_VCC,
                                  SVN_IGNORED_REVNUM, NULL,
-                                 1 /* add_href */, p);
+                                 1 /* add_href */, scratch_pool);
       break;
 
     case DAV_PROPID_version_name:
@@ -593,7 +595,7 @@ insert_prop(const dav_resource *resource
       if (resource->baselined)
         {
           /* just the revision number for baselines */
-          value = apr_psprintf(p, "%ld",
+          value = apr_psprintf(scratch_pool, "%ld",
                                resource->info->root.rev);
         }
       else
@@ -604,7 +606,8 @@ insert_prop(const dav_resource *resource
              root object might be an ID root -or- a revision root. */
           serr = svn_fs_node_created_rev(&committed_rev,
                                          resource->info->root.root,
-                                         resource->info->repos_path, p);
+                                         resource->info->repos_path,
+                                         scratch_pool);
           if (serr != NULL)
             {
               /* ### what to do? */
@@ -614,8 +617,8 @@ insert_prop(const dav_resource *resource
             }
 
           /* Convert the revision into a quoted string */
-          s = apr_psprintf(p, "%ld", committed_rev);
-          value = apr_xml_quote_string(p, s, 1);
+          s = apr_psprintf(scratch_pool, "%ld", committed_rev);
+          value = apr_xml_quote_string(scratch_pool, s, 1);
         }
       break;
 
@@ -628,7 +631,7 @@ insert_prop(const dav_resource *resource
 
       /* drop the leading slash, so it is relative */
       s = resource->info->repos_path + 1;
-      value = apr_xml_quote_string(p, s, 1);
+      value = apr_xml_quote_string(scratch_pool, s, 1);
       break;
 
     case SVN_PROPID_md5_checksum:
@@ -642,7 +645,8 @@ insert_prop(const dav_resource *resource
 
           serr = svn_fs_file_checksum(&checksum, svn_checksum_md5,
                                       resource->info->root.root,
-                                      resource->info->repos_path, TRUE, p);
+                                      resource->info->repos_path, TRUE,
+                                      scratch_pool);
           if (serr != NULL)
             {
               /* ### what to do? */
@@ -651,7 +655,7 @@ insert_prop(const dav_resource *resource
               break;
             }
 
-          value = svn_checksum_to_cstring(checksum, p);
+          value = svn_checksum_to_cstring(checksum, scratch_pool);
 
           if (! value)
             return DAV_PROP_INSERT_NOTSUPP;
@@ -662,7 +666,7 @@ insert_prop(const dav_resource *resource
       break;
 
     case SVN_PROPID_repository_uuid:
-      serr = svn_fs_get_uuid(resource->info->repos->fs, &value, p);
+      serr = svn_fs_get_uuid(resource->info->repos->fs, &value, scratch_pool);
       if (serr != NULL)
         {
           /* ### what to do? */
@@ -682,7 +686,7 @@ insert_prop(const dav_resource *resource
 
         serr = svn_fs_node_proplist(&proplist,
                                     resource->info->root.root,
-                                    resource->info->repos_path, p);
+                                    resource->info->repos_path, scratch_pool);
         if (serr != NULL)
           {
             /* ### what to do? */
@@ -692,7 +696,7 @@ insert_prop(const dav_resource *resource
           }
 
         propcount = apr_hash_count(proplist);
-        value = apr_psprintf(p, "%u", propcount);
+        value = apr_psprintf(scratch_pool, "%u", propcount);
         break;
       }
 
@@ -710,26 +714,46 @@ insert_prop(const dav_resource *resource
 
   if (what == DAV_PROP_INSERT_NAME
       || (what == DAV_PROP_INSERT_VALUE && *value == '\0')) {
-    s = apr_psprintf(response_pool, "<lp%d:%s/>" DEBUG_CR, global_ns,
+    s = apr_psprintf(result_pool, "<lp%d:%s/>" DEBUG_CR, global_ns,
                      info->name);
   }
   else if (what == DAV_PROP_INSERT_VALUE) {
-    s = apr_psprintf(response_pool, "<lp%d:%s>%s</lp%d:%s>" DEBUG_CR,
+    s = apr_psprintf(result_pool, "<lp%d:%s>%s</lp%d:%s>" DEBUG_CR,
                      global_ns, info->name, value, global_ns, info->name);
   }
   else {
     /* assert: what == DAV_PROP_INSERT_SUPPORTED */
-    s = apr_psprintf(response_pool,
+    s = apr_psprintf(result_pool,
                      "<D:supported-live-property D:name=\"%s\" "
                      "D:namespace=\"%s\"/>" DEBUG_CR,
                      info->name, namespace_uris[info->ns]);
   }
-  apr_text_append(response_pool, phdr, s);
+  apr_text_append(result_pool, phdr, s);
 
   /* we inserted whatever was asked for */
   return what;
 }
 
+static dav_prop_insert
+insert_prop(const dav_resource *resource,
+            int propid,
+            dav_prop_insert what,
+            apr_text_header *phdr)
+{
+  apr_pool_t *result_pool = resource->pool;
+  apr_pool_t *scratch_pool;
+  dav_prop_insert rv;
+
+  /* Create subpool and destroy on return, because mod_dav doesn't provide
+     scratch pool for insert_prop() callback. */
+  scratch_pool = svn_pool_create(result_pool);
+
+  rv = insert_prop_internal(resource, propid, what, phdr,
+                              scratch_pool, result_pool);
+
+  svn_pool_destroy(scratch_pool);
+  return rv;
+}
 
 static int
 is_writable(const dav_resource *resource, int propid)
@@ -841,8 +865,7 @@ dav_svn__insert_all_liveprops(request_re
                               apr_text_header *phdr)
 {
   const dav_liveprop_spec *spec;
-  apr_pool_t *pool;
-  apr_pool_t *subpool;
+  apr_pool_t *iterpool;
 
   /* don't insert any liveprops if this isn't "our" resource */
   if (resource->hooks != &dav_svn__hooks_repository)
@@ -859,18 +882,14 @@ dav_svn__insert_all_liveprops(request_re
       return;
     }
 
-  pool = resource->info->pool;
-  subpool = svn_pool_create(pool);
-  resource->info->pool = subpool;
-
+  iterpool = svn_pool_create(resource->pool);
   for (spec = props; spec->name != NULL; ++spec)
     {
-      svn_pool_clear(subpool);
-      (void) insert_prop(resource, spec->propid, what, phdr);
+      svn_pool_clear(iterpool);
+      (void) insert_prop_internal(resource, spec->propid, what, phdr,
+                                  iterpool, resource->pool);
     }
-
-  resource->info->pool = pool;
-  svn_pool_destroy(subpool);
+  svn_pool_destroy(iterpool);
 
   /* ### we know the others aren't defined as liveprops */
 }

Modified: subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/mod_dav_svn.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/mod_dav_svn.c Tue Jul 19 23:05:44 2011
@@ -346,10 +346,14 @@ SVNPathAuthz_cmd(cmd_parms *cmd, void *c
                                AUTHZ_SVN__SUBREQ_BYPASS_PROV_VER);
         }
     }
-  else
+  else if (apr_strnatcasecmp("on", arg1) == 0)
     {
       conf->path_authz_method = CONF_PATHAUTHZ_ON;
     }
+  else
+    {
+      return "Unrecognized value for SVNPathAuthz directive";
+    }
 
   return NULL;
 }

Modified: subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/reports/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/reports/mergeinfo.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/reports/mergeinfo.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/reports/mergeinfo.c Tue Jul 19 23:05:44 2011
@@ -213,22 +213,6 @@ dav_svn__get_mergeinfo_report(const dav_
         }
     }
 
-  if (validate_inherited_mergeinfo)
-    {
-      serr = dav_svn__brigade_puts(bb, output,
-                                   "<S:" SVN_DAV__VALIDATE_INHERITED ">"
-                                   "yes"
-                                   "</S:" SVN_DAV__VALIDATE_INHERITED ">"
-                                   DEBUG_CR);
-      if (serr)
-        {
-          derr = dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
-                                      "Error ending REPORT response.",
-                                      resource->pool);
-          goto cleanup;
-        }
-    }
-
   if ((serr = dav_svn__brigade_puts(bb, output,
                                     "</S:" SVN_DAV__MERGEINFO_REPORT ">"
                                     DEBUG_CR)))

Modified: subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/reports/update.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/reports/update.c Tue Jul 19 23:05:44 2011
@@ -295,6 +295,8 @@ add_helper(svn_boolean_t is_dir,
       const char *qname = apr_xml_quote_string(pool, child->name, 1);
       const char *elt;
       const char *real_path = get_real_fs_path(child, pool);
+      const char *bc_url_str = "";
+      const char *sha1_checksum_str = "";
 
       if (is_dir)
         {
@@ -320,36 +322,39 @@ add_helper(svn_boolean_t is_dir,
           /* make sure that the BC_URL is xml attribute safe. */
           bc_url = apr_xml_quote_string(pool, bc_url, 1);
         }
+      else
+        {
+          svn_checksum_t *sha1_checksum;
+
+          SVN_ERR(svn_fs_file_checksum(&sha1_checksum, svn_checksum_sha1,
+                                       uc->rev_root, real_path, FALSE, pool));
+          if (sha1_checksum)
+            sha1_checksum_str =
+              apr_psprintf(pool, " sha1-checksum=\"%s\"",
+                           svn_checksum_to_cstring(sha1_checksum, pool));
+        }
 
+      if (bc_url)
+        bc_url_str = apr_psprintf(pool, " bc-url=\"%s\"", bc_url);
 
       if (copyfrom_path == NULL)
         {
-          if (bc_url)
-            elt = apr_psprintf(pool, "<S:add-%s name=\"%s\" "
-                               "bc-url=\"%s\">" DEBUG_CR,
-                               DIR_OR_FILE(is_dir), qname, bc_url);
-          else
-            elt = apr_psprintf(pool, "<S:add-%s name=\"%s\">" DEBUG_CR,
-                               DIR_OR_FILE(is_dir), qname);
+          elt = apr_psprintf(pool,
+                             "<S:add-%s name=\"%s\"%s%s>" DEBUG_CR,
+                             DIR_OR_FILE(is_dir), qname, bc_url_str,
+                             sha1_checksum_str);
         }
       else
         {
           const char *qcopy = apr_xml_quote_string(pool, copyfrom_path, 1);
 
-          if (bc_url)
-            elt = apr_psprintf(pool, "<S:add-%s name=\"%s\" "
-                               "copyfrom-path=\"%s\" copyfrom-rev=\"%ld\" "
-                               "bc-url=\"%s\">" DEBUG_CR,
-                               DIR_OR_FILE(is_dir),
-                               qname, qcopy, copyfrom_revision,
-                               bc_url);
-          else
-            elt = apr_psprintf(pool, "<S:add-%s name=\"%s\" "
-                               "copyfrom-path=\"%s\""
-                               " copyfrom-rev=\"%ld\">" DEBUG_CR,
-                               DIR_OR_FILE(is_dir),
-                               qname, qcopy, copyfrom_revision);
-
+          elt = apr_psprintf(pool,
+                             "<S:add-%s name=\"%s\"%s%s "
+                             "copyfrom-path=\"%s\" copyfrom-rev=\"%ld\">"
+                             DEBUG_CR,
+                             DIR_OR_FILE(is_dir),
+                             qname, bc_url_str, sha1_checksum_str,
+                             qcopy, copyfrom_revision);
           child->copyfrom = TRUE;
         }
 
@@ -780,12 +785,26 @@ upd_close_file(void *file_baton, const c
      to fetch it. */
   if ((! file->uc->send_all) && (! file->added) && file->text_changed)
     {
+      svn_checksum_t *sha1_checksum;
+      const char *real_path = get_real_fs_path(file, pool);
+      const char *sha1_digest = NULL;
+
+      /* Try to grab the SHA1 checksum, if it's readily available, and
+         pump it down to the client, too. */
+      SVN_ERR(svn_fs_file_checksum(&sha1_checksum, svn_checksum_sha1,
+                                   file->uc->rev_root, real_path, FALSE, pool));
+      if (sha1_checksum)
+        sha1_digest = svn_checksum_to_cstring(sha1_checksum, pool);
+
       SVN_ERR(dav_svn__brigade_printf
               (file->uc->bb, file->uc->output,
-               "<S:fetch-file%s%s%s/>" DEBUG_CR,
+               "<S:fetch-file%s%s%s%s%s%s/>" DEBUG_CR,
                file->base_checksum ? " base-checksum=\"" : "",
                file->base_checksum ? file->base_checksum : "",
-               file->base_checksum ? "\"" : ""));
+               file->base_checksum ? "\"" : "",
+               sha1_digest ? " sha1-checksum=\"" : "",
+               sha1_digest ? sha1_digest : "",
+               sha1_digest ? "\"" : ""));
     }
 
   if (text_checksum)