You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/12/14 05:14:20 UTC

svn commit: r1421664 [3/4] - in /subversion/branches/in-repo-authz: ./ build/ build/ac-macros/ contrib/server-side/svncutter/ subversion/bindings/swig/ subversion/bindings/swig/python/tests/ subversion/bindings/swig/ruby/libsvn_swig_ruby/ subversion/in...

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql Fri Dec 14 04:14:09 2012
@@ -157,7 +157,7 @@ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, 
 SELECT local_relpath, kind FROM nodes n
 WHERE wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = 0
-  AND presence in ('normal', 'incomplete')
+  AND presence in (MAP_NORMAL, MAP_INCOMPLETE)
   AND NOT EXISTS(SELECT 1 FROM NODES w
                  WHERE w.wc_id = ?1 AND w.local_relpath = n.local_relpath
                    AND op_depth > 0)
@@ -168,7 +168,7 @@ SELECT local_relpath, kind, checksum, tr
 FROM nodes n
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND presence in ('normal', 'incomplete')
+  AND presence in (MAP_NORMAL, MAP_INCOMPLETE)
   AND op_depth = (SELECT MAX(op_depth)
                   FROM NODES w
                   WHERE w.wc_id = ?1
@@ -198,12 +198,12 @@ WHERE wc_id = ?1 AND IS_STRICT_DESCENDAN
                  WHERE w.wc_id = ?1
                    AND w.local_relpath = actual_node.local_relpath
                    AND op_depth > 0
-                   AND presence in ('normal', 'incomplete', 'not-present'))
+                   AND presence in (MAP_NORMAL, MAP_INCOMPLETE, MAP_NOT_PRESENT))
 
 -- STMT_DELETE_WORKING_BASE_DELETE
 DELETE FROM nodes
 WHERE wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND presence = 'base-deleted'
+  AND presence = MAP_BASE_DELETED
   AND op_depth > 0
   AND op_depth = (SELECT MIN(op_depth) FROM nodes n
                     WHERE n.wc_id = ?1
@@ -256,7 +256,7 @@ WHERE wc_id = ?1 AND parent_relpath = ?2
 -- STMT_SELECT_GE_OP_DEPTH_CHILDREN
 SELECT 1 FROM nodes
 WHERE wc_id = ?1 AND parent_relpath = ?2
-  AND (op_depth > ?3 OR (op_depth = ?3 AND presence != 'base-deleted'))
+  AND (op_depth > ?3 OR (op_depth = ?3 AND presence != MAP_BASE_DELETED))
 UNION ALL
 SELECT 1 FROM ACTUAL_NODE
 WHERE wc_id = ?1 AND parent_relpath = ?2
@@ -267,21 +267,21 @@ DELETE FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND (op_depth < ?3
-       OR (op_depth = ?3 AND presence = 'base-deleted'))
+       OR (op_depth = ?3 AND presence = MAP_BASE_DELETED))
 
 /* Get not-present descendants of a copied node. Not valid for the wc-root */
 -- STMT_SELECT_NOT_PRESENT_DESCENDANTS
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1 AND op_depth = ?3
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND presence = 'not-present'
+  AND presence = MAP_NOT_PRESENT
 
 -- STMT_COMMIT_DESCENDANT_TO_BASE
 UPDATE NODES SET op_depth = 0, repos_id = ?4, repos_path = ?5, revision = ?6,
   moved_here = NULL, moved_to = NULL, dav_cache = NULL,
-  presence = CASE presence WHEN 'normal' THEN 'normal'
-                           WHEN 'excluded' THEN 'excluded'
-                           ELSE 'not-present' END
+  presence = CASE presence WHEN MAP_NORMAL THEN MAP_NORMAL
+                           WHEN MAP_EXCLUDED THEN MAP_EXCLUDED
+                           ELSE MAP_NOT_PRESENT END
 WHERE wc_id = ?1 AND local_relpath = ?2 and op_depth = ?3
 
 -- STMT_SELECT_NODE_CHILDREN
@@ -302,11 +302,7 @@ WHERE wc_id = ?1 AND parent_relpath = ?2
        OR
        (op_depth = (SELECT MAX(op_depth) FROM nodes
                     WHERE wc_id = ?1 AND local_relpath = ?2)
-        AND presence != 'base-deleted'))
-
--- STMT_SELECT_BASE_PROPS
-SELECT properties, presence FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
+        AND presence != MAP_BASE_DELETED))
 
 -- STMT_SELECT_NODE_PROPS
 SELECT properties, presence FROM nodes
@@ -317,17 +313,6 @@ ORDER BY op_depth DESC
 SELECT properties FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2
 
--- STMT_UPDATE_NODE_BASE_PROPS
-UPDATE nodes SET properties = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
-
--- STMT_UPDATE_NODE_WORKING_PROPS
-UPDATE nodes SET properties = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2
-  AND op_depth =
-   (SELECT MAX(op_depth) FROM nodes
-    WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0)
-
 -- STMT_UPDATE_ACTUAL_PROPS
 UPDATE actual_node SET properties = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2
@@ -451,7 +436,7 @@ WHERE wc_id = ?1
   AND local_relpath = (SELECT local_relpath FROM targets_list AS t
                        WHERE wc_id = ?1
                          AND t.local_relpath = actual_node.local_relpath
-                         AND kind = 'file')
+                         AND kind = MAP_FILE)
 
 -- STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST
 UPDATE actual_node SET changelist = NULL
@@ -464,7 +449,7 @@ SELECT wc_id, local_relpath, 7, ?3
 FROM targets_list
 WHERE wc_id = ?1
   AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
-  AND kind = 'dir'
+  AND kind = MAP_DIR
 
 -- STMT_RESET_ACTUAL_WITH_CHANGELIST
 REPLACE INTO actual_node (
@@ -540,7 +525,7 @@ SELECT wc_id, local_relpath, parent_relp
 FROM nodes_current
 WHERE wc_id = ?1
   AND parent_relpath = ?2
-  AND kind = 'file'
+  AND kind = MAP_FILE
 
 -- STMT_INSERT_TARGET_DEPTH_IMMEDIATES
 INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind)
@@ -572,7 +557,7 @@ SELECT N.wc_id, N.local_relpath, N.paren
     ON A.wc_id = N.wc_id AND A.local_relpath = N.local_relpath
  WHERE N.wc_id = ?1
    AND N.parent_relpath = ?2
-   AND kind = 'file'
+   AND kind = MAP_FILE
    AND A.changelist = ?3
 
 -- STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES
@@ -641,7 +626,7 @@ DELETE FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2
   AND op_depth = (SELECT MIN(op_depth) FROM nodes
                   WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3)
-  AND presence = 'base-deleted'
+  AND presence = MAP_BASE_DELETED
 
 -- STMT_DELETE_ALL_LAYERS
 DELETE FROM nodes
@@ -672,7 +657,7 @@ WHERE wc_id = ?1
   AND (changelist IS NULL
        OR NOT EXISTS (SELECT 1 FROM nodes_current c
                       WHERE c.wc_id = ?1 AND c.local_relpath = ?2
-                        AND c.kind = 'file'))
+                        AND c.kind = MAP_FILE))
 
 -- STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE
 DELETE FROM actual_node
@@ -683,7 +668,7 @@ WHERE wc_id = ?1
        OR NOT EXISTS (SELECT 1 FROM nodes_current c
                       WHERE c.wc_id = ?1 
                         AND c.local_relpath = actual_node.local_relpath
-                        AND c.kind = 'file'))
+                        AND c.kind = MAP_FILE))
 
 -- STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST
 UPDATE actual_node
@@ -712,7 +697,7 @@ WHERE wc_id = ?1
 -- STMT_UPDATE_NODE_BASE_DEPTH
 UPDATE nodes SET depth = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
-  AND kind='dir'
+  AND kind=MAP_DIR
 
 -- STMT_UPDATE_NODE_BASE_PRESENCE
 UPDATE nodes SET presence = ?3
@@ -834,20 +819,20 @@ VALUES (?1, ?2, 0,
 INSERT OR REPLACE INTO nodes (
     wc_id, local_relpath, op_depth,
     parent_relpath, presence, kind)
-VALUES(?1, ?2, ?3, ?4, 'base-deleted', ?5)
+VALUES(?1, ?2, ?3, ?4, MAP_BASE_DELETED, ?5)
 
 /* If this query is updated, STMT_INSERT_DELETE_LIST should too. */
 -- STMT_INSERT_DELETE_FROM_NODE_RECURSIVE
 INSERT INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
-SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, 'base-deleted',
+SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, MAP_BASE_DELETED,
        kind
 FROM nodes
 WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = ?3
-  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'server-excluded')
+  AND presence NOT IN (MAP_BASE_DELETED, MAP_NOT_PRESENT, MAP_EXCLUDED, MAP_SERVER_EXCLUDED)
 
 -- STMT_INSERT_WORKING_NODE_FROM_BASE_COPY
 INSERT INTO nodes (
@@ -866,7 +851,7 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 INSERT INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
 SELECT wc_id, local_relpath, ?3 /*op_depth*/, parent_relpath,
-    'base-deleted', kind
+    MAP_BASE_DELETED, kind
 FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
 
@@ -885,7 +870,7 @@ LIMIT 1
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND op_depth = 0 AND presence = 'server-excluded'
+  AND op_depth = 0 AND presence = MAP_SERVER_EXCLUDED
 LIMIT 1
 
 /* Select all excluded nodes. Not valid on the WC-root */
@@ -894,7 +879,7 @@ SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = 0
-  AND (presence = 'server-excluded' OR presence = 'excluded')
+  AND (presence = MAP_SERVER_EXCLUDED OR presence = MAP_EXCLUDED)
 
 /* Creates a copy from one top level NODE to a different location */
 -- STMT_INSERT_WORKING_NODE_COPY_FROM
@@ -969,7 +954,7 @@ WHERE wc_id = ?1
 DELETE FROM externals
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND kind != 'dir'
+  AND kind != MAP_DIR
 
 -- STMT_DELETE_EXTERNAL_REGISTATIONS
 DELETE FROM externals
@@ -1032,7 +1017,7 @@ WHERE wc_id = ?1 AND local_relpath = ?2
  * WHERE wc_id = ?1
  *   AND (local_relpath = ?2
  *        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
- *   AND kind = 'dir' AND presence IN ('normal', 'incomplete')
+ *   AND kind = MAP_DIR AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
  * ### But it would take a double table scan execution plan for it.
  * ### Maybe there is something else going on? */
 SELECT IFNULL((SELECT properties FROM actual_node a
@@ -1041,7 +1026,7 @@ SELECT IFNULL((SELECT properties FROM ac
        local_relpath, depth
 FROM nodes_current n
 WHERE wc_id = ?1 AND local_relpath = ?2
-  AND kind = 'dir' AND presence IN ('normal', 'incomplete')
+  AND kind = MAP_DIR AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
 UNION ALL
 SELECT IFNULL((SELECT properties FROM actual_node a
                WHERE a.wc_id = ?1 AND A.local_relpath = n.local_relpath),
@@ -1049,7 +1034,7 @@ SELECT IFNULL((SELECT properties FROM ac
        local_relpath, depth
 FROM nodes_current n
 WHERE wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND kind = 'dir' AND presence IN ('normal', 'incomplete')
+  AND kind = MAP_DIR AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
 
 -- STMT_SELECT_CURRENT_PROPS_RECURSIVE
 /* ### Ugly OR to make sqlite use the proper optimizations */
@@ -1087,16 +1072,12 @@ VALUES (?1, ?2, ?3, ?4)
 
 -- STMT_SELECT_ALL_FILES
 SELECT local_relpath FROM nodes_current
-WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = 'file'
+WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = MAP_FILE
 
 -- STMT_UPDATE_NODE_PROPS
 UPDATE nodes SET properties = ?4
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
 
--- STMT_HAS_WORKING_NODES
-SELECT 1 FROM nodes WHERE op_depth > 0
-LIMIT 1
-
 /* --------------------------------------------------------------------------
  * Complex queries for callback walks, caching results in a temporary table.
  *
@@ -1125,13 +1106,13 @@ INSERT INTO target_prop_cache(local_relp
    JOIN nodes_current AS n ON t.wc_id= n.wc_id
                           AND t.local_relpath = n.local_relpath
   WHERE t.wc_id = ?1
-    AND (presence='normal' OR presence='incomplete')
+    AND (presence=MAP_NORMAL OR presence=MAP_INCOMPLETE)
 
 -- STMT_CACHE_TARGET_PRISTINE_PROPS
 INSERT INTO target_prop_cache(local_relpath, kind, properties)
  SELECT n.local_relpath, n.kind,
         CASE n.presence
-          WHEN 'base-deleted'
+          WHEN MAP_BASE_DELETED
           THEN (SELECT properties FROM nodes AS p
                  WHERE p.wc_id = n.wc_id
                    AND p.local_relpath = n.local_relpath
@@ -1142,9 +1123,9 @@ INSERT INTO target_prop_cache(local_relp
   JOIN nodes_current AS n ON t.wc_id= n.wc_id
                           AND t.local_relpath = n.local_relpath
   WHERE t.wc_id = ?1
-    AND (presence = 'normal'
-         OR presence = 'incomplete'
-         OR presence = 'base-deleted')
+    AND (presence = MAP_NORMAL
+         OR presence = MAP_INCOMPLETE
+         OR presence = MAP_BASE_DELETED)
 
 -- STMT_SELECT_ALL_TARGET_PROP_CACHE
 SELECT local_relpath, properties FROM target_prop_cache
@@ -1267,7 +1248,7 @@ WHERE wc_id = ?1
   AND op_depth = (SELECT MAX(s.op_depth) FROM nodes AS s
                   WHERE s.wc_id = ?1
                     AND s.local_relpath = n.local_relpath)
-  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'server-excluded')
+  AND presence NOT IN (MAP_BASE_DELETED, MAP_NOT_PRESENT, MAP_EXCLUDED, MAP_SERVER_EXCLUDED)
 
 -- STMT_SELECT_DELETE_LIST
 SELECT local_relpath FROM delete_list
@@ -1287,7 +1268,7 @@ SELECT MIN(revision), MAX(revision),
   WHERE wc_id = ?1
     AND (local_relpath = ?2
          OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
-    AND presence IN ('normal', 'incomplete')
+    AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
     AND file_external IS NULL
     AND op_depth = 0
 
@@ -1297,8 +1278,8 @@ WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = 0
-  AND (presence IN ('server-excluded', 'excluded')
-        OR depth NOT IN ('infinity', 'unknown'))
+  AND (presence IN (MAP_SERVER_EXCLUDED, MAP_EXCLUDED)
+        OR depth NOT IN (MAP_DEPTH_INFINITY, MAP_DEPTH_UNKNOWN))
   AND file_external IS NULL
 LIMIT 1
 
@@ -1393,8 +1374,8 @@ WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = 0
-  AND kind='file'
-  AND presence='normal'
+  AND kind=MAP_FILE
+  AND presence=MAP_NORMAL
   AND file_external IS NULL
 
 /* ### FIXME: op-depth?  What about multiple moves? */

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c Fri Dec 14 04:14:09 2012
@@ -46,6 +46,7 @@
 #include "conflicts.h"
 #include "wc_db_private.h"
 #include "workqueue.h"
+#include "token-map.h"
 
 #include "svn_private_config.h"
 #include "private/svn_sqlite.h"
@@ -269,27 +270,6 @@ typedef struct insert_external_baton_t {
 } insert_external_baton_t;
 
 
-static const svn_token_map_t kind_map[] = {
-  { "file", svn_kind_file },
-  { "dir", svn_kind_dir },
-  { "symlink", svn_kind_symlink },
-  { "unknown", svn_kind_unknown },
-  { NULL }
-};
-
-/* Note: we only decode presence values from the database. These are a subset
-   of all the status values. */
-static const svn_token_map_t presence_map[] = {
-  { "normal", svn_wc__db_status_normal },
-  { "server-excluded", svn_wc__db_status_server_excluded },
-  { "excluded", svn_wc__db_status_excluded },
-  { "not-present", svn_wc__db_status_not_present },
-  { "incomplete", svn_wc__db_status_incomplete },
-  { "base-deleted", svn_wc__db_status_base_deleted },
-  { NULL }
-};
-
-
 /* Forward declarations  */
 static svn_error_t *
 add_work_items(svn_sqlite__db_t *sdb,
@@ -304,12 +284,6 @@ set_actual_props(apr_int64_t wc_id,
                  apr_pool_t *scratch_pool);
 
 static svn_error_t *
-mark_conflict(svn_wc__db_wcroot_t *wcroot,
-              const char *local_relpath,
-              const svn_skel_t *conflict_skel,
-              apr_pool_t *scratch_pool);
-
-static svn_error_t *
 insert_incomplete_children(svn_sqlite__db_t *sdb,
                            apr_int64_t wc_id,
                            const char *local_relpath,
@@ -497,11 +471,11 @@ fetch_repos_info(const char **repos_root
 }
 
 
-/* Set *REPOS_ID, *REVISION and *REPOS_RELPATH from the
-   given columns of the SQLITE statement STMT, or to NULL if the respective
+/* Set *REPOS_ID, *REVISION and *REPOS_RELPATH from the given columns of the
+   SQLITE statement STMT, or to NULL/SVN_INVALID_REVNUM if the respective
    column value is null.  Any of the output parameters may be NULL if not
    required.  */
-static svn_error_t *
+static void
 repos_location_from_columns(apr_int64_t *repos_id,
                             svn_revnum_t *revision,
                             const char **repos_relpath,
@@ -511,8 +485,6 @@ repos_location_from_columns(apr_int64_t 
                             int col_repos_relpath,
                             apr_pool_t *result_pool)
 {
-  svn_error_t *err = SVN_NO_ERROR;
-
   if (repos_id)
     {
       /* Fetch repository information via REPOS_ID. */
@@ -530,8 +502,6 @@ repos_location_from_columns(apr_int64_t 
       *repos_relpath = svn_sqlite__column_text(stmt, col_repos_relpath,
                                                result_pool);
     }
-
-  return err;
 }
 
 
@@ -777,7 +747,7 @@ insert_base_node(void *baton,
                             pibb->revision,
                             presence_map, pibb->status, /* 8 */
                             (pibb->kind == svn_kind_dir) ? /* 9 */
-                               svn_depth_to_word(pibb->depth) : NULL,
+                             svn_token__to_word(depth_map, pibb->depth) : NULL,
                             kind_map, pibb->kind, /* 10 */
                             pibb->changed_rev,    /* 11 */
                             pibb->changed_date,   /* 12 */
@@ -805,6 +775,10 @@ insert_base_node(void *baton,
         }
     }
 
+  /* Set properties.  Must be null if presence not normal or incomplete. */
+  assert(pibb->status == svn_wc__db_status_normal
+         || pibb->status == svn_wc__db_status_incomplete
+         || pibb->props == NULL);
   SVN_ERR(svn_sqlite__bind_properties(stmt, 15, pibb->props,
                                       scratch_pool));
 
@@ -893,7 +867,8 @@ insert_base_node(void *baton,
 
   SVN_ERR(add_work_items(wcroot->sdb, pibb->work_items, scratch_pool));
   if (pibb->conflict)
-    SVN_ERR(mark_conflict(wcroot, local_relpath, pibb->conflict, scratch_pool));
+    SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                              pibb->conflict, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1031,7 +1006,7 @@ insert_working_node(void *baton,
                 parent_relpath,
                 presence_map, piwb->presence,
                 (piwb->kind == svn_kind_dir)
-                            ? svn_depth_to_word(piwb->depth) : NULL,
+                            ? svn_token__to_word(depth_map, piwb->depth) : NULL,
                 kind_map, piwb->kind,
                 piwb->changed_rev,
                 piwb->changed_date,
@@ -1054,6 +1029,10 @@ insert_working_node(void *baton,
       SVN_ERR(svn_sqlite__bind_revnum(stmt, 7, piwb->original_revnum));
     }
 
+  /* Set properties.  Must be null if presence not normal or incomplete. */
+  assert(piwb->presence == svn_wc__db_status_normal
+         || piwb->presence == svn_wc__db_status_incomplete
+         || piwb->props == NULL);
   SVN_ERR(svn_sqlite__bind_properties(stmt, 15, piwb->props, scratch_pool));
 
   SVN_ERR(svn_sqlite__insert(NULL, stmt));
@@ -1131,8 +1110,8 @@ insert_working_node(void *baton,
 
   SVN_ERR(add_work_items(wcroot->sdb, piwb->work_items, scratch_pool));
   if (piwb->conflict)
-    SVN_ERR(mark_conflict(wcroot, local_relpath, piwb->conflict,
-                          scratch_pool));
+    SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                              piwb->conflict, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1500,7 +1479,8 @@ init_db(void *baton,
                                 idb->root_node_repos_relpath,
                                 idb->root_node_revision,
                                 presence_map, status, /* 8 */
-                                svn_depth_to_word(idb->root_node_depth),
+                                svn_token__to_word(depth_map,
+                                                   idb->root_node_depth),
                                 kind_map, svn_kind_dir /* 10 */));
 
       SVN_ERR(svn_sqlite__insert(NULL, stmt));
@@ -2322,7 +2302,8 @@ db_base_remove(void *baton,
 
   SVN_ERR(add_work_items(wcroot->sdb, rb->work_items, scratch_pool));
   if (rb->conflict)
-    SVN_ERR(mark_conflict(wcroot, local_relpath, rb->conflict, scratch_pool));
+    SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                              rb->conflict, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2410,8 +2391,8 @@ svn_wc__db_base_get_info_internal(svn_wc
         {
           *status = node_status;
         }
-      err = repos_location_from_columns(repos_id, revision, repos_relpath,
-                                        stmt, 0, 4, 1, result_pool);
+      repos_location_from_columns(repos_id, revision, repos_relpath,
+                                  stmt, 0, 4, 1, result_pool);
       SVN_ERR_ASSERT(!repos_id || *repos_id != INVALID_REPOS_ID);
       SVN_ERR_ASSERT(!repos_relpath || *repos_relpath);
       if (lock)
@@ -2439,12 +2420,8 @@ svn_wc__db_base_get_info_internal(svn_wc
             }
           else
             {
-              const char *depth_str = svn_sqlite__column_text(stmt, 10, NULL);
-
-              if (depth_str == NULL)
-                *depth = svn_depth_unknown;
-              else
-                *depth = svn_depth_from_word(depth_str);
+              *depth = svn_sqlite__column_token_null(stmt, 10, depth_map,
+                                                     svn_depth_unknown);
             }
         }
       if (checksum)
@@ -2478,11 +2455,19 @@ svn_wc__db_base_get_info_internal(svn_wc
         }
       if (props)
         {
-          SVN_ERR(svn_sqlite__column_properties(props, stmt, 13,
-                                                result_pool, scratch_pool));
-          /* Column should be non-null if status is 'normal'. */
-          /* ### Except for a bug: see body of svn_wc__db_base_get_props(). */
-          assert(*props || node_status != svn_wc__db_status_normal);
+          if (node_status == svn_wc__db_status_normal
+              || node_status == svn_wc__db_status_incomplete)
+            {
+              SVN_ERR(svn_sqlite__column_properties(props, stmt, 13,
+                                                    result_pool, scratch_pool));
+              if (*props == NULL)
+                *props = apr_hash_make(result_pool);
+            }
+          else
+            {
+              assert(svn_sqlite__column_is_null(stmt, 13));
+              *props = NULL;
+            }
         }
       if (update_root)
         {
@@ -2581,7 +2566,6 @@ svn_wc__db_base_get_children_info(apr_ha
       struct svn_wc__db_base_info_t *info;
       svn_error_t *err;
       apr_int64_t repos_id;
-      const char *depth_str;
       const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
       const char *name = svn_relpath_basename(child_relpath, result_pool);
 
@@ -2593,10 +2577,8 @@ svn_wc__db_base_get_children_info(apr_ha
       info->kind = svn_sqlite__column_token(stmt, 4, kind_map);
       info->revnum = svn_sqlite__column_revnum(stmt, 5);
 
-      depth_str = svn_sqlite__column_text(stmt, 6, NULL);
-
-      info->depth = (depth_str != NULL) ? svn_depth_from_word(depth_str)
-                                        : svn_depth_unknown;
+      info->depth = svn_sqlite__column_token_null(stmt, 6, depth_map,
+                                                  svn_depth_unknown);
 
       info->update_root = svn_sqlite__column_boolean(stmt, 7);
 
@@ -2629,53 +2611,24 @@ svn_wc__db_base_get_props(apr_hash_t **p
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool)
 {
-  svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
-  svn_error_t *err;
+  svn_wc__db_status_t presence;
 
-  SVN_ERR(get_statement_for_path(&stmt, db, local_abspath,
-                                 STMT_SELECT_BASE_PROPS, scratch_pool));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  if (!have_row)
+  SVN_ERR(svn_wc__db_base_get_info(&presence, NULL, NULL, NULL, NULL,
+                                   NULL, NULL, NULL, NULL, NULL,
+                                   NULL, NULL, NULL, NULL, props, NULL,
+                                   db, local_abspath,
+                                   result_pool, scratch_pool));
+  if (presence != svn_wc__db_status_normal
+      && presence != svn_wc__db_status_incomplete)
     {
-      err = svn_sqlite__reset(stmt);
-      return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, err,
-                               _("The node '%s' was not found."),
+      return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                               _("The node '%s' has a BASE status that"
+                                  " has no properties."),
                                svn_dirent_local_style(local_abspath,
                                                       scratch_pool));
     }
 
-  err = svn_sqlite__column_properties(props, stmt, 0, result_pool,
-                                      scratch_pool);
-  if (err == NULL && *props == NULL)
-    {
-      svn_wc__db_status_t presence;
-      presence = svn_sqlite__column_token(stmt, 1, presence_map);
-
-      if (presence == svn_wc__db_status_normal
-          || presence == svn_wc__db_status_incomplete)
-        {
-          /* ### is this a DB constraint violation? the column "probably" should
-             ### never be null in this case.
-
-             ### Reproducable via:
-             ###   touch f; svn wc add f; svn ci -mm
-             ###   sqlite3 .svn/wc.db "select local_relpath, properties from nodes"
-           */
-          *props = apr_hash_make(result_pool);
-        }
-      else
-        {
-          err = svn_sqlite__reset(stmt);
-          return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, err,
-                                   _("The node '%s' has a BASE status that"
-                                      " has no properties."),
-                                   svn_dirent_local_style(local_abspath,
-                                                          scratch_pool));
-        }
-    }
-
-  return svn_error_compose_create(err, svn_sqlite__reset(stmt));
+  return SVN_NO_ERROR;
 }
 
 
@@ -2824,8 +2777,8 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
           if (op_depth > 0)
             SVN_ERR(convert_to_working_status(status, *status));
         }
-      err = repos_location_from_columns(repos_id, revision, repos_relpath,
-                                        stmt, 0, 4, 1, result_pool);
+      repos_location_from_columns(repos_id, revision, repos_relpath,
+                                  stmt, 0, 4, 1, result_pool);
 
       if (changed_rev)
         {
@@ -2848,12 +2801,8 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
             }
           else
             {
-              const char *depth_str = svn_sqlite__column_text(stmt, 10, NULL);
-
-              if (depth_str == NULL)
-                *depth = svn_depth_unknown;
-              else
-                *depth = svn_depth_from_word(depth_str);
+              *depth = svn_sqlite__column_token_null(stmt, 10, depth_map,
+                                                     svn_depth_unknown);
             }
         }
       if (checksum)
@@ -2887,11 +2836,19 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
         }
       if (props)
         {
-          SVN_ERR(svn_sqlite__column_properties(props, stmt, 13,
-                                                result_pool, scratch_pool));
-          /* Column should be non-null if status is 'normal' */
-          /* ### Except for a bug: see body of svn_wc__db_base_get_props(). */
-          assert(*props || node_status != svn_wc__db_status_normal);
+          if (node_status == svn_wc__db_status_normal
+              || node_status == svn_wc__db_status_incomplete)
+            {
+              SVN_ERR(svn_sqlite__column_properties(props, stmt, 13,
+                                                    result_pool, scratch_pool));
+              if (*props == NULL)
+                *props = apr_hash_make(result_pool);
+            }
+          else
+            {
+              assert(svn_sqlite__column_is_null(stmt, 13));
+              *props = NULL;
+            }
         }
     }
   else
@@ -3667,15 +3624,14 @@ svn_wc__db_externals_gather_definitions(
 
           if (depths)
             {
-              const char *depth_word = svn_sqlite__column_text(stmt, 2, NULL);
-              svn_depth_t depth = svn_depth_unknown;
-
-              if (depth_word)
-                depth = svn_depth_from_word(depth_word);
+              svn_depth_t depth
+                = svn_sqlite__column_token_null(stmt, 2, depth_map,
+                                                svn_depth_unknown);
 
               apr_hash_set(*depths, node_abspath,
                            APR_HASH_KEY_STRING,
-                           svn_depth_to_word(depth)); /* Use static string */
+                           svn_token__to_word(depth_map,
+                                              depth)); /* Use static string */
             }
         }
 
@@ -5236,7 +5192,8 @@ set_props_txn(void *baton,
   /* And finally.  */
   SVN_ERR(add_work_items(wcroot->sdb, spb->work_items, scratch_pool));
   if (spb->conflict)
-    SVN_ERR(mark_conflict(wcroot, local_relpath, spb->conflict, scratch_pool));
+    SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                              spb->conflict, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -5272,67 +5229,6 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
 }
 
 
-#ifdef SVN__SUPPORT_BASE_MERGE
-
-/* Set properties in a given table. The row must exist.  */
-static svn_error_t *
-set_properties(svn_wc__db_t *db,
-               const char *local_abspath,
-               const apr_hash_t *props,
-               int stmt_idx,
-               const char *table_name,
-               apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  int affected_rows;
-
-  SVN_ERR_ASSERT(props != NULL);
-
-  SVN_ERR(get_statement_for_path(&stmt, db, local_abspath, stmt_idx,
-                                 scratch_pool));
-
-  SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
-  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
-
-  if (affected_rows != 1)
-    return svn_error_createf(SVN_ERR_WC_DB_ERROR, NULL,
-                             _("Can't store properties for '%s' in '%s'."),
-                             svn_dirent_local_style(local_abspath,
-                                                    scratch_pool),
-                             table_name);
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_temp_base_set_props(svn_wc__db_t *db,
-                               const char *local_abspath,
-                               const apr_hash_t *props,
-                               apr_pool_t *scratch_pool)
-{
-  SVN_ERR(set_properties(db, local_abspath, props,
-                         STMT_UPDATE_NODE_BASE_PROPS,
-                         "base node", scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_temp_working_set_props(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  const apr_hash_t *props,
-                                  apr_pool_t *scratch_pool)
-{
-  SVN_ERR(set_properties(db, local_abspath, props,
-                         STMT_UPDATE_NODE_WORKING_PROPS,
-                         "working node", scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-#endif /* SVN__SUPPORT_BASE_MERGE  */
-
-
 svn_error_t *
 svn_wc__db_op_modified(svn_wc__db_t *db,
                        const char *local_abspath,
@@ -5666,11 +5562,11 @@ svn_wc__db_op_set_changelist(svn_wc__db_
 }
 
 /* Implementation of svn_wc__db_op_mark_conflict() */
-static svn_error_t *
-mark_conflict(svn_wc__db_wcroot_t *wcroot,
-              const char *local_relpath,
-              const svn_skel_t *conflict_skel,
-              apr_pool_t *scratch_pool)
+svn_error_t *
+svn_wc__db_mark_conflict_internal(svn_wc__db_wcroot_t *wcroot,
+                                  const char *local_relpath,
+                                  const svn_skel_t *conflict_skel,
+                                  apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t got_row;
@@ -5729,7 +5625,8 @@ svn_wc__db_op_mark_conflict(svn_wc__db_t
                               local_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(mark_conflict(wcroot, local_relpath, conflict_skel, scratch_pool));
+  SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                            conflict_skel, scratch_pool));
 
   /* ### Should be handled in the same transaction as setting the conflict */
   if (work_items)
@@ -6187,7 +6084,7 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
 /* Baton for passing args to revert_list_read(). */
 struct revert_list_read_baton {
   svn_boolean_t *reverted;
-  apr_array_header_t *marker_paths;
+  const apr_array_header_t *marker_paths;
   svn_boolean_t *copied_here;
   svn_kind_t *kind;
   apr_pool_t *result_pool;
@@ -6230,18 +6127,15 @@ revert_list_read(void *baton,
                                                   scratch_pool);
           if (conflict_data)
             {
-              const apr_array_header_t *marker_paths;
               svn_skel_t *conflicts = svn_skel__parse(conflict_data,
                                                       conflict_len,
                                                       scratch_pool);
 
-              SVN_ERR(svn_wc__conflict_read_markers(&marker_paths,
+              SVN_ERR(svn_wc__conflict_read_markers(&b->marker_paths,
                                                     b->db, wcroot->abspath,
                                                     conflicts,
                                                     b->result_pool,
                                                     scratch_pool));
-              /* De-const-ify. */
-              b->marker_paths = (apr_array_header_t *)marker_paths;
             }
 
           if (!svn_sqlite__column_is_null(stmt, 1)) /* notify */
@@ -6712,7 +6606,8 @@ remove_node_txn(void *baton,
 
   SVN_ERR(add_work_items(wcroot->sdb, rnb->work_items, scratch_pool));
   if (rnb->conflict)
-    SVN_ERR(mark_conflict(wcroot, local_relpath, rnb->conflict, scratch_pool));
+    SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                              rnb->conflict, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -6788,7 +6683,7 @@ db_op_set_base_depth(void *baton,
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_UPDATE_NODE_BASE_DEPTH));
   SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, local_relpath,
-                                         svn_depth_to_word(sbd->depth)));
+                            svn_token__to_word(depth_map, sbd->depth)));
   SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
 
   if (affected_rows == 0)
@@ -7337,7 +7232,8 @@ delete_node(void *baton,
 
   SVN_ERR(add_work_items(wcroot->sdb, b->work_items, scratch_pool));
   if (b->conflict)
-    SVN_ERR(mark_conflict(wcroot, local_relpath, b->conflict, scratch_pool));
+    SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                              b->conflict, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -7696,9 +7592,8 @@ read_info(svn_wc__db_status_t *status,
              WORKING_NODE (and have been added), then the repository
              we're being added to will be dependent upon a parent. The
              caller can scan upwards to locate the repository.  */
-          err = svn_error_compose_create(
-            err, repos_location_from_columns(repos_id, revision, repos_relpath,
-                                             stmt_info, 1, 5, 2, result_pool));
+          repos_location_from_columns(repos_id, revision, repos_relpath,
+                                      stmt_info, 1, 5, 2, result_pool);
         }
       if (changed_rev)
         {
@@ -7725,14 +7620,8 @@ read_info(svn_wc__db_status_t *status,
             }
           else
             {
-              const char *depth_str;
-
-              depth_str = svn_sqlite__column_text(stmt_info, 11, NULL);
-
-              if (depth_str == NULL)
-                *depth = svn_depth_unknown;
-              else
-                *depth = svn_depth_from_word(depth_str);
+              *depth = svn_sqlite__column_token_null(stmt_info, 11, depth_map,
+                                                     svn_depth_unknown);
             }
         }
       if (checksum)
@@ -7778,11 +7667,10 @@ read_info(svn_wc__db_status_t *status,
         }
       else
         {
-          err = svn_error_compose_create(
-            err, repos_location_from_columns(original_repos_id,
-                                             original_revision,
-                                             original_repos_relpath,
-                                             stmt_info, 1, 5, 2, result_pool));
+          repos_location_from_columns(original_repos_id,
+                                      original_revision,
+                                      original_repos_relpath,
+                                      stmt_info, 1, 5, 2, result_pool);
         }
       if (props_mod)
         {
@@ -8187,13 +8075,8 @@ read_children_info(void *baton,
             child->depth = svn_depth_unknown;
           else
             {
-              const char *depth = svn_sqlite__column_text(stmt, 11,
-                                                          scratch_pool);
-              if (depth)
-                child->depth = svn_depth_from_word(depth);
-              else
-                child->depth = svn_depth_unknown;
-
+              child->depth = svn_sqlite__column_token_null(stmt, 11, depth_map,
+                                                           svn_depth_unknown);
               if (new_child)
                 SVN_ERR(is_wclocked(&child->locked, wcroot, child_relpath,
                                     scratch_pool));
@@ -8444,14 +8327,8 @@ svn_wc__db_read_pristine_info(svn_wc__db
         }
       else
         {
-          const char *depth_str;
-
-          depth_str = svn_sqlite__column_text(stmt, 11, NULL);
-
-          if (depth_str == NULL)
-            *depth = svn_depth_unknown;
-          else
-            *depth = svn_depth_from_word(depth_str);
+          *depth = svn_sqlite__column_token_null(stmt, 11, depth_map,
+                                                 svn_depth_unknown);
         }
     }
   if (checksum)
@@ -8493,11 +8370,19 @@ svn_wc__db_read_pristine_info(svn_wc__db
     }
   if (props)
     {
-      SVN_ERR(svn_sqlite__column_properties(props, stmt, 14,
-                                            result_pool, scratch_pool));
-      /* Column should be non-null if status is 'normal' */
-      /* ### Except for a bug: see body of svn_wc__db_base_get_props(). */
-      assert(*props || raw_status != svn_wc__db_status_normal);
+      if (raw_status == svn_wc__db_status_normal
+          || raw_status == svn_wc__db_status_incomplete)
+        {
+          SVN_ERR(svn_sqlite__column_properties(props, stmt, 14,
+                                                result_pool, scratch_pool));
+          if (*props == NULL)
+            *props = apr_hash_make(result_pool);
+        }
+      else
+        {
+          assert(svn_sqlite__column_is_null(stmt, 14));
+          *props = NULL;
+        }
     }
 
   return svn_error_trace(
@@ -8613,8 +8498,13 @@ svn_wc__db_read_node_install_info(const 
         err = svn_sqlite__column_checksum(sha1_checksum, stmt, 6, result_pool);
 
       if (!err && pristine_props)
-        err = svn_sqlite__column_properties(pristine_props, stmt, 14,
-                                            result_pool, scratch_pool);
+        {
+          err = svn_sqlite__column_properties(pristine_props, stmt, 14,
+                                              result_pool, scratch_pool);
+          /* Null means no props (assuming presence normal or incomplete). */
+          if (*pristine_props == NULL)
+            *pristine_props = apr_hash_make(result_pool);
+        }
 
       if (changed_date)
         *changed_date = svn_sqlite__column_int64(stmt, 9);
@@ -13792,7 +13682,8 @@ make_copy_txn(void *baton,
                                                 svn_depth_empty, iterpool));
 
   if (mcb->conflicts)
-    SVN_ERR(mark_conflict(wcroot, local_relpath, mcb->conflicts, iterpool));
+    SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                              mcb->conflicts, iterpool));
 
   SVN_ERR(add_work_items(wcroot->sdb, mcb->work_items, iterpool));
 

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h Fri Dec 14 04:14:09 2012
@@ -807,7 +807,8 @@ svn_wc__db_base_get_children_info(apr_ha
    *PROPS maps "const char *" names to "const svn_string_t *" values.
    If the node has no properties, set *PROPS to an empty hash.
    *PROPS will never be set to NULL.
-   If the node is not present in the BASE tree, return an error.
+   If the node is not present in the BASE tree (with presence 'normal'
+   or 'incomplete'), return an error.
    Allocate *PROPS and its keys and values in RESULT_POOL.
 */
 svn_error_t *
@@ -1444,42 +1445,6 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
                         const svn_skel_t *work_items,
                         apr_pool_t *scratch_pool);
 
-/* See props.h  */
-#ifdef SVN__SUPPORT_BASE_MERGE
-/* ### Set the properties of the node LOCAL_ABSPATH in the BASE tree to PROPS.
-   ###
-   ### This function should not exist because properties should be stored
-   ### onto the BASE node at construction time, in a single atomic operation.
-   ###
-   ### PROPS maps "const char *" names to "const svn_string_t *" values.
-   ### To specify no properties, PROPS must be an empty hash, not NULL.
-   ### If the node is not present, SVN_ERR_WC_PATH_NOT_FOUND is returned.
-*/
-svn_error_t *
-svn_wc__db_temp_base_set_props(svn_wc__db_t *db,
-                               const char *local_abspath,
-                               const apr_hash_t *props,
-                               apr_pool_t *scratch_pool);
-
-
-/* ### Set the properties of the node LOCAL_ABSPATH in the WORKING tree
-   ### to PROPS.
-   ###
-   ### This function should not exist because properties should be stored
-   ### onto the WORKING node at construction time, in a single atomic
-   ### operation.
-   ###
-   ### PROPS maps "const char *" names to "const svn_string_t *" values.
-   ### To specify no properties, PROPS must be an empty hash, not NULL.
-   ### If the node is not present, SVN_ERR_WC_PATH_NOT_FOUND is returned.
-*/
-svn_error_t *
-svn_wc__db_temp_working_set_props(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  const apr_hash_t *props,
-                                  apr_pool_t *scratch_pool);
-#endif
-
 /* Mark LOCAL_ABSPATH, and all children, for deletion.
  *
  * This function removes the file externals (and if DELETE_DIR_EXTERNALS is
@@ -2070,11 +2035,8 @@ svn_wc__db_read_props(apr_hash_t **props
  * a hash table mapping <tt>char *</tt> names onto svn_string_t *
  * values for any properties of child nodes of LOCAL_ABSPATH (up to DEPTH).
  *
- * If BASE_PROPS is FALSE, read the properties from the WORKING layer (highest
- * op_depth).
- *
- * If BASE_PROPS is FALSE and, PRISTINE is TRUE, the local modifications will
- * be suppressed. If PRISTINE is FALSE, local modifications will be visible.
+ * If PRISTINE is FALSE, read the properties from the WORKING layer (highest
+ * op_depth); if PRISTINE is FALSE, local modifications will be visible.
  */
 svn_error_t *
 svn_wc__db_read_props_streamily(svn_wc__db_t *db,

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h Fri Dec 14 04:14:09 2012
@@ -304,6 +304,14 @@ svn_wc__db_read_conflict_internal(svn_sk
                                   apr_pool_t *result_pool,
                                   apr_pool_t *scratch_pool);
 
+/* Like svn_wc__db_op_mark_conflict(), but with WCROOT+LOCAL_RELPATH instead of
+   DB+LOCAL_ABSPATH. */
+svn_error_t *
+svn_wc__db_mark_conflict_internal(svn_wc__db_wcroot_t *wcroot,
+                                  const char *local_relpath,
+                                  const svn_skel_t *conflict_skel,
+                                  apr_pool_t *scratch_pool);
+
 
 /* Transaction handling */
 

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c Fri Dec 14 04:14:09 2012
@@ -38,6 +38,7 @@
 #include "svn_dirent_uri.h"
 #include "svn_editor.h"
 #include "svn_error.h"
+#include "svn_hash.h"
 #include "svn_wc.h"
 #include "svn_props.h"
 #include "svn_pools.h"
@@ -82,7 +83,15 @@ tc_editor_add_directory(void *baton,
                         svn_revnum_t replaces_rev,
                         apr_pool_t *scratch_pool)
 {
-  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL, NULL);
+  struct tc_editor_baton *b = baton;
+  int op_depth = relpath_depth(b->move_root_dst_relpath);
+
+  SVN_ERR(svn_wc__db_extend_parent_delete(b->wcroot, relpath, svn_kind_dir,
+                                          op_depth, scratch_pool));
+
+  /* ### TODO check for, and flag, tree conflict */
+
+  return SVN_NO_ERROR;
 }
 
 static svn_error_t *
@@ -126,15 +135,88 @@ tc_editor_add_absent(void *baton,
   return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL, NULL);
 }
 
+/* All the info we need about one version of a working node. */
+typedef struct working_node_version_t
+{
+  svn_wc_conflict_version_t *location_and_kind;
+  apr_hash_t *props;
+  const svn_checksum_t *checksum; /* for files only */
+} working_node_version_t;
+
 static svn_error_t *
-tc_editor_alter_directory(void *baton,
-                          const char *relpath,
-                          svn_revnum_t revision,
-                          const apr_array_header_t *children,
-                          apr_hash_t *props,
-                          apr_pool_t *scratch_pool)
+create_conflict_markers(svn_skel_t **work_items,
+                        const char *local_abspath,
+                        svn_wc__db_t *db,
+                        const char *repos_relpath,
+                        svn_skel_t *conflict_skel,
+                        const working_node_version_t *old_version,
+                        const working_node_version_t *new_version,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
 {
-  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL, NULL);
+  svn_skel_t *work_item;
+  svn_wc_conflict_version_t *original_version;
+
+  original_version = svn_wc_conflict_version_dup(
+                       old_version->location_and_kind, scratch_pool);
+  original_version->path_in_repos = repos_relpath;
+  original_version->node_kind = svn_node_file;
+  SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict_skel,
+                                              original_version,
+                                              scratch_pool,
+                                              scratch_pool));
+  /* According to this func's doc string, it is "Currently only used for
+   * property conflicts as text conflict markers are just in-wc files." */
+  SVN_ERR(svn_wc__conflict_create_markers(&work_item, db,
+                                          local_abspath,
+                                          conflict_skel,
+                                          scratch_pool,
+                                          scratch_pool));
+  *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+update_working_props(svn_wc_notify_state_t *prop_state,
+                     svn_skel_t **conflict_skel,
+                     apr_array_header_t **propchanges,
+                     apr_hash_t **actual_props,
+                     svn_wc__db_t *db,
+                     const char *local_abspath,
+                     const struct working_node_version_t *old_version,
+                     const struct working_node_version_t *new_version,
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool)
+{
+  apr_hash_t *new_actual_props;
+
+  /*
+   * Run a 3-way prop merge to update the props, using the pre-update
+   * props as the merge base, the post-update props as the
+   * merge-left version, and the current props of the
+   * moved-here working file as the merge-right version.
+   */
+  SVN_ERR(svn_wc__db_read_props(actual_props,
+                                db, local_abspath,
+                                result_pool, scratch_pool));
+  SVN_ERR(svn_prop_diffs(propchanges, new_version->props, old_version->props,
+                         result_pool));
+  SVN_ERR(svn_wc__merge_props(conflict_skel, prop_state,
+                              NULL, &new_actual_props,
+                              db, local_abspath,
+                              old_version->props, old_version->props,
+                              *actual_props, *propchanges,
+                              result_pool, scratch_pool));
+  /* Install the new actual props. Don't set the conflict_skel yet, because
+     we might need to add a text conflict to it as well. */
+  SVN_ERR(svn_wc__db_op_set_props(db, local_abspath,
+                                  new_actual_props,
+                                  svn_wc__has_magic_property(*propchanges),
+                                  NULL/*conflict_skel*/, NULL/*work_items*/,
+                                  scratch_pool));
+
+  return SVN_NO_ERROR;
 }
 
 
@@ -175,13 +257,102 @@ check_shadowed_node(svn_boolean_t *is_sh
   return SVN_NO_ERROR;
 }
 
-/* All the info we need about one version of a file node. */
-typedef struct file_version_t
+
+static svn_error_t *
+tc_editor_alter_directory(void *baton,
+                          const char *dst_relpath,
+                          svn_revnum_t expected_move_dst_revision,
+                          const apr_array_header_t *children,
+                          apr_hash_t *new_props,
+                          apr_pool_t *scratch_pool)
 {
-  svn_wc_conflict_version_t *location_and_kind;
-  apr_hash_t *props;
-  const svn_checksum_t *checksum;
-} file_version_t;
+  struct tc_editor_baton *b = baton;
+  const char *move_dst_repos_relpath;
+  svn_revnum_t move_dst_revision;
+  svn_kind_t move_dst_kind;
+  working_node_version_t old_version, new_version;
+  svn_wc__db_status_t status;
+
+  SVN_ERR_ASSERT(expected_move_dst_revision == b->old_version->peg_rev);
+
+  /* Get kind, revision, and checksum of the moved-here node. */
+  SVN_ERR(svn_wc__db_depth_get_info(&status, &move_dst_kind, &move_dst_revision,
+                                    &move_dst_repos_relpath, NULL, NULL, NULL,
+                                    NULL, NULL, &old_version.checksum, NULL,
+                                    NULL, &old_version.props,
+                                    b->wcroot, dst_relpath,
+                                    relpath_depth(b->move_root_dst_relpath),
+                                    scratch_pool, scratch_pool));
+  SVN_ERR_ASSERT(move_dst_revision == expected_move_dst_revision);
+  SVN_ERR_ASSERT(move_dst_kind == svn_kind_dir);
+
+  old_version.location_and_kind = b->old_version;
+  new_version.location_and_kind = b->new_version;
+
+  new_version.checksum = NULL; /* not a file */
+  new_version.props = new_props ? new_props : old_version.props;
+
+  if (new_props)
+    {
+      svn_boolean_t is_shadowed;
+
+      /* If the node is shadowed by a higher layer, we need to flag a 
+       * tree conflict and must not touch the working node. */
+      SVN_ERR(check_shadowed_node(&is_shadowed,
+                                  relpath_depth(b->move_root_dst_relpath),
+                                  dst_relpath, b->wcroot));
+      if (is_shadowed)
+        {
+          /* ### TODO flag tree conflict */
+        }
+      else
+        {
+          const char *dst_abspath = svn_dirent_join(b->wcroot->abspath,
+                                                    dst_relpath,
+                                                    scratch_pool);
+          svn_wc_notify_state_t prop_state;
+          svn_skel_t *conflict_skel = NULL;
+          apr_hash_t *actual_props;
+          apr_array_header_t *propchanges;
+
+          SVN_ERR(update_working_props(&prop_state, &conflict_skel,
+                                       &propchanges, &actual_props,
+                                       b->db, dst_abspath,
+                                       &old_version, &new_version,
+                                       b->result_pool, scratch_pool));
+
+          if (conflict_skel)
+            {
+              SVN_ERR(create_conflict_markers(b->work_items, dst_abspath,
+                                              b->db, move_dst_repos_relpath,
+                                              conflict_skel,
+                                              &old_version, &new_version,
+                                              b->result_pool, scratch_pool));
+              SVN_ERR(svn_wc__db_mark_conflict_internal(b->wcroot, dst_relpath,
+                                                        conflict_skel,
+                                                        scratch_pool));
+            }
+
+          if (b->notify_func)
+            {
+              svn_wc_notify_t *notify;
+
+              notify = svn_wc_create_notify(dst_abspath,
+                                            svn_wc_notify_update_update,
+                                            scratch_pool);
+              notify->kind = svn_node_dir;
+              notify->content_state = svn_wc_notify_state_inapplicable;
+              notify->prop_state = prop_state;
+              notify->old_revision = b->old_version->peg_rev;
+              notify->revision = b->new_version->peg_rev;
+              b->notify_func(b->notify_baton, notify, scratch_pool);
+            }
+        }
+    }
+
+  return SVN_NO_ERROR;
+}
+
 
 /* Merge the difference between OLD_VERSION and NEW_VERSION into
  * the working file at LOCAL_RELPATH.
@@ -195,14 +366,14 @@ typedef struct file_version_t
  * REPOS_RELPATH is the repository path it would be committed to.
  *
  * Use NOTIFY_FUNC and NOTIFY_BATON for notifications.
- * Add any required work items to *WORK_ITEMS, allocated in RESULT_POOL.
+ * Set *WORK_ITEMS to any required work items, allocated in RESULT_POOL.
  * Use SCRATCH_POOL for temporary allocations. */
 static svn_error_t *
 update_working_file(svn_skel_t **work_items,
                     const char *local_relpath,
                     const char *repos_relpath,
-                    const file_version_t *old_version,
-                    const file_version_t *new_version,
+                    const working_node_version_t *old_version,
+                    const working_node_version_t *new_version,
                     svn_wc__db_wcroot_t *wcroot,
                     svn_wc__db_t *db,
                     svn_wc_notify_func2_t notify_func,
@@ -211,41 +382,30 @@ update_working_file(svn_skel_t **work_it
                     apr_pool_t *scratch_pool)
 {
   const char *local_abspath = svn_dirent_join(wcroot->abspath,
-                                                 local_relpath,
-                                                 scratch_pool);
+                                              local_relpath,
+                                              scratch_pool);
   const char *old_pristine_abspath;
   const char *new_pristine_abspath;
   svn_skel_t *conflict_skel = NULL;
-  apr_hash_t *actual_props, *new_actual_props;
+  apr_hash_t *actual_props;
   apr_array_header_t *propchanges;
   enum svn_wc_merge_outcome_t merge_outcome;
   svn_wc_notify_state_t prop_state, content_state;
 
-  /*
-   * Run a 3-way prop merge to update the props, using the pre-update
-   * props as the merge base, the post-update props as the
-   * merge-left version, and the current props of the
-   * moved-here working file as the merge-right version.
-   */
-  SVN_ERR(svn_wc__db_read_props(&actual_props,
-                                db, local_abspath,
-                                scratch_pool, scratch_pool));
-  SVN_ERR(svn_prop_diffs(&propchanges,
-                         new_version->props, old_version->props,
-                         scratch_pool));
-  SVN_ERR(svn_wc__merge_props(&conflict_skel, &prop_state,
-                              NULL, &new_actual_props,
-                              db, local_abspath,
-                              old_version->props, old_version->props,
-                              actual_props, propchanges,
-                              scratch_pool, scratch_pool));
-  /* ### TODO: Make a WQ item in WORK_ITEMS to set new_actual_props ... */
-  /* ### Not a direct DB op like this... */
-  SVN_ERR(svn_wc__db_op_set_props(db, local_abspath,
-                                  new_actual_props,
-                                  svn_wc__has_magic_property(propchanges),
-                                  NULL/*conflict_skel*/, NULL/*work_items*/,
-                                  scratch_pool));
+  SVN_ERR(update_working_props(&prop_state, &conflict_skel, &propchanges,
+                               &actual_props, db, local_abspath,
+                               old_version, new_version,
+                               result_pool, scratch_pool));
+
+  /* If there are any conflicts to be stored, convert them into work items
+   * too. */
+  if (conflict_skel)
+    {
+      SVN_ERR(create_conflict_markers(work_items, local_abspath, db,
+                                      repos_relpath, conflict_skel,
+                                      old_version, new_version,
+                                      result_pool, scratch_pool));
+    }
 
   /*
    * Run a 3-way merge to update the file, using the pre-update
@@ -280,26 +440,15 @@ update_working_file(svn_skel_t **work_it
    * too. */
   if (conflict_skel)
     {
-      svn_skel_t *work_item;
-      svn_wc_conflict_version_t *original_version;
-
-      original_version = svn_wc_conflict_version_dup(
-                           old_version->location_and_kind, scratch_pool);
-      original_version->path_in_repos = repos_relpath;
-      original_version->node_kind = svn_node_file;
-      SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict_skel,
-                                                  original_version,
-                                                  scratch_pool,
-                                                  scratch_pool));
-      /* According to this func's doc string, it is "Currently only used for
-       * property conflicts as text conflict markers are just in-wc files." */
-      SVN_ERR(svn_wc__conflict_create_markers(&work_item, db,
-                                              local_abspath,
-                                              conflict_skel,
-                                              scratch_pool,
-                                              scratch_pool));
-      *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
+      SVN_ERR(create_conflict_markers(work_items, local_abspath, db,
+                                      repos_relpath, conflict_skel,
+                                      old_version, new_version,
+                                      result_pool, scratch_pool));
+      SVN_ERR(svn_wc__db_mark_conflict_internal(wcroot, local_relpath,
+                                                conflict_skel,
+                                                scratch_pool));
     }
+
   if (merge_outcome == svn_wc_merge_conflict)
     {
       content_state = svn_wc_notify_state_conflicted;
@@ -353,7 +502,7 @@ tc_editor_alter_file(void *baton,
   const char *move_dst_repos_relpath;
   svn_revnum_t move_dst_revision;
   svn_kind_t move_dst_kind;
-  file_version_t old_version, new_version;
+  working_node_version_t old_version, new_version;
 
   /* Get kind, revision, and checksum of the moved-here node. */
   SVN_ERR(svn_wc__db_depth_get_info(NULL, &move_dst_kind, &move_dst_revision,
@@ -391,12 +540,18 @@ tc_editor_alter_file(void *baton,
           /* ### TODO flag tree conflict */
         }
       else
-        SVN_ERR(update_working_file(b->work_items, dst_relpath,
-                                    move_dst_repos_relpath,
-                                    &old_version, &new_version,
-                                    b->wcroot, b->db,
-                                    b->notify_func, b->notify_baton,
-                                    b->result_pool, scratch_pool));
+        {
+          svn_skel_t *work_item;
+
+          SVN_ERR(update_working_file(&work_item, dst_relpath,
+                                      move_dst_repos_relpath,
+                                      &old_version, &new_version,
+                                      b->wcroot, b->db,
+                                      b->notify_func, b->notify_baton,
+                                      b->result_pool, scratch_pool));
+          *b->work_items = svn_wc__wq_merge(*b->work_items, work_item,
+                                            b->result_pool);
+        }
     }
 
   return SVN_NO_ERROR;
@@ -676,19 +831,45 @@ update_moved_away_file(svn_editor_t *tc_
  */
 static svn_error_t *
 update_moved_away_dir(svn_editor_t *tc_editor,
+                      svn_boolean_t add,
                       const char *src_relpath,
                       const char *dst_relpath,
+                      int src_op_depth,
                       const char *move_root_dst_relpath,
                       svn_revnum_t move_root_dst_revision,
                       svn_wc__db_t *db,
                       svn_wc__db_wcroot_t *wcroot,
                       apr_pool_t *scratch_pool)
 {
-  /* ### notify */
+  apr_hash_t *children_hash;
+  apr_array_header_t *new_children;
+  apr_hash_t *new_props;
+  const char *src_abspath = svn_dirent_join(wcroot->abspath,
+                                            src_relpath,
+                                            scratch_pool);
+
+  if (add)
+    {
+      /* ### TODO children and props */
+      SVN_ERR(svn_editor_add_directory(tc_editor, dst_relpath,
+                                       apr_array_make(scratch_pool, 0,
+                                                      sizeof (const char *)),
+                                       apr_hash_make(scratch_pool),
+                                       move_root_dst_revision));
+      return SVN_NO_ERROR;
+    }
+
+  SVN_ERR(svn_wc__db_get_children_op_depth(&children_hash, wcroot,
+                                           src_relpath, src_op_depth,
+                                           scratch_pool, scratch_pool));
+  SVN_ERR(svn_hash_keys(&new_children, children_hash, scratch_pool));
 
-  /* ### update prop content if changed */
+  SVN_ERR(svn_wc__db_read_pristine_props(&new_props, db, src_abspath,
+                                         scratch_pool, scratch_pool));
 
-  /* ### update list of children if changed */
+  SVN_ERR(svn_editor_alter_directory(tc_editor, dst_relpath,
+                                     move_root_dst_revision,
+                                     new_children, new_props));
 
   return SVN_NO_ERROR;
 }
@@ -697,6 +878,7 @@ update_moved_away_dir(svn_editor_t *tc_e
  */
 static svn_error_t *
 update_moved_away_subtree(svn_editor_t *tc_editor,
+                          svn_boolean_t add,
                           const char *src_relpath,
                           const char *dst_relpath,
                           int src_op_depth,
@@ -710,8 +892,8 @@ update_moved_away_subtree(svn_editor_t *
   apr_pool_t *iterpool;
   apr_hash_index_t *hi;
 
-  SVN_ERR(update_moved_away_dir(tc_editor, src_relpath, dst_relpath,
-                                move_root_dst_relpath,
+  SVN_ERR(update_moved_away_dir(tc_editor, add, src_relpath, dst_relpath,
+                                src_op_depth, move_root_dst_relpath,
                                 move_root_dst_revision,
                                 db, wcroot, scratch_pool));
 
@@ -759,7 +941,7 @@ update_moved_away_subtree(svn_editor_t *
         }
       else if (*src_kind == svn_kind_dir)
         {
-          SVN_ERR(update_moved_away_subtree(tc_editor,
+          SVN_ERR(update_moved_away_subtree(tc_editor, is_add,
                                             child_src_relpath,
                                             child_dst_relpath,
                                             src_op_depth,
@@ -891,7 +1073,8 @@ drive_tree_conflict_editor(svn_editor_t 
                                    dst_relpath, old_version->peg_rev,
                                    db, wcroot, scratch_pool));
   else if (old_version->node_kind == svn_node_dir)
-    SVN_ERR(update_moved_away_subtree(tc_editor, src_relpath, dst_relpath,
+    SVN_ERR(update_moved_away_subtree(tc_editor, FALSE,
+                                      src_relpath, dst_relpath,
                                       src_op_depth,
                                       dst_relpath, old_version->peg_rev,
                                       db, wcroot, scratch_pool));

Modified: subversion/branches/in-repo-authz/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_dav_svn/mirror.c?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/in-repo-authz/subversion/mod_dav_svn/mirror.c Fri Dec 14 04:14:09 2012
@@ -39,12 +39,17 @@
    URI_SEGMENT is the URI bits relative to the repository root (but if
    non-empty, *does* have a leading slash delimiter).
    MASTER_URI and URI_SEGMENT are not URI-encoded. */
-static void proxy_request_fixup(request_rec *r,
-                                const char *master_uri,
-                                const char *uri_segment)
+static int proxy_request_fixup(request_rec *r,
+                               const char *master_uri,
+                               const char *uri_segment)
 {
-    assert((uri_segment[0] == '\0')
-           || (uri_segment[0] == '/'));
+    if (uri_segment[0] != '\0' && uri_segment[0] != '/')
+      {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, SVN_ERR_BAD_CONFIG_VALUE, r,
+                     "Invalid URI segment '%s' in slave fixup",
+                      uri_segment);
+        return HTTP_INTERNAL_SERVER_ERROR;
+      }
 
     r->proxyreq = PROXYREQ_REVERSE;
     r->uri = r->unparsed_uri;
@@ -67,6 +72,7 @@ static void proxy_request_fixup(request_
     ap_add_output_filter("LocationRewrite", NULL, r, r->connection);
     ap_add_output_filter("ReposRewrite", NULL, r, r->connection);
     ap_add_input_filter("IncomingRewrite", NULL, r, r->connection);
+    return OK;
 }
 
 
@@ -101,8 +107,10 @@ int dav_svn__proxy_request_fixup(request
                                                     "/txn/", (char *)NULL))
                     || ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
                                                     "/txr/", (char *)NULL))) {
+                    int rv;
                     seg += strlen(root_dir);
-                    proxy_request_fixup(r, master_uri, seg);
+                    rv = proxy_request_fixup(r, master_uri, seg);
+                    if (rv) return rv;
                 }
             }
             return OK;
@@ -116,8 +124,10 @@ int dav_svn__proxy_request_fixup(request
                     r->method_number == M_LOCK ||
                     r->method_number == M_UNLOCK ||
                     ap_strstr_c(seg, special_uri))) {
+            int rv;
             seg += strlen(root_dir);
-            proxy_request_fixup(r, master_uri, seg);
+            rv = proxy_request_fixup(r, master_uri, seg);
+            if (rv) return rv;
             return OK;
         }
     }

Modified: subversion/branches/in-repo-authz/subversion/tests/README
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/README?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/README (original)
+++ subversion/branches/in-repo-authz/subversion/tests/README Fri Dec 14 04:14:09 2012
@@ -20,7 +20,7 @@ sub-tests it can run.  It has a standard
 
 1.  If run with a numeric argument N, the program runs sub-test N.
 
-2.  If run with the argument `list', it will list the names of all sub-tests.
+2.  If run with the argument `--list', it will list the names of all sub-tests.
 
 3.  If run with no arguments, the program runs *all* sub-tests.
 

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/README
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/README?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/README (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/README Fri Dec 14 04:14:09 2012
@@ -141,16 +141,17 @@ Note [1]: It would be quite too much to 
           ----------------------------
 
 
-[If you want to test with serf instead of neon:
-
-  $ ./basic_tests.py --url=http://localhost --http-library=serf
-
-  or
-
-  $ make check BASE_URL=http://localhost HTTP_LIBRARY=serf
-]
-
+As a shorthand to all of the above, ./davautocheck.sh will generate
+an Apache configuration listening on a random port on localhost and
+run some tests.  Without arguments, or when invoking 'make davautocheck'
+on the top-level Makefile, it will run all tests.  With arguments,
+it will run just one suite or just one test:
+
+     $ ./davautocheck.sh
+     $ ./davautocheck.sh basic
+     $ ./davautocheck.sh basic 15
 
+It also respects some environment variables.
 
 Running over ra_svn
 -------------------
@@ -188,6 +189,9 @@ $ saslpasswd2 -c -u svntest jconstant
 
 As usual, both users should use the password 'rayjandom'.
 
+There are 'make svnserveautocheck' and ./svnserveautocheck.sh commands,
+analogous to davautocheck.sh documented above.
+
 
 Running tests in a RAM disk
 --------------------------

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/davautocheck.sh?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/davautocheck.sh Fri Dec 14 04:14:09 2012
@@ -219,7 +219,13 @@ fi
 [ -r "$MOD_AUTHZ_SVN" ] \
   || fail "authz_svn_module not found, please use '--enable-shared --enable-dso --with-apxs' with your 'configure' script"
 
-BUILDDIR_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs"
+for d in `find "$ABS_BUILDDIR" -type d -name .libs`; do
+  if [ -z "$BUILDDIR_LIBRARY_PATH" ]; then
+    BUILDDIR_LIBRARY_PATH="$d"
+  else
+    BUILDDIR_LIBRARY_PATH="$BUILDDIR_LIBRARY_PATH:$d"
+  fi
+done
 
 case "`uname`" in
   Darwin*)
@@ -517,6 +523,12 @@ if [ $# -eq 1 ] && [ "x$1" = 'x--no-test
   exit
 fi
 
+if type time > /dev/null; then
+  TIME_CMD=time
+else
+  TIME_CMD=""
+fi
+
 say "starting the tests..."
 
 CLIENT_CMD="$ABS_BUILDDIR/subversion/svn/svn"
@@ -534,13 +546,13 @@ else
 fi
 
 if [ $# = 0 ]; then
-  time make check "BASE_URL=$BASE_URL" $SSL_MAKE_VAR
+  $TIME_CMD make check "BASE_URL=$BASE_URL" $SSL_MAKE_VAR
   r=$?
 else
   (cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
   TEST="$1"
   shift
-  time "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" $SSL_TEST_ARG "$@")
+  $TIME_CMD "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" $SSL_TEST_ARG "$@")
   r=$?
 fi
 

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py Fri Dec 14 04:14:09 2012
@@ -2683,7 +2683,7 @@ def inheritable_ignores(sbox):
 def almost_known_prop_names(sbox):
   "propset with svn: prefix but unknown name"
 
-  sbox.build()
+  sbox.build(read_only=True)
   wc_dir = sbox.wc_dir
   iota_path = sbox.ospath('iota')
 

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py Fri Dec 14 04:14:09 2012
@@ -356,6 +356,13 @@ def copy_bad_line_endings_dump(sbox):
                 expected_dumpfile_name="copy-bad-line-endings.expected.dump",
                 bypass_prop_validation=True)
 
+@XFail()
+@Issue(4263)
+def copy_bad_line_endings_load(sbox):
+  "load: inconsistent line endings in svn:* props"
+  run_load_test(sbox, "copy-bad-line-endings.dump",
+                expected_dumpfile_name="copy-bad-line-endings.expected.dump")
+          
 def copy_bad_line_endings2_dump(sbox):
   "dump: non-LF line endings in svn:* props"
   run_dump_test(sbox, "copy-bad-line-endings2.dump",
@@ -771,6 +778,7 @@ test_list = [ None,
               move_and_modify_in_the_same_revision_dump,
               move_and_modify_in_the_same_revision_load,
               copy_bad_line_endings_dump,
+              copy_bad_line_endings_load,
               copy_bad_line_endings2_dump,
               commit_a_copy_of_root_dump,
               commit_a_copy_of_root_load,

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/svnserveautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/svnserveautocheck.sh?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/svnserveautocheck.sh (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/svnserveautocheck.sh Fri Dec 14 04:14:09 2012
@@ -21,16 +21,16 @@
 #
 # -*- mode: shell-script; -*-
 
-# This script simplifies the preparation of the environment for a Subversion client
-# communicating with an svnserve server.
+# This script simplifies the preparation of the environment for a Subversion
+# client communicating with an svnserve server.
 #
-# The script runs svnserve, runs "make check", and kills the svnserve afterwards.
-# It makes sure to kill the svnserve even if the test run dies.
+# The script runs svnserve, runs "make check", and kills the svnserve
+# afterwards.  It makes sure to kill the svnserve even if the test run dies.
 #
 # This script should be run from the top level of the Subversion
-# distribution; it's easiest to just run it as "make
-# svnserveautocheck".  Like "make check", you can specify further options
-# like "make svnserveautocheck FS_TYPE=bdb TESTS=subversion/tests/cmdline/basic.py".
+# distribution; it's easiest to just run it as "make svnserveautocheck".
+# Like "make check", you can specify further options like
+# "make svnserveautocheck FS_TYPE=bdb TESTS=subversion/tests/cmdline/basic.py".
 
 PYTHON=${PYTHON:-python}
 
@@ -80,8 +80,6 @@ fi
 # for it and "make check-clean".
 SVNSERVE_PID=$ABS_BUILDDIR/subversion/tests/svnserveautocheck.pid
 
-export LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
-
 SERVER_CMD="$ABS_BUILDDIR/subversion/svnserve/svnserve"
 
 rm -f $SVNSERVE_PID
@@ -94,6 +92,12 @@ random_port() {
   fi
 }
 
+if type time > /dev/null; then
+  TIME_CMD=time
+else
+  TIME_CMD=""
+fi
+
 SVNSERVE_PORT=$(random_port)
 while netstat -an | grep $SVNSERVE_PORT | grep 'LISTEN'; do
   SVNSERVE_PORT=$(random_port)
@@ -115,13 +119,13 @@ fi
 
 BASE_URL=svn://127.0.0.1:$SVNSERVE_PORT
 if [ $# = 0 ]; then
-  time make check "BASE_URL=$BASE_URL"
+  $TIME_CMD make check "BASE_URL=$BASE_URL"
   r=$?
 else
   cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
   TEST="$1"
   shift
-  time "./${TEST}_tests.py" "--url=$BASE_URL" $*
+  $TIME_CMD "./${TEST}_tests.py" "--url=$BASE_URL" $*
   r=$?
   cd - > /dev/null
 fi

Propchange: subversion/branches/in-repo-authz/subversion/tests/libsvn_ra/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Dec 14 04:14:09 2012
@@ -0,0 +1,4 @@
+*.lo
+.libs
+ra-test
+test-repo-*

Modified: subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c Fri Dec 14 04:14:09 2012
@@ -4365,6 +4365,10 @@ move_update(const svn_test_opts_t *opts,
   SVN_ERR(sbox_wc_add(&b, "X/h"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
+  /* r5: Add a subtree 'A/B/C' */
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+
   SVN_ERR(sbox_wc_update(&b, "", 1));
 
   /* A is single-revision so A2 is a single-revision copy */
@@ -4585,6 +4589,41 @@ move_update(const svn_test_opts_t *opts,
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
+  SVN_ERR(sbox_wc_update(&b, "", 5));
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       5, ""},
+      {0, "A",        "normal",       5, "A"},
+      {0, "A/B",      "normal",       5, "A/B"},
+      {0, "A/B/f",    "normal",       5, "A/B/f"},
+      {0, "A/B/g",    "normal",       5, "A/B/g"},
+      {0, "A/B/C",    "normal",       5, "A/B/C"},
+      {0, "X",        "normal",       5, "X"},
+      {0, "X/f",      "normal",       5, "X/f"},
+      {0, "X/g",      "normal",       5, "X/g"},
+      {0, "X/h",      "normal",       5, "X/h"},
+      {1, "A",        "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",      "base-deleted", NO_COPY_FROM},
+      {1, "A/B/f",    "base-deleted", NO_COPY_FROM},
+      {1, "A/B/g",    "base-deleted", NO_COPY_FROM},
+      {1, "A/B/C",    "base-deleted", NO_COPY_FROM},
+      {1, "A2",       "normal",       5, "A", MOVED_HERE},
+      {1, "A2/B",     "normal",       5, "A/B", MOVED_HERE},
+      {1, "A2/B/f",   "normal",       5, "A/B/f", MOVED_HERE},
+      {1, "A2/B/g",   "normal",       5, "A/B/g", MOVED_HERE},
+      {1, "A2/B/C",   "normal",       5, "A/B/C", MOVED_HERE},
+      {2, "A2/B",     "normal",       4, "X"},
+      {2, "A2/B/f",   "normal",       4, "X/f"},
+      {2, "A2/B/g",   "normal",       4, "X/g"},
+      {2, "A2/B/h",   "normal",       4, "X/h"},
+      {2, "A2/B/C",   "base-deleted", NO_COPY_FROM},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+
   return SVN_NO_ERROR;
 }
 
@@ -5106,6 +5145,87 @@ update_prop_mod_into_moved(const svn_tes
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+nested_move_update(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "nested_move_update", opts, pool));
+
+  /* r1: Create file 'f' */
+  SVN_ERR(sbox_wc_mkdir(&b, "A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
+  sbox_file_write(&b, "A/B/C/f", "r1 content\n");
+  SVN_ERR(sbox_wc_add(&b, "A/B/C/f"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+
+  /* r2: Modify 'f' */
+  sbox_file_write(&b, "A/B/C/f", "r1 content\nr2 content\n");
+  SVN_ERR(sbox_wc_commit(&b, ""));
+
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+
+  SVN_ERR(sbox_wc_move(&b, "A", "A2"));
+  SVN_ERR(sbox_wc_move(&b, "A2/B/C", "A2/B/C2"));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",          "normal",       1, ""},
+      {0, "A",         "normal",       1, "A"},
+      {0, "A/B",       "normal",       1, "A/B"},
+      {0, "A/B/C",     "normal",       1, "A/B/C"},
+      {0, "A/B/C/f",   "normal",       1, "A/B/C/f"},
+      {1, "A",         "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",       "base-deleted", NO_COPY_FROM},
+      {1, "A/B/C",     "base-deleted", NO_COPY_FROM},
+      {1, "A/B/C/f",   "base-deleted", NO_COPY_FROM},
+      {1, "A2",        "normal",       1, "A", MOVED_HERE},
+      {1, "A2/B",      "normal",       1, "A/B", MOVED_HERE},
+      {1, "A2/B/C",    "normal",       1, "A/B/C", MOVED_HERE},
+      {1, "A2/B/C/f",  "normal",       1, "A/B/C/f", MOVED_HERE},
+      {3, "A2/B/C",    "base-deleted", NO_COPY_FROM, "A2/B/C2"},
+      {3, "A2/B/C/f",  "base-deleted", NO_COPY_FROM},
+      {3, "A2/B/C2",   "normal",       1, "A/B/C", MOVED_HERE},
+      {3, "A2/B/C2/f", "normal",       1, "A/B/C/f", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+
+  /* Following the A->A2 move should raise a tree-conflict on A2/B/C,
+     resolving that may require an explicit resolve. */
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_wc_conflict_choose_mine_conflict));
+  SVN_ERR(sbox_wc_resolve(&b, "A2/B/C", svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",          "normal",       2, ""},
+      {0, "A",         "normal",       2, "A"},
+      {0, "A/B",       "normal",       2, "A/B"},
+      {0, "A/B/C",     "normal",       2, "A/B/C"},
+      {0, "A/B/C/f",   "normal",       2, "A/B/C/f"},
+      {1, "A",         "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",       "base-deleted", NO_COPY_FROM},
+      {1, "A/B/C",     "base-deleted", NO_COPY_FROM},
+      {1, "A/B/C/f",   "base-deleted", NO_COPY_FROM},
+      {1, "A2",        "normal",       2, "A", MOVED_HERE},
+      {1, "A2/B",      "normal",       2, "A/B", MOVED_HERE},
+      {1, "A2/B/C",    "normal",       2, "A/B/C", MOVED_HERE},
+      {1, "A2/B/C/f",  "normal",       2, "A/B/C/f", MOVED_HERE},
+      {3, "A2/B/C",    "base-deleted", NO_COPY_FROM, "A2/B/C2"},
+      {3, "A2/B/C/f",  "base-deleted", NO_COPY_FROM},
+      {3, "A2/B/C2",   "normal",       2, "A/B/C", MOVED_HERE},
+      {3, "A2/B/C2/f", "normal",       2, "A/B/C/f", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+
+  return SVN_NO_ERROR;
+}
+
 
 /* ---------------------------------------------------------------------- */
 /* The list of test functions */
@@ -5205,5 +5325,7 @@ struct svn_test_descriptor_t test_funcs[
                        "mixed_rev_move"),
     SVN_TEST_OPTS_PASS(update_prop_mod_into_moved,
                        "update_prop_mod_into_moved"),
+    SVN_TEST_OPTS_XFAIL(nested_move_update,
+                       "nested_move_update"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/wc-queries-test.c Fri Dec 14 04:14:09 2012
@@ -87,7 +87,6 @@ static const int slow_statements[] =
 
   /* Is there a record? ### Can we somehow check for LIMIT 1? */
   STMT_LOOK_FOR_WORK,
-  STMT_HAS_WORKING_NODES,
 
   /* Full temporary table read */
   STMT_INSERT_ACTUAL_EMPTIES,

Modified: subversion/branches/in-repo-authz/tools/dev/contribulyze.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/tools/dev/contribulyze.py?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/tools/dev/contribulyze.py (original)
+++ subversion/branches/in-repo-authz/tools/dev/contribulyze.py Fri Dec 14 04:14:09 2012
@@ -511,8 +511,13 @@ class LogMessage(object):
 log_separator = '-' * 72 + '\n'
 log_header_re = re.compile\
                 ('^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
-field_re = re.compile('^(Patch|Review(ed)?|Suggested|Found|Inspired) by:\s*\S.*$')
-field_aliases = { 'Reviewed' : 'Review' }
+field_re = re.compile(
+           '^(Patch|Review(ed)?|Suggested|Found|Inspired|Tested|Reported) by:'
+           '\s*\S.*$')
+field_aliases = {
+  'Reviewed' : 'Review',
+  'Reported' : 'Found',
+}
 parenthetical_aside_re = re.compile('^\s*\(.*\)\s*$')
 
 def graze(input):

Propchange: subversion/branches/in-repo-authz/tools/dist/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 14 04:14:09 2012
@@ -1,3 +1,4 @@
 prefix
 tempdir
 deploy
+*.pyc