You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/10/25 19:50:28 UTC

svn commit: r1027203 [4/5] - in /subversion/branches/performance: ./ notes/http-and-webdav/ subversion/bindings/ctypes-python/csvn/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_...

Modified: subversion/branches/performance/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/wc_db.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/performance/subversion/libsvn_wc/wc_db.h Mon Oct 25 17:50:25 2010
@@ -46,6 +46,8 @@
 #include "private/svn_skel.h"
 #include "private/svn_sqlite.h"
 
+#include "svn_private_config.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
@@ -1004,28 +1006,6 @@ svn_wc__db_pristine_repair(svn_wc__db_t 
 /* @} */
 
 
-/* @defgroup svn_wc__db_repos  Repository information management
-   @{
-*/
-
-/* Ensure an entry for the repository at REPOS_ROOT_URL with UUID exists
-   in DB for LOCAL_ABSPATH, either by finding the correct row, or inserting
-   a new row.  In either case return the id in *REPOS_ID.
-
-   Use SCRATCH_POOL for temporary allocations.
-*/
-svn_error_t *
-svn_wc__db_repos_ensure(apr_int64_t *repos_id,
-                        svn_wc__db_t *db,
-                        const char *local_abspath,
-                        const char *repos_root_url,
-                        const char *repos_uuid,
-                        apr_pool_t *scratch_pool);
-
-
-/* @} */
-
-
 /* @defgroup svn_wc__db_op  Operations on WORKING tree
    @{
 */
@@ -1142,10 +1122,8 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
    To specify no properties, PROPS must be an empty hash, not NULL.
    If the node is not present, return an error.
 
-   ### All the callers are doing a comparison against the current 'pristine'
-       props before calling this, and are passing NULL if the actual props
-       are to be the same as the pristine props. This behaviour should be
-       encapsulated.
+   If PROPS is NULL, set the properties to be the same as the pristine
+   properties.
 
    CONFLICT is used to register a conflict on this node at the same time
    the properties are changed.
@@ -1509,6 +1487,41 @@ svn_wc__db_read_info(svn_wc__db_status_t
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool);
 
+/* Structure returned by svn_wc__db_read_children_info.  Only has the
+   fields needed by status. */
+struct svn_wc__db_info_t {
+  svn_wc__db_status_t status;
+  svn_wc__db_kind_t kind;
+  svn_revnum_t revnum;
+  const char *repos_relpath;
+  const char *repos_root_url;
+  svn_revnum_t changed_rev;
+  const char *changed_author;
+  apr_time_t changed_date;
+  apr_time_t last_mod_time;
+  svn_depth_t depth;
+  svn_filesize_t translated_size;
+  const char *changelist;
+  svn_boolean_t has_props;
+#ifdef HAVE_SYMLINK
+  svn_boolean_t special;
+#endif
+  svn_boolean_t props_mod;
+  svn_boolean_t have_base;
+  svn_boolean_t conflicted;
+  svn_wc__db_lock_t *lock;
+};
+
+/* Return in *NODES a hash mapping name->struct svn_wc__db_info_t for
+   the children of DIR_ABSPATH, and in *CONFLICTS a hash of names in
+   conflict.  */
+svn_error_t *
+svn_wc__db_read_children_info(apr_hash_t **nodes,
+                              apr_hash_t **conflicts,
+                              svn_wc__db_t *db,
+                              const char *dir_abspath,
+                              apr_pool_t *result_pool,
+                              apr_pool_t *scratch_pool);
 
 /* Set *PROPVAL to the value of the property named PROPNAME of the node
    LOCAL_ABSPATH in the ACTUAL tree (looking through to the WORKING or BASE

Modified: subversion/branches/performance/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/workqueue.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/performance/subversion/libsvn_wc/workqueue.c Mon Oct 25 17:50:25 2010
@@ -186,14 +186,14 @@ run_revert(svn_wc__db_t *db,
   const char *parent_abspath;
   svn_boolean_t conflicted;
   apr_int64_t val;
-  svn_boolean_t is_wc_root;
   svn_boolean_t reinstall_working;
+  svn_boolean_t remove_working;
 
   /* We need a NUL-terminated path, so copy it out of the skel.  */
   local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
 
-  /* ### OP_DEPTH legacy; to be removed. */
   SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
+  remove_working = (val != 0);
 
   SVN_ERR(svn_skel__parse_int(&val, arg1->next->next, scratch_pool));
   reinstall_working = (val != 0);
@@ -213,14 +213,11 @@ run_revert(svn_wc__db_t *db,
 
   if (kind == svn_wc__db_kind_dir)
     {
-      SVN_ERR(svn_wc__db_is_wcroot(&is_wc_root, db, local_abspath,
-                                   scratch_pool));
       parent_abspath = local_abspath;
     }
   else
     {
       parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
-      is_wc_root = FALSE; /* non-directories can't be roots */
     }
 
   if (conflicted)
@@ -281,7 +278,7 @@ run_revert(svn_wc__db_t *db,
     {
       SVN__NOT_IMPLEMENTED();
     }
-  else if (kind == svn_wc__db_kind_dir)
+  else if (reinstall_working && kind == svn_wc__db_kind_dir)
     {
       svn_node_kind_t on_disk;
 
@@ -294,26 +291,11 @@ run_revert(svn_wc__db_t *db,
     }
 
 
-  if (! is_wc_root) {
-    /* A working copy root can't have a working node. Don't try removing. */
-    const char *op_root_abspath = NULL;
-
-
-
-    /* Remove the WORKING version of the node */
-    /* If the node is not the operation root,
-       we should not delete the working node */
-    if (status == svn_wc__db_status_added)
-      SVN_ERR(svn_wc__db_scan_addition(NULL, &op_root_abspath, NULL, NULL,
-                                       NULL, NULL, NULL, NULL, NULL,
-                                       db, local_abspath,
-                                       scratch_pool, scratch_pool));
-
-    if (!op_root_abspath
-        || (strcmp(op_root_abspath, local_abspath) == 0))
+  if (remove_working)
+    {
       SVN_ERR(svn_wc__db_temp_op_remove_working(db, local_abspath,
                                                 scratch_pool));
-  }
+    }
 
   return SVN_NO_ERROR;
 }
@@ -363,6 +345,7 @@ verify_pristine_present(svn_wc__db_t *db
 svn_error_t *
 svn_wc__wq_add_revert(svn_boolean_t *will_revert,
                       svn_wc__db_t *db,
+                      const char *revert_root,
                       const char *local_abspath,
                       svn_boolean_t use_commit_times,
                       apr_pool_t *scratch_pool)
@@ -370,6 +353,7 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
   svn_wc__db_status_t status;
   svn_wc__db_kind_t kind;
   svn_boolean_t replaced;
+  svn_boolean_t remove_working = FALSE;
   svn_boolean_t reinstall_working;
 
   SVN_ERR(svn_wc__db_read_info(
@@ -380,8 +364,11 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
             db, local_abspath,
             scratch_pool, scratch_pool));
 
-  /* Special handling for issue #2101.  */
-  if (kind == svn_wc__db_kind_file)
+  /* Special handling for issue #2101, which is specifically
+     about reverting copies of 'deleted' files and dirs, being inserted
+     in the copy as a schedule-delete files, yet can't be reverted. */
+  if (kind == svn_wc__db_kind_file
+      && status == svn_wc__db_status_deleted)
     SVN_ERR(verify_pristine_present(db, local_abspath, scratch_pool));
 
   /* Gather a few items *before* the revert work-item has a chance to run.
@@ -447,6 +434,26 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
       *will_revert = *will_revert || reinstall_working;
     }
 
+
+  if (status == svn_wc__db_status_added)
+    {
+      /* When looking at an added, non-replacing node, it's entry
+         will have to be removed after revert: if not, it'll look
+         like it's still under version control. */
+      const char *op_root_abspath;
+
+      SVN_ERR(svn_wc__db_scan_addition(NULL, &op_root_abspath, NULL, NULL,
+                                       NULL, NULL, NULL, NULL, NULL,
+                                       db, local_abspath,
+                                       scratch_pool, scratch_pool));
+
+      if (svn_dirent_is_ancestor(revert_root, op_root_abspath))
+        remove_working = TRUE;
+    }
+  else
+    remove_working = TRUE;
+
+
   /* Don't even bother to queue a work item if there is nothing to do.  */
   if (*will_revert)
     {
@@ -458,10 +465,7 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
          we only need the work_item to survive for the duration of wq_add.  */
       svn_skel__prepend_int(use_commit_times, work_item, scratch_pool);
       svn_skel__prepend_int(reinstall_working, work_item, scratch_pool);
-
-      /* ### OP_DEPTH The 'replaced' item is here for backward compat;
-         the wq-consumer doesn't use this value anymore. */
-      svn_skel__prepend_int(replaced, work_item, scratch_pool);
+      svn_skel__prepend_int(remove_working, work_item, scratch_pool);
       svn_skel__prepend_str(local_abspath, work_item, scratch_pool);
       svn_skel__prepend_str(OP_REVERT, work_item, scratch_pool);
 

Modified: subversion/branches/performance/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/workqueue.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/performance/subversion/libsvn_wc/workqueue.h Mon Oct 25 17:50:25 2010
@@ -188,10 +188,12 @@ svn_wc__wq_build_record_fileinfo(svn_ske
                                  apr_pool_t *result_pool);
 
 
-/* Record a work item to revert LOCAL_ABSPATH.  */
+/* Record a work item to revert LOCAL_ABSPATH;
+   REVERT_ROOT designates the root of the entire revert operation. */
 svn_error_t *
 svn_wc__wq_add_revert(svn_boolean_t *will_revert,
                       svn_wc__db_t *db,
+                      const char *revert_root,
                       const char *local_abspath,
                       svn_boolean_t use_commit_times,
                       apr_pool_t *scratch_pool);

Modified: subversion/branches/performance/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/cl.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/cl.h (original)
+++ subversion/branches/performance/subversion/svn/cl.h Mon Oct 25 17:50:25 2010
@@ -270,6 +270,7 @@ svn_opt_subcommand_t
   svn_cl__propget,
   svn_cl__proplist,
   svn_cl__propset,
+  svn_cl__relocate,
   svn_cl__revert,
   svn_cl__resolve,
   svn_cl__resolved,

Modified: subversion/branches/performance/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/main.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/main.c (original)
+++ subversion/branches/performance/subversion/svn/main.c Mon Oct 25 17:50:25 2010
@@ -166,9 +166,7 @@ const apr_getopt_option_t svn_cl__option
   {"incremental",   opt_incremental, 0,
                     N_("give output suitable for concatenation")},
   {"encoding",      opt_encoding, 1,
-                    N_("treat value as being in charset encoding ARG\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --enc]")},
+                    N_("treat value as being in charset encoding ARG")},
   {"version",       opt_version, 0, N_("show program version information")},
   {"verbose",       'v', 0, N_("print extra information")},
   {"show-updates",  'u', 0, N_("display update information")},
@@ -215,21 +213,15 @@ const apr_getopt_option_t svn_cl__option
   {"set-depth",     opt_set_depth, 1,
                     N_("set new working copy depth to ARG ('exclude',\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
-                       "'empty', 'files', 'immediates', or 'infinity')\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --sd]")},
+                       "'empty', 'files', 'immediates', or 'infinity')")},
   {"xml",           opt_xml, 0, N_("output in XML")},
   {"strict",        opt_strict, 0, N_("use strict semantics")},
   {"stop-on-copy",  opt_stop_on_copy, 0,
-                    N_("do not cross copies while traversing history\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --soc]")},
+                    N_("do not cross copies while traversing history")},
   {"no-ignore",     opt_no_ignore, 0,
                     N_("disregard default and svn:ignore property ignores")},
   {"no-auth-cache", opt_no_auth_cache, 0,
-                    N_("do not cache authentication tokens\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --nac]")},
+                    N_("do not cache authentication tokens")},
   {"trust-server-cert", opt_trust_server_cert, 0,
                     N_("accept unknown SSL server certificates without\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
@@ -237,41 +229,27 @@ const apr_getopt_option_t svn_cl__option
   {"non-interactive", opt_non_interactive, 0,
                     N_("do no interactive prompting")},
   {"dry-run",       opt_dry_run, 0,
-                    N_("try operation but make no changes\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --dry]")},
+                    N_("try operation but make no changes")},
   {"no-diff-deleted", opt_no_diff_deleted, 0,
-                    N_("do not print differences for deleted files\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --ndd]")},
+                    N_("do not print differences for deleted files")},
   {"notice-ancestry", opt_notice_ancestry, 0,
-                    N_("notice ancestry when calculating differences\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --na]")},
+                    N_("notice ancestry when calculating differences")},
   {"ignore-ancestry", opt_ignore_ancestry, 0,
-                    N_("ignore ancestry when calculating merges\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --ia]")},
+                    N_("ignore ancestry when calculating merges")},
   {"ignore-externals", opt_ignore_externals, 0,
-                    N_("ignore externals definitions\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --ie]")},
+                    N_("ignore externals definitions")},
   {"diff-cmd",      opt_diff_cmd, 1, N_("use ARG as diff command")},
   {"diff3-cmd",     opt_merge_cmd, 1, N_("use ARG as merge command")},
   {"editor-cmd",    opt_editor_cmd, 1, N_("use ARG as external editor")},
   {"record-only",   opt_record_only, 0,
-                    N_("merge only mergeinfo differences\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --ro]")},
+                    N_("merge only mergeinfo differences")},
   {"old",           opt_old_cmd, 1, N_("use ARG as the older target")},
   {"new",           opt_new_cmd, 1, N_("use ARG as the newer target")},
   {"revprop",       opt_revprop, 0,
                     N_("operate on a revision property (use with -r)")},
   {"relocate",      opt_relocate, 0, N_("relocate via URL-rewriting")},
   {"config-dir",    opt_config_dir, 1,
-                    N_("read user configuration files from directory ARG\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --cd]")},
+                    N_("read user configuration files from directory ARG")},
   {"config-option", opt_config_options, 1,
                     N_("set user configuration option in the format:\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
@@ -291,20 +269,14 @@ const apr_getopt_option_t svn_cl__option
                        SVN_CL__OPTION_CONTINUATION_INDENT
                        "ARG may be one of 'LF', 'CR', 'CRLF'")},
   {"limit",         'l', 1, N_("maximum number of log entries")},
-  {"no-unlock",     opt_no_unlock, 0, N_("don't unlock the targets\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[aliases: --nul, --keep-lock]")},
+  {"no-unlock",     opt_no_unlock, 0, N_("don't unlock the targets")},
   {"summarize",     opt_summarize, 0, N_("show a summary of the results")},
   {"remove",         opt_remove, 0, N_("remove changelist association")},
   {"changelist",    opt_changelist, 1,
-                    N_("operate only on members of changelist ARG\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --cl]")},
+                    N_("operate only on members of changelist ARG")},
   {"keep-changelists", opt_keep_changelists, 0,
                     N_("don't delete changelists after commit")},
-  {"keep-local",    opt_keep_local, 0, N_("keep path in working copy\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --kl]")},
+  {"keep-local",    opt_keep_local, 0, N_("keep path in working copy")},
   {"with-all-revprops",  opt_with_all_revprops, 0,
                     N_("retrieve all revision properties")},
   {"with-no-revprops",  opt_with_no_revprops, 0,
@@ -329,61 +301,43 @@ const apr_getopt_option_t svn_cl__option
   {"show-revs",     opt_show_revs, 1,
                     N_("specify which collection of revisions to display\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
-                       "('merged', 'eligible')\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --sr]")},
+                       "('merged', 'eligible')")},
   {"reintegrate",   opt_reintegrate, 0,
-                    N_("lump-merge all of source URL's unmerged changes\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --ri]")},
-  {"strip-count",   opt_strip_count, 1,
+                    N_("lump-merge all of source URL's unmerged changes")},
+  {"strip",         opt_strip_count, 1,
                     N_("number of leading path components to strip from\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
-                       "paths parsed from the patch file. --strip-count 0\n"
+                       "paths parsed from the patch file. --strip 0\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
                        "is the default and leaves paths unmodified.\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
-                       "--strip-count 1 would change the path\n"
+                       "--strip 1 would change the path\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
                        "'doc/fudge/crunchy.html' to 'fudge/crunchy.html'.\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
-                       "--strip-count 2 would leave just 'crunchy.html'\n"
+                       "--strip 2 would leave just 'crunchy.html'\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
                        "The expected component separator is '/' on all\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
-                       "platforms. A leading '/' counts as one component.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --strip]")},
+                       "platforms. A leading '/' counts as one component.")},
   {"show-copies-as-adds", opt_show_copies_as_adds, 0,
-                    N_("don't diff copied or moved files with their source\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --sca]")},
+                    N_("don't diff copied or moved files with their source")},
   {"ignore-keywords", opt_ignore_keywords, 0,
-                    N_("don't expand keywords\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --ik]")},
+                    N_("don't expand keywords")},
   {"reverse-diff", opt_reverse_diff, 0,
                     N_("apply the unidiff in reverse\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
                        "This option also reverses patch target names; the\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
-                       "--old-patch-target-names option will prevent this.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --rd]")},
+                       "--old-patch-target-names option will prevent this.")},
   {"ignore-whitespace", opt_ignore_whitespace, 0,
-                       N_("ignore whitespace during pattern matching\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --iw]")},
+                       N_("ignore whitespace during pattern matching")},
   {"show-diff", opt_show_diff, 0,
-                       N_("produce diff output\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --diff]")},
+                       N_("produce diff output")},
   {"internal-diff", opt_internal_diff, 0,
-                       N_("override diff-cmd specified in config file\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --idiff]")},
+                       N_("override diff-cmd specified in config file")},
   {"git", opt_use_git_diff_format, 0,
-                       N_("use git's extended diff format\n")},                
+                       N_("use git's extended diff format")},
   {"old-patch-target-names", opt_old_patch_target_names, 0,
                        N_("use target names from the old side of a patch.\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
@@ -393,9 +347,7 @@ const apr_getopt_option_t svn_cl__option
                        SVN_CL__OPTION_CONTINUATION_INDENT
                        "  +++ foo.c.new\n"
                        SVN_CL__OPTION_CONTINUATION_INDENT
-                       "this option will cause the name \"foo.c\" to be used\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
-                       "[alias: --optn]")},
+                       "this option will cause the name \"foo.c\" to be used")},
 
   /* Long-opt Aliases
    *
@@ -419,13 +371,11 @@ const apr_getopt_option_t svn_cl__option
   {"kl",            opt_keep_local, 0, NULL},
   {"sr",            opt_show_revs, 1, NULL},
   {"ri",            opt_reintegrate, 0, NULL},
-  {"strip",         opt_strip_count, 1, NULL},
   {"sca",           opt_show_copies_as_adds, 0, NULL},
   {"ik",            opt_ignore_keywords, 0, NULL},
   {"iw",            opt_ignore_whitespace, 0, NULL},
   {"diff",          opt_show_diff, 0, NULL},
   {"idiff",         opt_internal_diff, 0, NULL},
-  {"nul",           opt_no_unlock, 0, NULL},
   {"keep-lock",     opt_no_unlock, 0, NULL},
   {"optn",          opt_old_patch_target_names, 0, NULL},
 
@@ -999,6 +949,29 @@ const svn_opt_subcommand_desc2_t svn_cl_
      opt_force, opt_changelist },
     {{'F', N_("read property value from file ARG")}} },
 
+  { "relocate", svn_cl__relocate, {0}, N_
+    ("Relocate the working copy to point to a different repository root URL.\n"
+     "usage: 1. relocate FROM-PREFIX TO-PREFIX [PATH...]\n"
+     "       2. relocate TO-URL [PATH]\n"
+     "\n"
+     "  Rewrite working copy URL metadata to reflect a syntactic change only.\n"
+     "  This is used when repository's root URL changes (such as a scheme\n"
+     "  or hostname change) but your working copy still reflects the same\n"
+     "  directory within the same repository.\n"
+     "\n"
+     "  1. FROM-PREFIX and TO-PREFIX are initial substrings of the working\n"
+     "     copy's current and new URLs, respectively.  (You may specify the\n"
+     "     complete old and new URLs if you wish.)  Use 'svn info' to determine\n"
+     "     the current working copy URL.\n"
+     "\n"
+     "  2. TO-URL is the (complete) new repository URL to use for for PATH.\n"
+     "\n"
+     "  Examples:\n"
+     "    svn relocate http:// svn:// project1 project2\n"
+     "    svn relocate http://www.example.com/repo/project \\\n"
+     "                 svn://svn.example.com/repo/project\n"),
+    {0} },
+
   { "resolve", svn_cl__resolve, {0}, N_
     ("Resolve conflicts on working copy files or directories.\n"
      "usage: resolve --accept=ARG [PATH...]\n"
@@ -1124,9 +1097,9 @@ const svn_opt_subcommand_desc2_t svn_cl_
       opt_ignore_externals, opt_changelist} },
 
   { "switch", svn_cl__switch, {"sw"}, N_
-    ("Update the working copy to a different URL.\n"
+    ("Update the working copy to a different URL within the same repository.\n"
      "usage: 1. switch URL[@PEGREV] [PATH]\n"
-     "       2. switch --relocate FROM TO [PATH...]\n"
+     "       2. switch --relocate FROM-PREFIX TO-PREFIX [PATH...]\n"
      "\n"
      "  1. Update the working copy to mirror a new URL within the repository.\n"
      "     This behavior is similar to 'svn update', and is the way to\n"
@@ -1148,22 +1121,15 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "     Use the --set-depth option to set a new working copy depth on the\n"
      "     targets of this operation.\n"
      "\n"
-     "  2. Rewrite working copy URL metadata to reflect a syntactic change only.\n"
-     "     This is used when repository's root URL changes (such as a scheme\n"
-     "     or hostname change) but your working copy still reflects the same\n"
-     "     directory within the same repository.\n"
-     "\n"
-     "     FROM is the root URL which will be relocated from.\n"
-     "     You can use 'svn info' to determine the root URL of the current\n"
-     "     working copy directory (look for 'URL:' in its output).\n"
-     "\n"
-     "     TO is the root URL which will be relocated to.\n"
+     "  2. The '--relocate' option is deprecated. This syntax is equivalent to\n"
+     "     'svn relocate FROM-PREFIX TO-PREFIX [PATH]'.\n"
      "\n"
      "  See also 'svn help update' for a list of possible characters\n"
      "  reporting the action taken.\n"
      "\n"
      "  Examples:\n"
      "    svn switch ^/branches/1.x-release\n"
+     "    svn switch --relocate http:// svn://\n"
      "    svn switch --relocate http://www.example.com/repo/project \\\n"
      "                          svn://svn.example.com/repo/project\n"),
     { 'r', 'N', opt_depth, opt_set_depth, 'q', opt_merge_cmd, opt_relocate,

Modified: subversion/branches/performance/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/basic_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/basic_tests.py Mon Oct 25 17:50:25 2010
@@ -38,6 +38,9 @@ XFail = svntest.testcase.XFail
 Wimp = svntest.testcase.Wimp
 Item = wc.StateItem
 
+# Generic UUID-matching regular expression
+uuid_regex = re.compile(r"[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}")
+
 ######################################################################
 # Tests
 #
@@ -2551,8 +2554,100 @@ def delete_and_add_same_file(sbox):
                                         None,
                                         wc_dir)
 
+def delete_child_parent_update(sbox):
+  "rm child, commit, rm parent"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  svntest.main.run_svn(wc_dir, 'rm', sbox.ospath('A/B/E/alpha'))
+
+  expected_output = wc.State(wc_dir, {
+    'A/B/E/alpha' : Item(verb='Deleting'),
+    })
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.remove('A/B/E/alpha')
+
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None,
+                                        wc_dir)
+
+  svntest.main.run_svn(wc_dir, 'rm', sbox.ospath('A/B/E'))
+  expected_status.tweak('A/B/E', 'A/B/E/beta', status='D ')
+
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('A/B/E/alpha', 'A/B/E/beta', 'A/B/E')
+
+  # This produces a tree-conflict
+  expected_status.tweak(wc_rev=2)
+  expected_status.tweak('A/B/E', treeconflict='C')
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        [],
+                                        expected_disk,
+                                        expected_status)
+
+
+
 #----------------------------------------------------------------------
 
+def basic_relocate(sbox):
+  "basic relocate of a wc"
+  sbox.build(read_only = True)
+
+  wc_dir = sbox.wc_dir
+  repo_dir = sbox.repo_dir
+  repo_url = sbox.repo_url
+  other_repo_dir, other_repo_url = sbox.add_repo_path('other')
+  shutil.copytree(repo_dir, other_repo_dir)
+
+  def _verify_url(wc_path, url):
+    name = os.path.basename(wc_path)
+    expected = {'Path' : re.escape(wc_path),
+                'URL' : url,
+                'Repository Root' : '.*',
+                'Revision' : '.*',
+                'Node Kind' : 'directory',
+                'Repository UUID' : uuid_regex,
+              }
+    svntest.actions.run_and_verify_info([expected], wc_path)
+
+  # No-op relocation of just the scheme.
+  scheme = repo_url[:repo_url.index('://')+3]
+  svntest.actions.run_and_verify_svn(None, None, [], 'switch', '--relocate',
+                                     scheme, scheme, wc_dir)
+  _verify_url(wc_dir, repo_url)
+
+  # No-op relocation of a bit more of the URL.
+  substring = repo_url[:repo_url.index('://')+7]
+  svntest.actions.run_and_verify_svn(None, None, [], 'switch', '--relocate',
+                                     substring, substring, wc_dir)
+  _verify_url(wc_dir, repo_url)
+  
+  # Real relocation to OTHER_REPO_URL.
+  svntest.actions.run_and_verify_svn(None, None, [], 'switch', '--relocate',
+                                     repo_url, other_repo_url, wc_dir)
+  _verify_url(wc_dir, other_repo_url)
+
+  # ... and back again, using the newer 'svn relocate' subcommand.
+  svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
+                                     other_repo_url, repo_url, wc_dir)
+  _verify_url(wc_dir, repo_url)
+
+  # To OTHER_REPO_URL again, this time with the single-URL form of
+  # 'svn relocate'.
+  svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
+                                     other_repo_url, wc_dir)
+  _verify_url(wc_dir, other_repo_url)
+
+  ### TODO: When testing ra_dav or ra_svn, do relocations between
+  ### those and ra_local URLs.
+
+
 ########################################################################
 # Run the tests
 
@@ -2611,6 +2706,8 @@ test_list = [ None,
               SkipUnless(meta_correct_library_being_used,
                          svntest.main.is_ra_type_dav),
               delete_and_add_same_file,
+              delete_child_parent_update,
+              basic_relocate,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/performance/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/copy_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/copy_tests.py Mon Oct 25 17:50:25 2010
@@ -4679,146 +4679,6 @@ def copy_over_deleted_dir(sbox):
   main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/D'),
                os.path.join(sbox.wc_dir, 'A/B'))
 
-#----------------------------------------------------------------------
-
-def check_op_depth(path, expected_result):
-  """Examine the WC DB for paths PATH and below, and check that their rows
-     in the 'NODES' table match EXPECTED_RESULT.  EXPECTED_RESULT is a
-     dictionary of {(op_depth, relpath) -> has_repo_noderev}, where 'relpath'
-     is relative to PATH, and 'has_repo_noderev' is true iff the repository
-     id, revision and relpath columns are expected to be non-null.
-
-     If the result does not match, raise a Failure.
-  """
-
-  errors = []
-
-  db, _, base_relpath = svntest.wc.open_wc_db(path)
-  c = db.cursor()
-
-  c.execute("""SELECT op_depth, presence, local_relpath, repos_id, revision,
-                 repos_path FROM nodes
-               WHERE local_relpath = '""" + base_relpath + """'
-                 OR  local_relpath LIKE '""" + base_relpath + """/%'""")
-  for row in c:
-    op_depth = row[0]
-    wc_relpath = row[2]
-    repo_id = row[3]
-    repo_rev = row[4]
-    repo_relpath = row[5]
-    relpath = wc_relpath[len(base_relpath):]
-
-    try:
-      has_repo = expected_result.pop((op_depth, relpath))
-    except KeyError:
-      errors.append("Row not expected: op_depth=%s, relpath=%s"
-                    % (op_depth, relpath))
-      continue
-
-    try:
-      if has_repo:
-        assert repo_id and repo_rev and repo_relpath
-      else:
-        assert not repo_id and not repo_rev and not repo_relpath
-    except AssertionError:
-      print "  EXPECTED:", op_depth, relpath, has_repo
-      print "  ACTUAL:  ", op_depth, relpath, repo_relpath
-      errors.append("Row op_depth=%s, relpath=%s has repo_relpath=%s"
-                    % (op_depth, relpath, repo_relpath))
-      continue
-
-  for (op_depth, relpath) in expected_result:
-    errors.append("Row not found: op_depth=%s, relpath=%s"
-                  % (op_depth, relpath))
-
-  db.close()
-
-  if errors:
-    raise svntest.Failure(errors)
-
-def nodes_table_wc_wc_copies(sbox):
-  """test wc-to-wc copies"""
-  sbox.build()
-
-  def wc_path(*components):
-    return os.path.join(sbox.wc_dir, *components)
-
-  # Prepare various things to copy
-
-  source_base_file = wc_path('A', 'B', 'lambda')
-  source_base_dir = wc_path('A', 'B', 'E')
-
-  source_added_file = wc_path('A', 'B', 'file-added')
-  source_added_dir = wc_path('A', 'B', 'D-added')
-  source_added_dir2 = wc_path('A', 'B', 'D-added', 'D2')
-
-  svntest.main.file_write(source_added_file, 'New file')
-  sbox.simple_add(source_added_file)
-  sbox.simple_mkdir(source_added_dir)
-  sbox.simple_mkdir(source_added_dir2)
-
-  source_copied_file = wc_path('A', 'B', 'lambda-copied')
-  source_copied_dir = wc_path('A', 'B', 'E-copied')
-
-  svntest.main.run_svn(None, 'copy', source_base_file, source_copied_file)
-  svntest.main.run_svn(None, 'copy', source_base_dir, source_copied_dir)
-
-  # Test copying various things
-
-  # base file
-  target = wc_path('A', 'C', 'copy1')
-  svntest.main.run_svn(None, 'copy', source_base_file, target)
-  check_op_depth(target, { (3, ''):       True })
-
-  # base dir
-  target = wc_path('A', 'C', 'copy2')
-  svntest.main.run_svn(None, 'copy', source_base_dir, target)
-  check_op_depth(target, { (3, ''):       True,
-                           (3, '/alpha'): False,
-                           (3, '/beta'):  False })
-
-  # added file
-  target = wc_path('A', 'C', 'copy3')
-  svntest.main.run_svn(None, 'copy', source_added_file, target)
-  check_op_depth(target, { (3, ''):       False })
-
-  # added dir
-  target = wc_path('A', 'C', 'copy4')
-  svntest.main.run_svn(None, 'copy', source_added_dir, target)
-  check_op_depth(target, { (3, ''):       False,
-                           (4, '/D2'):    False })
-
-  # copied file
-  target = wc_path('A', 'C', 'copy5')
-  svntest.main.run_svn(None, 'copy', source_copied_file, target)
-  check_op_depth(target, { (3, ''):       True })
-
-  # copied dir
-  target = wc_path('A', 'C', 'copy6')
-  svntest.main.run_svn(None, 'copy', source_copied_dir, target)
-  check_op_depth(target, { (3, ''):       True,
-                           (3, '/alpha'): False,
-                           (3, '/beta'):  False })
-
-  # copied tree with everything in it
-  target = wc_path('A', 'C', 'copy7')
-  svntest.main.run_svn(None, 'copy', wc_path('A', 'B'), target)
-  check_op_depth(target, { (3, ''):               True,
-                           (3, '/lambda'):        False,
-                           (3, '/E'):             False,
-                           (3, '/E/alpha'):       False,
-                           (3, '/E/beta'):        False,
-                           (3, '/F'):             False,
-                           # Each add is an op_root
-                           (4, '/file-added'):    False,
-                           (4, '/D-added'):       False,
-                           (5, '/D-added/D2'):    False,
-                           # Each copied-copy subtree is an op_root
-                           (4, '/lambda-copied'): True,
-                           (4, '/E-copied'):      True,
-                           (4, '/E-copied/alpha'):False,
-                           (4, '/E-copied/beta'): False, })
-
 def mixed_rev_copy_del(sbox):
   """copy mixed-rev and delete children"""
   
@@ -4890,6 +4750,61 @@ def mixed_rev_copy_del(sbox):
                                         expected_status,
                                         None,
                                         wc_dir)
+def copy_delete_undo(sbox, use_revert):
+  "copy, delete child, undo"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Copy directory with children
+  svntest.main.run_svn(wc_dir, 'copy',
+                       sbox.ospath('A/B/E'), sbox.ospath('A/B/E-copied'))
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'A/B/E-copied'       : Item(status='A ', copied='+', wc_rev='-'),
+    'A/B/E-copied/alpha' : Item(status='  ', copied='+', wc_rev='-'),
+    'A/B/E-copied/beta'  : Item(status='  ', copied='+', wc_rev='-'),
+    })
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  # Delete a child
+  svntest.main.run_svn(wc_dir, 'rm', sbox.ospath('A/B/E-copied/alpha'))
+  expected_status.tweak('A/B/E-copied/alpha', status='D ', copied=None,
+                        wc_rev='?', entry_rev='1')
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  # Undo the whole copy
+  if (use_revert):
+    svntest.main.run_svn(wc_dir, 'revert', '--recursive',
+                         sbox.ospath('A/B/E-copied'))
+    svntest.main.safe_rmtree(os.path.join(wc_dir, 'A/B/E-copied'))
+  else:
+    svntest.main.run_svn(wc_dir, 'rm', '--force', sbox.ospath('A/B/E-copied'))
+  expected_status.remove('A/B/E-copied',
+                         'A/B/E-copied/alpha',
+                         'A/B/E-copied/beta')
+
+  # Undo via revert FAILs here because a wq item remains
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  # Copy a directory without children.
+  svntest.main.run_svn(wc_dir, 'copy',
+                       sbox.ospath('A/B/F'), sbox.ospath('A/B/E-copied'))
+  expected_status.add({
+    'A/B/E-copied'       : Item(status='A ', copied='+', wc_rev='-'),
+    })
+
+  # Undo via delete FAILs here because the deleted child got left behind
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+def copy_delete_delete(sbox):
+  "copy, delete child, delete copy"
+  copy_delete_undo(sbox, False)
+
+def copy_delete_revert(sbox):
+  "copy, delete child, revert copy"
+  copy_delete_undo(sbox, True)
 
 ########################################################################
 # Run the tests
@@ -4985,8 +4900,9 @@ test_list = [ None,
               XFail(changed_dir_data_should_match_checkout),
               move_added_nodes,
               copy_over_deleted_dir,
-              Wimp("Needs NODES table & op-depth", nodes_table_wc_wc_copies),
               XFail(mixed_rev_copy_del),
+              XFail(copy_delete_delete),
+              XFail(copy_delete_revert),
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout (original)
+++ subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout Mon Oct 25 17:50:25 2010
@@ -36,6 +36,7 @@ Available subcommands:
    propget (pget, pg)
    proplist (plist, pl)
    propset (pset, ps)
+   relocate
    resolve
    resolved
    revert

Modified: subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Mon Oct 25 17:50:25 2010
@@ -50,19 +50,16 @@ Valid options:
                              history
   -c [--change] ARG        : the change made in revision ARG
   --targets ARG            : pass contents of file ARG as additional args
-  --stop-on-copy           : do not cross copies while traversing history
-                             [alias: --soc]
+  --stop-on-copy [--soc]   : do not cross copies while traversing history
   --incremental            : give output suitable for concatenation
   --xml                    : output in XML
   -l [--limit] ARG         : maximum number of log entries
   --with-all-revprops      : retrieve all revision properties
   --with-no-revprops       : retrieve no revision properties
   --with-revprop ARG       : retrieve revision property ARG
-  --show-diff              : produce diff output
-                             [alias: --diff]
+  --show-diff [--diff]     : produce diff output
   --diff-cmd ARG           : use ARG as diff command
-  --internal-diff          : override diff-cmd specified in config file
-                             [alias: --idiff]
+  --internal-diff [--idiff] : override diff-cmd specified in config file
   -x [--extensions] ARG    : Default: '-u'. When Subversion is invoking an
                              external diff program, ARG is simply passed along
                              to the program. But when Subversion is using its
@@ -83,21 +80,19 @@ Valid options:
 Global options:
   --username ARG           : specify a username ARG
   --password ARG           : specify a password ARG
-  --no-auth-cache          : do not cache authentication tokens
-                             [alias: --nac]
+  --no-auth-cache [--nac]  : do not cache authentication tokens
   --non-interactive        : do no interactive prompting
   --trust-server-cert      : accept unknown SSL server certificates without
                              prompting (but only with '--non-interactive')
-  --config-dir ARG         : read user configuration files from directory ARG
-                             [alias: --cd]
+  --config-dir [--cd] ARG  : read user configuration files from directory ARG
   --config-option ARG      : set user configuration option in the format:
                                  FILE:SECTION:OPTION=[VALUE]
                              For example:
                                  servers:global:http-library=serf
 
-switch (sw): Update the working copy to a different URL.
+switch (sw): Update the working copy to a different URL within the same repository.
 usage: 1. switch URL[@PEGREV] [PATH]
-       2. switch --relocate FROM TO [PATH...]
+       2. switch --relocate FROM-PREFIX TO-PREFIX [PATH...]
 
   1. Update the working copy to mirror a new URL within the repository.
      This behavior is similar to 'svn update', and is the way to
@@ -119,22 +114,15 @@ usage: 1. switch URL[@PEGREV] [PATH]
      Use the --set-depth option to set a new working copy depth on the
      targets of this operation.
 
-  2. Rewrite working copy URL metadata to reflect a syntactic change only.
-     This is used when repository's root URL changes (such as a scheme
-     or hostname change) but your working copy still reflects the same
-     directory within the same repository.
-
-     FROM is the root URL which will be relocated from.
-     You can use 'svn info' to determine the root URL of the current
-     working copy directory (look for 'URL:' in its output).
-
-     TO is the root URL which will be relocated to.
+  2. The '--relocate' option is deprecated. This syntax is equivalent to
+     'svn relocate FROM-PREFIX TO-PREFIX [PATH]'.
 
   See also 'svn help update' for a list of possible characters
   reporting the action taken.
 
   Examples:
     svn switch ^/branches/1.x-release
+    svn switch --relocate http:// svn://
     svn switch --relocate http://www.example.com/repo/project \
                           svn://svn.example.com/repo/project
 
@@ -150,14 +138,12 @@ Valid options:
   -N [--non-recursive]     : obsolete; try --depth=files or --depth=immediates
   --depth ARG              : limit operation by depth ARG ('empty', 'files',
                              'immediates', or 'infinity')
-  --set-depth ARG          : set new working copy depth to ARG ('exclude',
+  --set-depth [--sd] ARG   : set new working copy depth to ARG ('exclude',
                              'empty', 'files', 'immediates', or 'infinity')
-                             [alias: --sd]
   -q [--quiet]             : print nothing, or only summary information
   --diff3-cmd ARG          : use ARG as merge command
   --relocate               : relocate via URL-rewriting
-  --ignore-externals       : ignore externals definitions
-                             [alias: --ie]
+  --ignore-externals [--ie] : ignore externals definitions
   --force                  : force operation to run
   --accept ARG             : specify automatic conflict resolution action
                              ('postpone', 'base', 'mine-conflict',
@@ -167,13 +153,11 @@ Valid options:
 Global options:
   --username ARG           : specify a username ARG
   --password ARG           : specify a password ARG
-  --no-auth-cache          : do not cache authentication tokens
-                             [alias: --nac]
+  --no-auth-cache [--nac]  : do not cache authentication tokens
   --non-interactive        : do no interactive prompting
   --trust-server-cert      : accept unknown SSL server certificates without
                              prompting (but only with '--non-interactive')
-  --config-dir ARG         : read user configuration files from directory ARG
-                             [alias: --cd]
+  --config-dir [--cd] ARG  : read user configuration files from directory ARG
   --config-option ARG      : set user configuration option in the format:
                                  FILE:SECTION:OPTION=[VALUE]
                              For example:

Modified: subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout (original)
+++ subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout Mon Oct 25 17:50:25 2010
@@ -36,6 +36,7 @@ Available subcommands:
    propget (pget, pg)
    proplist (plist, pl)
    propset (pset, ps)
+   relocate
    resolve
    resolved
    revert

Modified: subversion/branches/performance/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/lock_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/lock_tests.py Mon Oct 25 17:50:25 2010
@@ -37,6 +37,24 @@ XFail = svntest.testcase.XFail
 Item = svntest.wc.StateItem
 
 ######################################################################
+# Helpers
+
+def check_writability(path, writable):
+  bits = stat.S_IWGRP | stat.S_IWOTH | stat.S_IWRITE
+  mode = os.stat(path)[0]
+  if bool(mode & bits) != writable:
+    raise svntest.Failure("path '%s' is unexpectedly %s (mode %o)"
+                          % (path, ["writable", "read-only"][writable], mode))
+
+def is_writable(path):
+  "Raise if PATH is not writable."
+  check_writability(path, True)
+
+def is_readonly(path):
+  "Raise if PATH is not readonly."
+  check_writability(path, False)
+
+######################################################################
 # Tests
 
 #----------------------------------------------------------------------
@@ -1573,6 +1591,48 @@ def replace_and_propset_locked_path(sbox
                                      'commit', '-m', '', G_path)
 
 
+#----------------------------------------------------------------------
+def cp_isnt_ro(sbox):
+  "uncommitted svn:needs-lock add/cp not read-only"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  mu_URL = sbox.repo_url + '/A/mu'
+  mu_path = os.path.join(wc_dir, 'A', 'mu')
+  mu2_path = os.path.join(wc_dir, 'A', 'mu2')
+  mu3_path = os.path.join(wc_dir, 'A', 'mu3')
+  kappa_path = os.path.join(wc_dir, 'kappa')
+  open(kappa_path, 'w').write("This is the file 'kappa'.\n")
+
+  ## added file
+  sbox.simple_add(kappa_path)
+  svntest.actions.set_prop('svn:needs-lock', 'yes', kappa_path)
+  is_writable(kappa_path)
+  sbox.simple_commit(kappa_path)
+  is_readonly(kappa_path)
+
+  ## versioned file
+  svntest.actions.set_prop('svn:needs-lock', 'yes', mu_path)
+  is_writable(mu_path)
+  sbox.simple_commit(mu_path)
+  is_readonly(mu_path)
+
+  # At this point, mu has 'svn:needs-lock' set
+
+  ## wc->wc copied file
+  svntest.main.run_svn(None, 'copy', mu_path, mu2_path)
+  is_writable(mu2_path)
+  sbox.simple_commit(mu2_path)
+  is_readonly(mu2_path)
+
+  ## URL->wc copied file
+  svntest.main.run_svn(None, 'copy', mu_URL, mu3_path)
+  is_writable(mu3_path)
+  sbox.simple_commit(mu3_path)
+  is_readonly(mu3_path)
+
+
 ########################################################################
 # Run the tests
 
@@ -1619,6 +1679,7 @@ test_list = [ None,
               verify_path_escaping,
               XFail(replace_and_propset_locked_path,
                     svntest.main.is_ra_type_dav),
+              cp_isnt_ro,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/performance/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/merge_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/merge_tests.py Mon Oct 25 17:50:25 2010
@@ -11830,7 +11830,7 @@ def subtree_merges_dont_intersect_with_t
 
   # Repeat the forward merge
   expected_output = expected_merge_output(
-    [[5],[8,9],[5,9]],
+    [[5],[8],[5,9]],
     ['U    %s\n' % (rho_COPY_2_path),
      'U    %s\n' % (psi_COPY_2_path),
      ' U   %s\n' % (H_COPY_2_path),
@@ -13678,7 +13678,7 @@ def subtree_gets_changes_even_if_ultimat
                                        expected_elision_output,
                                        expected_disk,
                                        expected_status, expected_skip,
-                                       None, None, None, None, None, 1)
+                                       None, None, None, None, None, 1, 0)
 
 #----------------------------------------------------------------------
 def no_self_referential_filtering_on_added_path(sbox):
@@ -13958,8 +13958,8 @@ def merge_range_prior_to_rename_source_e
   # the reverse merge we performed in r11; the only operative change
   # here is the text mod to alpha made in r9.
   #
-  # This merge currently fails because the delete half of the A_COPY/D/H/nu
-  # to A_COPY/D/H/nu_moved move is reported in the notifications, but doesn't
+  # This merge previously failed because the delete half of the A_COPY/D/H/nu
+  # to A_COPY/D/H/nu_moved move was reported in the notifications, but didn't
   # actually happen.
   expected_output = wc.State(A_COPY_path, {
     'B/E/alpha'    : Item(status='U '),
@@ -14027,7 +14027,7 @@ def merge_range_prior_to_rename_source_e
                                        expected_status,
                                        expected_skip,
                                        None, None, None, None,
-                                       None, 1, 1)
+                                       None, 1, 0)
   svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
                                      'Merge -r7:12 from A to A_COPY', wc_dir)
 
@@ -14090,9 +14090,9 @@ def merge_range_prior_to_rename_source_e
   # We can only reverse merge changes from the explicit mergeinfo or
   # natural history of a target, but since all of these changes intersect with
   # the target's explicit mergeinfo (including subtrees), all should be
-  # reverse merged, including the deletion of A_COPY/D/H/nu.  However, like
-  # the forward merge performed earlier, A_COPY/D/H/nu is reported as deleted,
-  # but still remains as a versioned item in the WC.
+  # reverse merged, including the deletion of A_COPY/D/H/nu.  Like the forward
+  # merge performed earlier, this test previously failed when A_COPY/D/H/nu
+  # was reported as deleted, but still remained as a versioned item in the WC.
   expected_output = wc.State(A_COPY_2_path, {
     'B/E/alpha'    : Item(status='U '),
     'D/H/nu'       : Item(status='D '),
@@ -16210,8 +16210,8 @@ test_list = [ None,
                          server_has_mergeinfo),
               SkipUnless(no_self_referential_filtering_on_added_path,
                          server_has_mergeinfo),
-              XFail(SkipUnless(merge_range_prior_to_rename_source_existence,
-                               server_has_mergeinfo)),
+              SkipUnless(merge_range_prior_to_rename_source_existence,
+                         server_has_mergeinfo),
               SkipUnless(dont_merge_gaps_in_history,
                          server_has_mergeinfo),
               SkipUnless(mergeinfo_deleted_by_a_merge_should_disappear,

Modified: subversion/branches/performance/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/patch_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/patch_tests.py Mon Oct 25 17:50:25 2010
@@ -671,7 +671,7 @@ def patch_chopped_leading_spaces(sbox):
 
 
 def patch_strip1(sbox):
-  "patch with --strip-count 1"
+  "patch with --strip 1"
 
   sbox.build()
   wc_dir = sbox.wc_dir
@@ -838,7 +838,7 @@ def patch_strip1(sbox):
                                        None, # expected err
                                        1, # check-props
                                        1, # dry-run
-                                       '--strip-count', '1')
+                                       '--strip', '1')
 
 def patch_no_index_line(sbox):
   "patch with no index lines"

Modified: subversion/branches/performance/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/prop_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/prop_tests.py Mon Oct 25 17:50:25 2010
@@ -164,7 +164,15 @@ def update_props(sbox):
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.tweak('A/mu', 'A/D/H', wc_rev=2, status='  ')
 
-  # Commit the one file.
+  # Commit property mods
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+                                        expected_status,
+                                        None, wc_dir)
+
+  # Add more properties
+  sbox.simple_propset('blue2', 'azul2', mu_path)
+  sbox.simple_propset('red2', 'rojo2', H_path)
+  expected_status.tweak('A/mu', 'A/D/H', wc_rev=3, status='  ')
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         expected_status,
                                         None, wc_dir)
@@ -190,11 +198,27 @@ def update_props(sbox):
   expected_status.tweak('A/mu', 'A/D/H', status='  ')
 
   # Do the update and check the results in three ways... INCLUDING PROPS
+  # This adds properties to nodes that have none
   svntest.actions.run_and_verify_update(wc_backup,
                                         expected_output,
                                         expected_disk,
                                         expected_status,
-                                        None, None, None, None, None, 1)
+                                        None, None, None, None, None, 1,
+                                        '-r', '2', wc_backup)
+
+  # This adds properties to nodes that have properties
+  expected_status.tweak(wc_rev=3)
+  expected_disk.tweak('A/mu', props={'blue'  : 'azul',
+                                     'blue2' : 'azul2'})
+  expected_disk.tweak('A/D/H', props={'red'  : 'rojo',
+                                      'red2' : 'rojo2'})
+  svntest.actions.run_and_verify_update(wc_backup,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None, None, None, None, 1,
+                                        '-r', '3', wc_backup)
+
 
 #----------------------------------------------------------------------
 

Modified: subversion/branches/performance/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/revert_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/revert_tests.py Mon Oct 25 17:50:25 2010
@@ -847,15 +847,7 @@ def status_of_missing_dir_after_revert_r
                                        dry_run = 0)
 
   # now test if the revert works ok
-  revert_paths = [G_path,
-                  os.path.join(G_path, 'alpha'),
-                  os.path.join(G_path, 'beta')]
-
-  if svntest.main.wc_is_singledb(wc_dir):
-    # These nodes are not lost in single-db
-    revert_paths += [ os.path.join(G_path, 'pi'),
-                      os.path.join(G_path, 'rho'),
-                      os.path.join(G_path, 'tau')]
+  revert_paths = [G_path]
 
   expected_output = svntest.verify.UnorderedOutput([
     "Reverted '%s'\n" % path for path in revert_paths])

Modified: subversion/branches/performance/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/svntest/main.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/svntest/main.py Mon Oct 25 17:50:25 2010
@@ -1271,9 +1271,13 @@ def run_one_test(n, test_list, finished_
   If we're running the tests in parallel spawn the test in a new process.
   """
 
-  if (n < 1) or (n > len(test_list) - 1):
+  # allow N to be negative, so './basic_tests.py -- -1' works
+  num_tests = len(test_list) - 1
+  if (n == 0) or (abs(n) > num_tests):
     print("There is no test %s.\n" % n)
     return 1
+  if n < 0:
+    n += 1+num_tests
 
   # Run the test.
   exit_code = TestRunner(test_list[n], n).run()

Modified: subversion/branches/performance/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/switch_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/switch_tests.py Mon Oct 25 17:50:25 2010
@@ -1068,18 +1068,17 @@ def relocate_beyond_repos_root(sbox):
   
   svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 0)
   
-
   # A relocate that changes the repo path part of the URL shouldn't work.
   # This tests for issue #2380.
   svntest.actions.run_and_verify_svn(None, None,
-                                     ".*Given destination URL invalid.*",
+                                     ".*Invalid destination URL.*",
                                      'switch', '--relocate',
                                      A_url, other_B_url, A_wc_dir)
 
   # Another way of trying to change the fs path, leading to an invalid
   # repository root.
   svntest.actions.run_and_verify_svn(None, None,
-                                     ".*Given source URL invalid.*",
+                                     ".*is not the root.*",
                                      'switch', '--relocate',
                                      repo_url, other_B_url, A_wc_dir)
 

Modified: subversion/branches/performance/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/upgrade_tests.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/upgrade_tests.py Mon Oct 25 17:50:25 2010
@@ -654,6 +654,23 @@ def delete_and_keep_local(sbox):
     raise svntest.Failure('wc/Deleted should not exist')
 
 
+def dirs_only_upgrade(sbox):
+  "upgrade a wc without files" 
+
+  sbox.build(create_wc = False)
+  replace_sbox_with_tarfile(sbox, 'dirs-only.tar.bz2')
+
+  expected_output = ["Upgraded '%s'.\n" % (sbox.ospath('').rstrip(os.path.sep)),
+                     "Upgraded '%s'.\n" % (sbox.ospath('A'))]
+
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'upgrade', sbox.wc_dir)
+
+  expected_status = svntest.wc.State(sbox.wc_dir, {
+      ''                  : Item(status='  ', wc_rev='1'),
+      'A'                 : Item(status='  ', wc_rev='1'),
+      })
+  run_and_verify_status_no_server(sbox.wc_dir, expected_status)
 
 ########################################################################
 # Run the tests
@@ -675,6 +692,7 @@ test_list = [ None,
               missing_dirs,
               missing_dirs2,
               XFail(delete_and_keep_local),
+              dirs_only_upgrade,
              ]
 
 

Modified: subversion/branches/performance/subversion/tests/libsvn_diff/parse-diff-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/libsvn_diff/parse-diff-test.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/branches/performance/subversion/tests/libsvn_diff/parse-diff-test.c Mon Oct 25 17:50:25 2010
@@ -301,10 +301,7 @@ check_content(svn_diff_hunk_t *hunk, svn
     SVN_TEST_ASSERT(exp_eof == hunk_eof);
     if (exp_eof)
       break;
-    if (strcmp(exp_buf->data, hunk_buf->data))
-      return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
-                               "Expected '%s' but was '%s'", exp_buf->data,
-                               hunk_buf->data);
+    SVN_TEST_STRING_ASSERT(exp_buf->data, hunk_buf->data);
   }
 
   SVN_TEST_ASSERT(hunk_buf->len == 0);
@@ -345,8 +342,8 @@ test_parse_unidiff(apr_pool_t *pool)
                                         ignore_whitespace, iterpool, 
                                         iterpool));
       SVN_TEST_ASSERT(patch);
-      SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/C/gamma"));
-      SVN_TEST_ASSERT(! strcmp(patch->new_filename, "A/C/gamma"));
+      SVN_TEST_STRING_ASSERT(patch->old_filename, "A/C/gamma");
+      SVN_TEST_STRING_ASSERT(patch->new_filename, "A/C/gamma");
       SVN_TEST_ASSERT(patch->hunks->nelts == 1);
 
       hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
@@ -365,13 +362,13 @@ test_parse_unidiff(apr_pool_t *pool)
       SVN_TEST_ASSERT(patch);
       if (reverse)
         {
-          SVN_TEST_ASSERT(! strcmp(patch->new_filename, "A/D/gamma.orig"));
-          SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/D/gamma"));
+          SVN_TEST_STRING_ASSERT(patch->new_filename, "A/D/gamma.orig");
+          SVN_TEST_STRING_ASSERT(patch->old_filename, "A/D/gamma");
         }
       else
         {
-          SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/D/gamma.orig"));
-          SVN_TEST_ASSERT(! strcmp(patch->new_filename, "A/D/gamma"));
+          SVN_TEST_STRING_ASSERT(patch->old_filename, "A/D/gamma.orig");
+          SVN_TEST_STRING_ASSERT(patch->new_filename, "A/D/gamma");
         }
       SVN_TEST_ASSERT(patch->hunks->nelts == 1);
 
@@ -409,8 +406,8 @@ test_parse_git_diff(apr_pool_t *pool)
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/mu"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "A/mu"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "A/mu");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "A/mu");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_deleted);
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
 
@@ -420,8 +417,8 @@ test_parse_git_diff(apr_pool_t *pool)
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/C/gamma"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "A/C/gamma"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "A/C/gamma");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "A/C/gamma");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_modified);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
@@ -443,8 +440,8 @@ test_parse_git_diff(apr_pool_t *pool)
                                     pool, pool));
 
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "iota"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "iota.copied"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "iota");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "iota.copied");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_copied);
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
 
@@ -455,8 +452,8 @@ test_parse_git_diff(apr_pool_t *pool)
                                     pool, pool));
 
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "new"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "new"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "new");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "new");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
 
@@ -482,8 +479,8 @@ test_parse_git_tree_and_text_diff(apr_po
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "iota"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "iota.copied"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "iota");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "iota.copied");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_copied);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
@@ -504,8 +501,8 @@ test_parse_git_tree_and_text_diff(apr_po
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/mu"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "A/mu.moved"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "A/mu");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "A/mu.moved");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_moved);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
@@ -525,8 +522,8 @@ test_parse_git_tree_and_text_diff(apr_po
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "/dev/null"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "new"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "/dev/null");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "new");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
@@ -545,8 +542,8 @@ test_parse_git_tree_and_text_diff(apr_po
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/B/lambda"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "/dev/null"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "A/B/lambda");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "/dev/null");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_deleted);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
@@ -579,8 +576,8 @@ test_bad_git_diff_headers(apr_pool_t *po
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "iota"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "iota.copied"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "iota");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "iota.copied");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_copied);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
@@ -617,8 +614,8 @@ test_parse_property_diff(apr_pool_t *poo
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "iota"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "iota"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "iota");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "iota");
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
   SVN_TEST_ASSERT(apr_hash_count(patch->prop_patches) == 3);
 
@@ -720,8 +717,8 @@ test_parse_property_and_text_diff(apr_po
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "iota"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "iota"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "iota");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "iota");
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   SVN_TEST_ASSERT(apr_hash_count(patch->prop_patches) == 1);
 
@@ -775,8 +772,8 @@ test_parse_diff_symbols_in_prop_unidiff(
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "iota"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "iota"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "iota");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "iota");
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
   SVN_TEST_ASSERT(apr_hash_count(patch->prop_patches) == 3);
 
@@ -873,8 +870,8 @@ test_git_diffs_with_spaces_diff(apr_pool
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "path 1"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "path 1"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "path 1");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "path 1");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
   
@@ -883,8 +880,8 @@ test_git_diffs_with_spaces_diff(apr_pool
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "path one 1"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "path one 1"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "path one 1");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "path one 1");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
 
@@ -893,8 +890,8 @@ test_git_diffs_with_spaces_diff(apr_pool
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "dir/ b/path"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "dir/ b/path"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, "dir/ b/path");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, "dir/ b/path");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
 
@@ -903,8 +900,8 @@ test_git_diffs_with_spaces_diff(apr_pool
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_TEST_ASSERT(! strcmp(patch->old_filename, " b/path 1"));
-  SVN_TEST_ASSERT(! strcmp(patch->new_filename, " b/path 1"));
+  SVN_TEST_STRING_ASSERT(patch->old_filename, " b/path 1");
+  SVN_TEST_STRING_ASSERT(patch->new_filename, " b/path 1");
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
   SVN_TEST_ASSERT(patch->hunks->nelts == 0);
 

Propchange: subversion/branches/performance/subversion/tests/libsvn_wc/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Oct 25 17:50:25 2010
@@ -6,3 +6,4 @@ fake-wc
 pristine-store-test
 svn-test-work
 entries-compat-test
+op-depth-test

Modified: subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c Mon Oct 25 17:50:25 2010
@@ -189,15 +189,15 @@ static const char * const TESTING_DATA =
   "  0, null, 'file', '()', null, null, null, null, null, null,"
   "  null, null, null, null);"
   "insert into nodes values ("
-  "  1, 'J/J-b', 1, 'J', 2, 'some/dir', 2, 'normal',"
+  "  1, 'J/J-b', 2, 'J', 2, 'some/dir', 2, 'normal',"
   "  0, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "',"
   "  null, null, null, null);"
   "insert into nodes values ("
-  "  1, 'J/J-b/J-b-a', 1, 'J/J-b', 2, 'another/dir', 2, 'normal',"
+  "  1, 'J/J-b/J-b-a', 3, 'J/J-b', 2, 'another/dir', 2, 'normal',"
   "  0, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "',"
   "  null, null, null, null);"
   "insert into nodes values ("
-  "  1, 'J/J-b/J-b-b', 1, 'J/J-b', null, null, null, 'normal',"
+  "  1, 'J/J-b/J-b-b', 2, 'J/J-b', null, null, 2, 'normal',"
   "  0, null, 'file', '()', null, null, null, null, null, null,"
   "  null, null, null, null);"
   "insert into nodes values ("
@@ -209,7 +209,7 @@ static const char * const TESTING_DATA =
   "  0, null, 'dir', '()', null, null, null, null, null, null,"
   "  null, null, null, null);"
   "insert into nodes values ("
-  "  1, 'J/J-d', 1, 'J', 2, 'moved/file', 2, 'normal',"
+  "  1, 'J/J-d', 2, 'J', 2, 'moved/file', 2, 'normal',"
   "  1, null, 'file', '()', null, '$md5 $" MD5_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "',"
   "  10, null, null, null);"
   "insert into nodes values ("
@@ -580,38 +580,41 @@ validate_node(svn_wc__db_t *db,
     }
 
   value = apr_hash_get(props, "p1", APR_HASH_KEY_STRING);
-  SVN_TEST_ASSERT(value != NULL && strcmp(value->data, "v1") == 0);
+  SVN_TEST_STRING_ASSERT(value->data, "v1");
   SVN_ERR(svn_wc__db_base_get_prop(&value, db, path, "p1",
                                    scratch_pool, scratch_pool));
-  SVN_TEST_ASSERT(value != NULL && strcmp(value->data, "v1") == 0);
+  SVN_TEST_STRING_ASSERT(value->data, "v1");
 
   value = apr_hash_get(props, "for-file", APR_HASH_KEY_STRING);
-  SVN_TEST_ASSERT(value != NULL && strcmp(value->data, relpath) == 0);
+  SVN_TEST_STRING_ASSERT(value->data, relpath);
   SVN_ERR(svn_wc__db_base_get_prop(&value, db, path, "for-file",
                                    scratch_pool, scratch_pool));
-  SVN_TEST_ASSERT(value != NULL && strcmp(value->data, relpath) == 0);
+  SVN_TEST_STRING_ASSERT(value->data, relpath);
 
   SVN_ERR(svn_wc__db_read_props(&props, db, path,
                                 scratch_pool, scratch_pool));
   SVN_TEST_ASSERT(props != NULL);
   value = apr_hash_get(props, "p1", APR_HASH_KEY_STRING);
-  SVN_TEST_ASSERT(value != NULL && strcmp(value->data, "v1") == 0);
+  SVN_TEST_STRING_ASSERT(value->data, "v1");
 
   SVN_ERR(svn_wc__db_read_pristine_props(&props, db, path,
                                          scratch_pool, scratch_pool));
   SVN_TEST_ASSERT(props != NULL);
   value = apr_hash_get(props, "p1", APR_HASH_KEY_STRING);
-  SVN_TEST_ASSERT(value != NULL && strcmp(value->data, "v1") == 0);
+  SVN_TEST_STRING_ASSERT(value->data, "v1");
 
   /* Now add a property value and read it back (all on actual) */
-  apr_hash_set(props, "p999", APR_HASH_KEY_STRING, value);
-
-  SVN_ERR(svn_wc__db_op_set_props(db, path, props, NULL, NULL, scratch_pool));
-  SVN_ERR(svn_wc__db_read_props(&props, db, path,
-                                scratch_pool, scratch_pool));
-  SVN_TEST_ASSERT(props != NULL);
-  value = apr_hash_get(props, "p999", APR_HASH_KEY_STRING);
-  SVN_TEST_ASSERT(value != NULL && strcmp(value->data, "v1") == 0);
+  {
+    apr_hash_t *actual_props = apr_hash_copy(scratch_pool, props);
+    apr_hash_set(actual_props, "p999", APR_HASH_KEY_STRING, value);
+    SVN_ERR(svn_wc__db_op_set_props(db, path, actual_props,
+                                    NULL, NULL, scratch_pool));
+    SVN_ERR(svn_wc__db_read_props(&props, db, path,
+                                  scratch_pool, scratch_pool));
+    SVN_TEST_ASSERT(props != NULL);
+    value = apr_hash_get(props, "p999", APR_HASH_KEY_STRING);
+    SVN_TEST_STRING_ASSERT(value->data, "v1");
+  }
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c Mon Oct 25 17:50:25 2010
@@ -531,7 +531,7 @@ test_access_baton_like_locking(apr_pool_
                       SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
   SVN_ERR(svn_wc_locked(&locked, D3, pool));
   SVN_TEST_ASSERT(locked);
-  SVN_ERR(svn_wc_revert3(D, adm_access, -1, FALSE,
+  SVN_ERR(svn_wc_revert3(D, adm_access, svn_depth_infinity, FALSE,
                          NULL, NULL, NULL, NULL, NULL, pool));
   SVN_ERR(svn_wc_locked(&locked, D3, pool));
   SVN_TEST_ASSERT(!locked);

Modified: subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c Mon Oct 25 17:50:25 2010
@@ -48,18 +48,10 @@
 #include "private/svn_wc_private.h"
 
 #include "../svn_test.h"
-#include "../svn_test_fs.h"
+#include "../svn_test_utils.h"
 
 
-#define REPOSITORIES_WORK_DIR "svn-test-work/repositories"
-#define WCS_WORK_DIR "svn-test-work/working-copies"
-
-/* Create an empty repository and WC for the test TEST_NAME, and open a WC
- * DB context.  Set *REPOS_URL to the URL of the new repository, *WC_ABSPATH
- * to the root path of the new WC, and *DB to a new DB context.
- *
- * Create the repository and WC in subdirectories called repos/TEST_NAME and
- * wcs/TEST_NAME respectively, within the current working directory. */
+/* Create repos and WC, and also set *DB to a new DB context. */
 static svn_error_t *
 create_repos_and_wc(const char **repos_url,
                     const char **wc_abspath,
@@ -68,41 +60,8 @@ create_repos_and_wc(const char **repos_u
                     const svn_test_opts_t *opts,
                     apr_pool_t *pool)
 {
-  const char *repos_path = svn_relpath_join(REPOSITORIES_WORK_DIR, test_name,
-                                            pool);
-  const char *wc_path = svn_relpath_join(WCS_WORK_DIR, test_name, pool);
-
-  /* Remove the repo and WC dirs if they already exist, to ensure the test
-   * will run even if a previous failed attempt was not cleaned up. */
-  SVN_ERR(svn_io_remove_dir2(repos_path, TRUE, NULL, NULL, pool));
-  SVN_ERR(svn_io_remove_dir2(wc_path, TRUE, NULL, NULL, pool));
-
-  /* Create the parent dirs of the repo and WC if necessary. */
-  SVN_ERR(svn_io_make_dir_recursively(REPOSITORIES_WORK_DIR, pool));
-  SVN_ERR(svn_io_make_dir_recursively(WCS_WORK_DIR, pool));
-
-  /* Create a repos and set *REPOS_URL to its path. */
-  {
-    svn_repos_t *repos;
-
-    SVN_ERR(svn_test__create_repos(&repos, repos_path, opts, pool));
-    SVN_ERR(svn_uri_get_file_url_from_dirent(repos_url, repos_path, pool));
-  }
-
-  /* Create a WC */
-  {
-    svn_client_ctx_t *ctx;
-    svn_opt_revision_t head_rev = { svn_opt_revision_head, {0} };
-
-    SVN_ERR(svn_client_create_context(&ctx, pool));
-    /* SVN_ERR(svn_config_get_config(&ctx->config, config_dir, pool)); */
-    SVN_ERR(svn_dirent_get_absolute(wc_abspath, wc_path, pool));
-    SVN_ERR(svn_client_checkout3(NULL, *repos_url, *wc_abspath,
-                                 &head_rev, &head_rev, svn_depth_infinity,
-                                 FALSE /* ignore_externals */,
-                                 FALSE /* allow_unver_obstructions */,
-                                 ctx, pool));
-  }
+  SVN_ERR(svn_test__create_repos_and_wc(repos_url, wc_abspath, test_name,
+                                        opts, pool));
 
   /* Open a DB context */
   SVN_ERR(svn_wc__db_open(db, svn_wc__db_openmode_readonly, NULL,

Modified: subversion/branches/performance/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/svn_test_main.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/svn_test_main.c (original)
+++ subversion/branches/performance/subversion/tests/svn_test_main.c Mon Oct 25 17:50:25 2010
@@ -191,9 +191,12 @@ do_test_num(const char *progname,
   svn_boolean_t test_failed;
   const char *msg = NULL;  /* the message this individual test prints out */
   const struct svn_test_descriptor_t *desc;
+  const int array_size = get_array_size();
 
   /* Check our array bounds! */
-  if ((test_num > get_array_size()) || (test_num <= 0))
+  if (test_num < 0)
+    test_num += array_size + 1;
+  if ((test_num > array_size) || (test_num <= 0))
     {
       printf("FAIL: %s: THERE IS NO TEST NUMBER %2d\n", progname, test_num);
       skip_cleanup = TRUE;
@@ -424,9 +427,12 @@ main(int argc, const char *argv[])
         {
           for (i = 1; i < argc; i++)
             {
-              if (svn_ctype_isdigit(argv[i][0]))
+              if (svn_ctype_isdigit(argv[i][0]) || argv[i][0] == '-')
                 {
                   int test_num = atoi(argv[i]);
+                  if (test_num == 0)
+                    /* A --option argument, most likely. */
+                    continue;
 
                   ran_a_test = TRUE;
                   if (do_test_num(prog_name, test_num, FALSE, &opts, test_pool))

Modified: subversion/branches/performance/tools/dev/wc-format.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/tools/dev/wc-format.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/tools/dev/wc-format.py (original)
+++ subversion/branches/performance/tools/dev/wc-format.py Mon Oct 25 17:50:25 2010
@@ -4,11 +4,14 @@ import os
 import sqlite3
 import sys
 
+MIN_SINGLE_DB_FORMAT = 19
 
-def print_format(wc_path):
+def get_format(wc_path):
   entries = os.path.join(wc_path, '.svn', 'entries')
   wc_db = os.path.join(wc_path, '.svn', 'wc.db')
 
+  formatno = 'not under version control'
+
   if os.path.exists(entries):
     formatno = int(open(entries).readline())
   elif os.path.exists(wc_db):
@@ -16,15 +19,23 @@ def print_format(wc_path):
     curs = conn.cursor()
     curs.execute('pragma user_version;')
     formatno = curs.fetchone()[0]
-  else:
-    formatno = 'not under version control'
+  elif os.path.exists(wc_path):
+    parent_path = os.path.dirname(os.path.abspath(wc_path))
+    if wc_path != parent_path:
+      formatno = get_format(parent_path)
+      if formatno >= MIN_SINGLE_DB_FORMAT:
+      	return formatno
 
+  return formatno
+
+def print_format(wc_path):
   # see subversion/libsvn_wc/wc.h for format values and information
   #   1.0.x -> 1.3.x: format 4
   #   1.4.x: format 8
   #   1.5.x: format 9
   #   1.6.x: format 10
   #   1.7.x: format XXX
+  formatno = get_format(wc_path)
   print '%s: %s' % (wc_path, formatno)
 
 

Modified: subversion/branches/performance/tools/diff/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/tools/diff/diff.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/tools/diff/diff.c (original)
+++ subversion/branches/performance/tools/diff/diff.c Mon Oct 25 17:50:25 2010
@@ -1,4 +1,4 @@
-/* diff-test.c -- test driver for text diffs
+/* diff.c -- test driver for text diffs
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
   svn_err = svn_stream_for_stdout(&ostream, pool);
   if (svn_err)
     {
-      svn_handle_error2(svn_err, stdout, FALSE, "diff-test: ");
+      svn_handle_error2(svn_err, stdout, FALSE, "diff: ");
       rc = 2;
     }
   else if (argc == 3)
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
         }
       else
         {
-          svn_handle_error2(svn_err, stdout, FALSE, "diff-test: ");
+          svn_handle_error2(svn_err, stdout, FALSE, "diff: ");
           rc = 2;
         }
     }