subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1813173 [6/6] - in /subversion/branches/addremove: ./ build/generator/ subversion/bindings/javahl/native/ subversion/bindings/swig/include/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_ra_serf...
Date Tue, 24 Oct 2017 12:40:48 GMT
Modified: subversion/branches/addremove/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/svn/svn.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/svn/svn.c (original)
+++ subversion/branches/addremove/subversion/svn/svn.c Tue Oct 24 12:40:47 2017
@@ -402,7 +402,9 @@ const apr_getopt_option_t svn_cl__option
   {"show-inherited-props", opt_show_inherited_props, 0,
                        N_("retrieve properties set on parents of the target")},
   {"search", opt_search, 1,
-                       N_("use ARG as search pattern (glob syntax)")},
+                       N_("use ARG as search pattern (glob syntax, case-\n"
+                       "                             "
+                       "and accent-insensitive)")},
   {"search-and", opt_search_and, 1,
                        N_("combine ARG with the previous search pattern")},
   {"log", opt_mergeinfo_log, 0,
@@ -817,6 +819,10 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  The default TARGET is '.', meaning the repository URL of the current\n"
      "  working directory.\n"
      "\n"
+     "  Multiple --search patterns may be specified and the output will be\n"
+     "  reduced to those paths whose last segment - i.e. the file or directory\n"
+     "  name - matches at least one of these patterns.\n"
+     "\n"
      "  With --verbose, the following fields will be shown for each item:\n"
      "\n"
      "    Revision number of the last commit\n"

Modified: subversion/branches/addremove/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/svnadmin/svnadmin.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/addremove/subversion/svnadmin/svnadmin.c Tue Oct 24 12:40:47 2017
@@ -151,7 +151,11 @@ enum svnadmin__cmdline_options_t
     svnadmin__compatible_version,
     svnadmin__check_normalization,
     svnadmin__metadata_only,
-    svnadmin__no_flush_to_disk
+    svnadmin__no_flush_to_disk,
+    svnadmin__normalize_props,
+    svnadmin__exclude,
+    svnadmin__include,
+    svnadmin__glob
   };
 
 /* Option codes and descriptions.
@@ -274,6 +278,22 @@ static const apr_getopt_option_t options
      N_("disable flushing to disk during the operation\n"
         "                             (faster, but unsafe on power off)")},
 
+    {"normalize-props", svnadmin__normalize_props, 0,
+     N_("normalize property values found in the dumpstream\n"
+        "                             (currently, only translates non-LF line endings)")},
+
+    {"exclude", svnadmin__exclude, 1,
+     N_("filter out nodes with given prefix(es) from dump")},
+
+    {"include", svnadmin__include, 1,
+     N_("filter out nodes without given prefix(es) from dump")},
+
+    {"pattern", svnadmin__glob, 0,
+     N_("treat the path prefixes as file glob patterns.\n"
+        "                             Glob special characters are '*' '?' '[]' and '\\'.\n"
+        "                             Character '/' is not treated specially, so\n"
+        "                             pattern /*/foo matches paths /a/foo and /a/b/foo.") },
+
     {NULL}
   };
 
@@ -330,8 +350,13 @@ static const svn_opt_subcommand_desc2_t
     "only the paths changed in that revision; otherwise it will describe\n"
     "every path present in the repository as of that revision.  (In either\n"
     "case, the second and subsequent revisions, if any, describe only paths\n"
-    "changed in those revisions.)\n"),
-  {'r', svnadmin__incremental, svnadmin__deltas, 'q', 'M', 'F'},
+    "changed in those revisions.)\n"
+    "\n"
+    "Using --exclude or --include gives results equivalent to authz-based\n"
+    "path exclusions. In particular, when the source of a copy is\n"
+    "excluded, the copy is transformed into an add (unlike in 'svndumpfilter').\n"),
+  {'r', svnadmin__incremental, svnadmin__deltas, 'q', 'M', 'F',
+   svnadmin__exclude, svnadmin__include, svnadmin__glob },
   {{'F', N_("write to file ARG instead of stdout")}} },
 
   {"dump-revprops", subcommand_dump_revprops, {0}, N_
@@ -396,7 +421,8 @@ static const svn_opt_subcommand_desc2_t
    {'q', 'r', svnadmin__ignore_uuid, svnadmin__force_uuid,
     svnadmin__ignore_dates,
     svnadmin__use_pre_commit_hook, svnadmin__use_post_commit_hook,
-    svnadmin__parent_dir, svnadmin__bypass_prop_validation, 'M',
+    svnadmin__parent_dir, svnadmin__normalize_props,
+    svnadmin__bypass_prop_validation, 'M',
     svnadmin__no_flush_to_disk, 'F'},
    {{'F', N_("read from file ARG instead of stdin")}} },
 
@@ -407,8 +433,8 @@ static const svn_opt_subcommand_desc2_t
     "repository will cause an error.  Progress feedback is sent to stdout.\n"
     "If --revision is specified, limit the loaded revisions to only those\n"
     "in the dump stream whose revision numbers match the specified range.\n"),
-   {'q', 'r', svnadmin__force_uuid, svnadmin__bypass_prop_validation,
-    svnadmin__no_flush_to_disk, 'F'},
+   {'q', 'r', svnadmin__force_uuid, svnadmin__normalize_props,
+    svnadmin__bypass_prop_validation, svnadmin__no_flush_to_disk, 'F'},
    {{'F', N_("read from file ARG instead of stdin")}} },
 
   {"lock", subcommand_lock, {0}, N_
@@ -547,11 +573,15 @@ struct svnadmin_opt_state
   svn_boolean_t bypass_prop_validation;             /* --bypass-prop-validation */
   svn_boolean_t ignore_dates;                       /* --ignore-dates */
   svn_boolean_t no_flush_to_disk;                   /* --no-flush-to-disk */
+  svn_boolean_t normalize_props;                    /* --normalize_props */
   enum svn_repos_load_uuid uuid_action;             /* --ignore-uuid,
                                                        --force-uuid */
   apr_uint64_t memory_cache_size;                   /* --memory-cache-size M */
   const char *parent_dir;                           /* --parent-dir */
   const char *file;                                 /* --file */
+  apr_array_header_t *exclude;                      /* --exclude */
+  apr_array_header_t *include;                      /* --include */
+  svn_boolean_t glob;                               /* --pattern */
 
   const char *config_dir;    /* Overriding Configuration Directory */
 };
@@ -1248,6 +1278,58 @@ get_dump_range(svn_revnum_t *lower,
   return SVN_NO_ERROR;
 }
 
+/* Compare the node-path PATH with the (const char *) prefixes in PFXLIST.
+ * Return TRUE if any prefix is a prefix of PATH (matching whole path
+ * components); FALSE otherwise.
+ * PATH starts with a '/', as do the (const char *) paths in PREFIXES. */
+/* This function is a duplicate of svndumpfilter.c:ary_prefix_match(). */
+static svn_boolean_t
+ary_prefix_match(const apr_array_header_t *pfxlist, const char *path)
+{
+  int i;
+  size_t path_len = strlen(path);
+
+  for (i = 0; i < pfxlist->nelts; i++)
+    {
+      const char *pfx = APR_ARRAY_IDX(pfxlist, i, const char *);
+      size_t pfx_len = strlen(pfx);
+
+      if (path_len < pfx_len)
+        continue;
+      if (strncmp(path, pfx, pfx_len) == 0
+          && (pfx_len == 1 || path[pfx_len] == '\0' || path[pfx_len] == '/'))
+        return TRUE;
+    }
+
+  return FALSE;
+}
+
+/* Baton for dump_filter_func(). */
+struct dump_filter_baton_t
+{
+  apr_array_header_t *prefixes;
+  svn_boolean_t glob;
+  svn_boolean_t do_exclude;
+};
+
+/* Implements svn_repos_dump_filter_func_t. */
+static svn_error_t *
+dump_filter_func(svn_boolean_t *include,
+                 svn_fs_root_t *root,
+                 const char *path,
+                 void *baton,
+                 apr_pool_t *scratch_pool)
+{
+  struct dump_filter_baton_t *b = baton;
+  const svn_boolean_t matches =
+    (b->glob
+     ? svn_cstring_match_glob_list(path, b->prefixes)
+     : ary_prefix_match(b->prefixes, path));
+
+  *include = b->do_exclude ? !matches : matches;
+  return SVN_NO_ERROR;
+}
+
 /* This implements `svn_opt_subcommand_t'. */
 static svn_error_t *
 subcommand_dump(apr_getopt_t *os, void *baton, apr_pool_t *pool)
@@ -1257,6 +1339,7 @@ subcommand_dump(apr_getopt_t *os, void *
   svn_stream_t *out_stream;
   svn_revnum_t lower, upper;
   svn_stream_t *feedback_stream = NULL;
+  struct dump_filter_baton_t filter_baton = {0};
 
   /* Expect no more arguments. */
   SVN_ERR(parse_args(NULL, os, 0, 0, pool));
@@ -1282,11 +1365,34 @@ subcommand_dump(apr_getopt_t *os, void *
   if (! opt_state->quiet)
     feedback_stream = recode_stream_create(stderr, pool);
 
+  /* Initialize the filter baton. */
+  filter_baton.glob = opt_state->glob;
+
+  if (opt_state->exclude && !opt_state->include)
+    {
+      filter_baton.prefixes = opt_state->exclude;
+      filter_baton.do_exclude = TRUE;
+    }
+  else if (opt_state->include && !opt_state->exclude)
+    {
+      filter_baton.prefixes = opt_state->include;
+      filter_baton.do_exclude = FALSE;
+    }
+  else if (opt_state->include && opt_state->exclude)
+    {
+      return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                               _("'--exclude' and '--include' options "
+                                 "cannot be used simultaneously"));
+    }
+
   SVN_ERR(svn_repos_dump_fs4(repos, out_stream, lower, upper,
                              opt_state->incremental, opt_state->use_deltas,
                              TRUE, TRUE,
                              !opt_state->quiet ? repos_notify_handler : NULL,
-                             feedback_stream, check_cancel, NULL, pool));
+                             feedback_stream,
+                             filter_baton.prefixes ? dump_filter_func : NULL,
+                             &filter_baton,
+                             check_cancel, NULL, pool));
 
   return SVN_NO_ERROR;
 }
@@ -1328,7 +1434,8 @@ subcommand_dump_revprops(apr_getopt_t *o
   SVN_ERR(svn_repos_dump_fs4(repos, out_stream, lower, upper,
                              FALSE, FALSE, TRUE, FALSE,
                              !opt_state->quiet ? repos_notify_handler : NULL,
-                             feedback_stream, check_cancel, NULL, pool));
+                             feedback_stream, NULL, NULL,
+                             check_cancel, NULL, pool));
 
   return SVN_NO_ERROR;
 }
@@ -1534,20 +1641,32 @@ subcommand_load(apr_getopt_t *os, void *
   if (! opt_state->quiet)
     feedback_stream = recode_stream_create(stdout, pool);
 
-  err = svn_repos_load_fs5(repos, in_stream, lower, upper,
+  err = svn_repos_load_fs6(repos, in_stream, lower, upper,
                            opt_state->uuid_action, opt_state->parent_dir,
                            opt_state->use_pre_commit_hook,
                            opt_state->use_post_commit_hook,
                            !opt_state->bypass_prop_validation,
+                           opt_state->normalize_props,
                            opt_state->ignore_dates,
                            opt_state->quiet ? NULL : repos_notify_handler,
                            feedback_stream, check_cancel, NULL, pool);
-  if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)
-    return svn_error_quick_wrap(err,
-                                _("Invalid property value found in "
-                                  "dumpstream; consider repairing the source "
-                                  "or using --bypass-prop-validation while "
-                                  "loading."));
+
+  if (svn_error_find_cause(err, SVN_ERR_BAD_PROPERTY_VALUE_EOL))
+    {
+      return svn_error_quick_wrap(err,
+                                  _("A property with invalid line ending "
+                                    "found in dumpstream; consider using "
+                                    "--normalize-props while loading."));
+    }
+  else if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)
+    {
+      return svn_error_quick_wrap(err,
+                                  _("Invalid property value found in "
+                                    "dumpstream; consider repairing the "
+                                    "source or using --bypass-prop-validation "
+                                    "while loading."));
+    }
+
   return err;
 }
 
@@ -1584,16 +1703,28 @@ subcommand_load_revprops(apr_getopt_t *o
 
   err = svn_repos_load_fs_revprops(repos, in_stream, lower, upper,
                                    !opt_state->bypass_prop_validation,
+                                   opt_state->normalize_props,
                                    opt_state->ignore_dates,
                                    opt_state->quiet ? NULL
                                                     : repos_notify_handler,
                                    feedback_stream, check_cancel, NULL, pool);
-  if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)
-    return svn_error_quick_wrap(err,
-                                _("Invalid property value found in "
-                                  "dumpstream; consider repairing the source "
-                                  "or using --bypass-prop-validation while "
-                                  "loading."));
+
+  if (svn_error_find_cause(err, SVN_ERR_BAD_PROPERTY_VALUE_EOL))
+    {
+      return svn_error_quick_wrap(err,
+                                  _("A property with invalid line ending "
+                                    "found in dumpstream; consider using "
+                                    "--normalize-props while loading."));
+    }
+  else if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)
+    {
+      return svn_error_quick_wrap(err,
+                                  _("Invalid property value found in "
+                                    "dumpstream; consider repairing the "
+                                    "source or using --bypass-prop-validation "
+                                    "while loading."));
+    }
+
   return err;
 }
 
@@ -2884,6 +3015,26 @@ sub_main(int *exit_code, int argc, const
       case svnadmin__no_flush_to_disk:
         opt_state.no_flush_to_disk = TRUE;
         break;
+      case svnadmin__normalize_props:
+        opt_state.normalize_props = TRUE;
+        break;
+      case svnadmin__exclude:
+        SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+
+        if (! opt_state.exclude)
+          opt_state.exclude = apr_array_make(pool, 1, sizeof(const char *));
+        APR_ARRAY_PUSH(opt_state.exclude, const char *) = utf8_opt_arg;
+        break;
+      case svnadmin__include:
+        SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+
+        if (! opt_state.include)
+          opt_state.include = apr_array_make(pool, 1, sizeof(const char *));
+        APR_ARRAY_PUSH(opt_state.include, const char *) = utf8_opt_arg;
+        break;
+      case svnadmin__glob:
+        opt_state.glob = TRUE;
+        break;
       default:
         {
           SVN_ERR(subcommand_help(NULL, NULL, pool));

Modified: subversion/branches/addremove/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/svndumpfilter/svndumpfilter.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/addremove/subversion/svndumpfilter/svndumpfilter.c Tue Oct 24 12:40:47 2017
@@ -109,6 +109,7 @@ write_propdel_to_stringbuf(svn_stringbuf
  * Return TRUE if any prefix is a prefix of PATH (matching whole path
  * components); FALSE otherwise.
  * PATH starts with a '/', as do the (const char *) paths in PREFIXES. */
+/* This function is a duplicate of svnadmin.c:ary_prefix_match(). */
 static svn_boolean_t
 ary_prefix_match(const apr_array_header_t *pfxlist, const char *path)
 {

Modified: subversion/branches/addremove/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/svnrdump/load_editor.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/addremove/subversion/svnrdump/load_editor.c Tue Oct 24 12:40:47 2017
@@ -713,16 +713,15 @@ set_revision_property(void *baton,
 {
   struct revision_baton *rb = baton;
 
-  SVN_ERR(svn_rdump__normalize_prop(name, &value, rb->pool));
-
+  SVN_ERR(svn_repos__normalize_prop(&value, NULL, name, value,
+                                    rb->pool, rb->pool));
   SVN_ERR(svn_repos__validate_prop(name, value, rb->pool));
 
   if (rb->rev > 0)
     {
       if (! svn_hash_gets(rb->pb->skip_revprops, name))
         svn_hash_sets(rb->revprop_table,
-                      apr_pstrdup(rb->pool, name),
-                      svn_string_dup(value, rb->pool));
+                      apr_pstrdup(rb->pool, name), value);
     }
   else if (rb->rev_offset == -1
            && ! svn_hash_gets(rb->pb->skip_revprops, name))
@@ -737,9 +736,9 @@ set_revision_property(void *baton,
   /* Remember any datestamp/ author that passes through (see comment
      in close_revision). */
   if (!strcmp(name, SVN_PROP_REVISION_DATE))
-    rb->datestamp = svn_string_dup(value, rb->pool);
+    rb->datestamp = value;
   if (!strcmp(name, SVN_PROP_REVISION_AUTHOR))
-    rb->author = svn_string_dup(value, rb->pool);
+    rb->author = value;
 
   return SVN_NO_ERROR;
 }
@@ -776,13 +775,13 @@ set_node_property(void *baton,
       value = new_value;
     }
 
-  SVN_ERR(svn_rdump__normalize_prop(name, &value, pool));
+  SVN_ERR(svn_repos__normalize_prop(&value, NULL, name, value, pool, pool));
 
   SVN_ERR(svn_repos__validate_prop(name, value, pool));
 
   prop = apr_palloc(nb->rb->pool, sizeof (*prop));
   prop->name = apr_pstrdup(pool, name);
-  prop->value = svn_string_dup(value, pool);
+  prop->value = value;
   svn_hash_sets(nb->prop_changes, prop->name, prop);
 
   return SVN_NO_ERROR;

Modified: subversion/branches/addremove/subversion/svnrdump/svnrdump.h
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/svnrdump/svnrdump.h?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/svnrdump/svnrdump.h (original)
+++ subversion/branches/addremove/subversion/svnrdump/svnrdump.h Tue Oct 24 12:40:47 2017
@@ -100,29 +100,12 @@ svn_rdump__load_dumpstream(svn_stream_t
  * currently all svn:* props) so that they contain only LF (\n) line endings.
  *
  * Put the normalized props into NORMAL_PROPS, allocated in RESULT_POOL.
- *
- * Note: this function does not do a deep copy; it is expected that PROPS has
- * a longer lifetime than NORMAL_PROPS.
  */
 svn_error_t *
 svn_rdump__normalize_props(apr_hash_t **normal_props,
                            apr_hash_t *props,
                            apr_pool_t *result_pool);
 
-/* Normalize the line ending style of a single property that "needs
- * translation" (according to svn_prop_needs_translation(),
- * currently all svn:* props) so that they contain only LF (\n) line endings.
- * "\r" characters found mid-line are replaced with "\n".
- * "\r\n" sequences are replaced with "\n"
- *
- * NAME is used to check that VALUE should be normalized, and if this is the
- * case, VALUE is then normalized, allocated from RESULT_POOL
- */
-svn_error_t *
-svn_rdump__normalize_prop(const char *name,
-                          const svn_string_t **value,
-                          apr_pool_t *result_pool);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/addremove/subversion/svnrdump/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/svnrdump/util.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/svnrdump/util.c (original)
+++ subversion/branches/addremove/subversion/svnrdump/util.c Tue Oct 24 12:40:47 2017
@@ -21,53 +21,35 @@
  * ====================================================================
  */
 
-#include "svn_error.h"
-#include "svn_pools.h"
-#include "svn_string.h"
-#include "svn_props.h"
-#include "svn_subst.h"
+#include "private/svn_repos_private.h"
 
 #include "svnrdump.h"
 
 
 svn_error_t *
-svn_rdump__normalize_prop(const char *name,
-                          const svn_string_t **value,
-                          apr_pool_t *result_pool)
-{
-  if (svn_prop_needs_translation(name) && *value)
-    {
-      const char *cstring;
-
-      SVN_ERR(svn_subst_translate_cstring2((*value)->data, &cstring,
-                                           "\n", TRUE,
-                                           NULL, FALSE,
-                                           result_pool));
-
-      *value = svn_string_create(cstring, result_pool);
-    }
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
 svn_rdump__normalize_props(apr_hash_t **normal_props,
                            apr_hash_t *props,
                            apr_pool_t *result_pool)
 {
   apr_hash_index_t *hi;
+  apr_pool_t *iterpool;
 
   *normal_props = apr_hash_make(result_pool);
 
+  iterpool = svn_pool_create(result_pool);
   for (hi = apr_hash_first(result_pool, props); hi;
         hi = apr_hash_next(hi))
     {
       const char *key = apr_hash_this_key(hi);
       const svn_string_t *value = apr_hash_this_val(hi);
 
-      SVN_ERR(svn_rdump__normalize_prop(key, &value,
-                                        result_pool));
+      svn_pool_clear(iterpool);
 
+      SVN_ERR(svn_repos__normalize_prop(&value, NULL, key, value,
+                                        result_pool, iterpool));
       svn_hash_sets(*normal_props, key, value);
     }
+  svn_pool_destroy(iterpool);
+
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/addremove/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/basic_tests.py?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/basic_tests.py Tue Oct 24 12:40:47 2017
@@ -3126,7 +3126,19 @@ def filtered_ls(sbox):
                "gamma\n" ]
 
   exit_code, output, error = svntest.actions.run_and_verify_svn(
-    None, [], 'ls', path, '--depth=infinity', '--search=*a')
+    expected, [], 'ls', path, '--depth=infinity', '--search=*a')
+
+  # check case-insensitivity
+  exit_code, output, error = svntest.actions.run_and_verify_svn(
+    expected, [], 'ls', path, '--depth=infinity', '--search=*A')
+
+  expected = [ "H/\n" ]
+  exit_code, output, error = svntest.actions.run_and_verify_svn(
+    expected, [], 'ls', path, '--depth=infinity', '--search=h')
+
+  # we don't match full paths
+  exit_code, output, error = svntest.actions.run_and_verify_svn(
+    [], [], 'ls', path, '--depth=infinity', '--search=*/*')
 
 ########################################################################
 # Run the tests

Modified: subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh Tue Oct 24 12:40:47 2017
@@ -699,6 +699,15 @@ RedirectMatch permanent ^/svn-test-work/
 RedirectMatch           ^/svn-test-work/repositories/REDIRECT-TEMP-(.*)\$ /svn-test-work/repositories/\$1
 __EOF__
 
+
+# Our configure script extracts the HTTPD version from
+# headers. However, that may not be the same as the runtime version;
+# an example of this discrepancy occurs on OSX 1.9.5, where the
+# headers report 2.2.26 but the server reports 2.2.29. Since our tests
+# use the version to interpret test case results, use the actual
+# runtime version here to avoid spurious test failures.
+HTTPD_VERSION=$("$HTTPD" -V -f $HTTPD_CFG | grep '^Server version:' | sed 's|^.*/\([0-9]*\.[0-9]*\.[0-9]*\).*$|\1|')
+
 START="$HTTPD -f $HTTPD_CFG"
 printf \
 '#!/bin/sh
@@ -715,14 +724,14 @@ fi
 ' >$STOPSCRIPT "$HTTPD_ROOT" "$START" "$HTTPD_PID" "$HTTPD_PID"
 chmod +x $STOPSCRIPT
 
-$START -t \
+$START -t > /dev/null \
   || fail "Configuration file didn't pass the check, most likely modules couldn't be loaded"
 
 # need to pause for some time to let HTTPD start
 $START &
 sleep 2
 
-say "HTTPD started and listening on '$BASE_URL'..."
+say "HTTPD $HTTPD_VERSION started and listening on '$BASE_URL'..."
 #query "Ready" "y"
 
 # Perform a trivial validation of our httpd configuration by
@@ -779,13 +788,13 @@ else
 fi
 
 if [ $# = 0 ]; then
-  TIME_CMD "$MAKE" check "BASE_URL=$BASE_URL" $SSL_MAKE_VAR
+  TIME_CMD "$MAKE" check "BASE_URL=$BASE_URL" "HTTPD_VERSION=$HTTPD_VERSION" $SSL_MAKE_VAR
   r=$?
 else
   (cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
   TEST="$1"
   shift
-  TIME_CMD "$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" "--httpd-version=$HTTPD_VERSION" $SSL_TEST_ARG "$@")
   r=$?
 fi
 

Modified: subversion/branches/addremove/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/diff_tests.py?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/diff_tests.py Tue Oct 24 12:40:47 2017
@@ -3531,7 +3531,7 @@ def diff_git_empty_files(sbox):
   expected_output = make_git_diff_header(new_path, "new", "nonexistent",
                                          "working copy",
                                          add=True, text_changes=False) + [
-  ] + make_git_diff_header(iota_path, "iota", "revision 2", "working copy",
+  ] + make_git_diff_header(iota_path, "iota", "revision 2", "nonexistent",
                            delete=True, text_changes=False)
 
   # Two files in diff may be in any order.
@@ -5043,7 +5043,7 @@ def diff_symlinks(sbox):
     '===================================================================\n',
     'diff --git a/to-iota b/to-iota\n',
     'new file mode 120644\n',
-    '--- /dev/null\t(nonexistent)\n',
+    '--- a/to-iota\t(nonexistent)\n',
     '+++ b/to-iota\t(working copy)\n',
     '@@ -0,0 +1 @@\n',
     '+iota\n',

Modified: subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Tue Oct 24 12:40:47 2017
@@ -126,7 +126,8 @@ Valid options:
                                --ignore-eol-style: Ignore changes in EOL style
                                -U ARG, --context ARG: Show ARG lines of context
                                -p, --show-c-function: Show C function name
-  --search ARG             : use ARG as search pattern (glob syntax)
+  --search ARG             : use ARG as search pattern (glob syntax, case-
+                             and accent-insensitive)
   --search-and ARG         : combine ARG with the previous search pattern
 
 Global options:

Modified: subversion/branches/addremove/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/svnadmin_tests.py?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/svnadmin_tests.py Tue Oct 24 12:40:47 2017
@@ -276,7 +276,7 @@ def load_and_verify_dumpstream(sbox, exp
     'load', '--quiet', sbox.repo_dir, *varargs)
 
   if expected_stdout:
-    if expected_stdout == svntest.verify.AnyOutput:
+    if expected_stdout is svntest.verify.AnyOutput:
       if len(output) == 0:
         raise SVNExpectedStdout
     else:
@@ -284,7 +284,7 @@ def load_and_verify_dumpstream(sbox, exp
         "Standard output", "STDOUT:", expected_stdout, output)
 
   if expected_stderr:
-    if expected_stderr == svntest.verify.AnyOutput:
+    if expected_stderr is svntest.verify.AnyOutput:
       if len(errput) == 0:
         raise SVNExpectedStderr
     else:
@@ -1616,14 +1616,34 @@ text
   sbox.build(empty=True)
 
   # Try to load the dumpstream, expecting a failure (because of mixed EOLs).
-  load_and_verify_dumpstream(sbox, [], svntest.verify.AnyOutput,
-                             dumpfile_revisions, False, dump_str,
-                             '--ignore-uuid')
+  exp_err = svntest.verify.RegexListOutput(['svnadmin: E125005',
+                                            'svnadmin: E125005',
+                                            'svnadmin: E125017'],
+                                           match_all=False)
+  load_and_verify_dumpstream(sbox, [], exp_err, dumpfile_revisions,
+                             False, dump_str, '--ignore-uuid')
 
   # Now try it again bypassing prop validation.  (This interface takes
   # care of the removal and recreation of the original repository.)
   svntest.actions.load_repo(sbox, dump_str=dump_str,
                             bypass_prop_validation=True)
+  # Getting the property should fail.
+  svntest.actions.run_and_verify_svn(None, 'svn: E135000: ',
+                                     'pg', 'svn:log', '--revprop', '-r1',
+                                     sbox.repo_url)
+
+  # Now try it again with prop normalization.
+  svntest.actions.load_repo(sbox, dump_str=dump_str,
+                            bypass_prop_validation=False,
+                            normalize_props=True)
+  # We should get the expected property value.
+  exit_code, output, _ = svntest.main.run_svn(None, 'pg', 'svn:log',
+                                              '--revprop', '-r1',
+                                              '--no-newline',
+                                              sbox.repo_url)
+  svntest.verify.verify_exit_code(None, exit_code, 0)
+  if output != ['\n', '\n']:
+    raise svntest.Failure("Unexpected property value %s" % output)
 
 # This test intentionally corrupts a revision and assumes an FSFS
 # repository. If you can make it work with BDB please do so.
@@ -3436,6 +3456,336 @@ def load_from_file(sbox):
                                      'update', sbox.wc_dir)
   svntest.actions.verify_disk(sbox.wc_dir, expected_tree, check_props=True)
 
+def dump_exclude(sbox):
+  "svnadmin dump with excluded paths"
+
+  sbox.build(create_wc=False)
+
+  # Dump repository with /A/D/H and /A/B/E paths excluded.
+  _, dump, _ = svntest.actions.run_and_verify_svnadmin(None, [],
+                                                       'dump', '-q',
+                                                       '--exclude', '/A/D/H',
+                                                       '--exclude', '/A/B/E',
+                                                       sbox.repo_dir)
+
+  # Load repository from dump.
+  sbox2 = sbox.clone_dependent()
+  sbox2.build(create_wc=False, empty=True)
+  load_and_verify_dumpstream(sbox2, None, [], None, False, dump)
+
+  # Check log.
+  expected_output = svntest.verify.RegexListOutput([
+    '-+\\n',
+    'r1\ .*\n',
+    # '/A/D/H' and '/A/B/E' is not added.
+    re.escape('Changed paths:\n'),
+    re.escape('   A /A\n'),
+    re.escape('   A /A/B\n'),
+    re.escape('   A /A/B/F\n'),
+    re.escape('   A /A/B/lambda\n'),
+    re.escape('   A /A/C\n'),
+    re.escape('   A /A/D\n'),
+    re.escape('   A /A/D/G\n'),
+    re.escape('   A /A/D/G/pi\n'),
+    re.escape('   A /A/D/G/rho\n'),
+    re.escape('   A /A/D/G/tau\n'),
+    re.escape('   A /A/D/gamma\n'),
+    re.escape('   A /A/mu\n'),
+    re.escape('   A /iota\n'),
+    '-+\\n'
+  ])
+  svntest.actions.run_and_verify_svn(expected_output, [],
+                                     'log', '-v', '-q', sbox2.repo_url)
+
+def dump_exclude_copysource(sbox):
+  "svnadmin dump with excluded copysource"
+
+  sbox.build(create_wc=False, empty=True)
+
+  # Create default repository structure.
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "mkdir",
+                                     sbox.repo_url + '/trunk',
+                                     sbox.repo_url + '/branches',
+                                     sbox.repo_url + '/tags',
+                                     "-m", "Create repository structure.")
+
+  # Create a branch.
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "copy",
+                                     sbox.repo_url + '/trunk',
+                                     sbox.repo_url + '/branches/branch1',
+                                     "-m", "Create branch.")
+
+  # Dump repository with /trunk excluded.
+  _, dump, _ = svntest.actions.run_and_verify_svnadmin(None, [],
+                                                       'dump', '-q',
+                                                       '--exclude', '/trunk',
+                                                       sbox.repo_dir)
+
+  # Load repository from dump.
+  sbox2 = sbox.clone_dependent()
+  sbox2.build(create_wc=False, empty=True)
+  load_and_verify_dumpstream(sbox2, None, [], None, False, dump)
+
+  # Check log.
+  expected_output = svntest.verify.RegexListOutput([
+    '-+\\n',
+    'r2\ .*\n',
+    re.escape('Changed paths:\n'),
+    # Simple add, not copy.
+    re.escape('   A /branches/branch1\n'),
+    '-+\\n',
+    'r1\ .*\n',
+    # '/trunk' is not added.
+    re.escape('Changed paths:\n'),
+    re.escape('   A /branches\n'),
+    re.escape('   A /tags\n'),
+    '-+\\n'
+  ])
+  svntest.actions.run_and_verify_svn(expected_output, [],
+                                     'log', '-v', '-q', sbox2.repo_url)
+
+def dump_include(sbox):
+  "svnadmin dump with included paths"
+
+  sbox.build(create_wc=False, empty=True)
+
+  # Create a couple of directories.
+  # Note that we can't use greek tree as it contains only two top-level
+  # nodes. Including non top-level nodes (e.g. '--include /A/B/E') will
+  # produce unloadable dump for now.
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "mkdir",
+                                     sbox.repo_url + '/A',
+                                     sbox.repo_url + '/B',
+                                     sbox.repo_url + '/C',
+                                     "-m", "Create folder.")
+
+  # Dump repository with /A and /C paths included.
+  _, dump, _ = svntest.actions.run_and_verify_svnadmin(None, [],
+                                                       'dump', '-q',
+                                                       '--include', '/A',
+                                                       '--include', '/C',
+                                                       sbox.repo_dir)
+
+  # Load repository from dump.
+  sbox2 = sbox.clone_dependent()
+  sbox2.build(create_wc=False, empty=True)
+  load_and_verify_dumpstream(sbox2, None, [], None, False, dump)
+
+  # Check log.
+  expected_output = svntest.verify.RegexListOutput([
+    '-+\\n',
+    'r1\ .*\n',
+    # '/B' is not added.
+    re.escape('Changed paths:\n'),
+    re.escape('   A /A\n'),
+    re.escape('   A /C\n'),
+    '-+\\n'
+  ])
+  svntest.actions.run_and_verify_svn(expected_output, [],
+                                     'log', '-v', '-q', sbox2.repo_url)
+
+def dump_not_include_copysource(sbox):
+  "svnadmin dump with not included copysource"
+
+  sbox.build(create_wc=False, empty=True)
+
+  # Create default repository structure.
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "mkdir",
+                                     sbox.repo_url + '/trunk',
+                                     sbox.repo_url + '/branches',
+                                     sbox.repo_url + '/tags',
+                                     "-m", "Create repository structure.")
+
+  # Create a branch.
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "copy",
+                                     sbox.repo_url + '/trunk',
+                                     sbox.repo_url + '/branches/branch1',
+                                     "-m", "Create branch.")
+
+  # Dump repository with only /branches included.
+  _, dump, _ = svntest.actions.run_and_verify_svnadmin(None, [],
+                                                       'dump', '-q',
+                                                       '--include', '/branches',
+                                                       sbox.repo_dir)
+
+  # Load repository from dump.
+  sbox2 = sbox.clone_dependent()
+  sbox2.build(create_wc=False, empty=True)
+  load_and_verify_dumpstream(sbox2, None, [], None, False, dump)
+
+  # Check log.
+  expected_output = svntest.verify.RegexListOutput([
+    '-+\\n',
+    'r2\ .*\n',
+    re.escape('Changed paths:\n'),
+    # Simple add, not copy.
+    re.escape('   A /branches/branch1\n'),
+    '-+\\n',
+    'r1\ .*\n',
+    # Only '/branches' is added in r1.
+    re.escape('Changed paths:\n'),
+    re.escape('   A /branches\n'),
+    '-+\\n'
+  ])
+  svntest.actions.run_and_verify_svn(expected_output, [],
+                                     'log', '-v', '-q', sbox2.repo_url)
+
+def dump_exclude_by_pattern(sbox):
+  "svnadmin dump with paths excluded by pattern"
+
+  sbox.build(create_wc=False, empty=True)
+
+  # Create a couple of directories.
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "mkdir",
+                                     sbox.repo_url + '/aaa',
+                                     sbox.repo_url + '/aab',
+                                     sbox.repo_url + '/aac',
+                                     sbox.repo_url + '/bbc',
+                                     "-m", "Create repository structure.")
+
+  # Dump with paths excluded by pattern.
+  _, dump, _ = svntest.actions.run_and_verify_svnadmin(None, [],
+                                                       'dump', '-q',
+                                                       '--exclude', '/aa?',
+                                                       '--pattern',
+                                                       sbox.repo_dir)
+
+  # Load repository from dump.
+  sbox2 = sbox.clone_dependent()
+  sbox2.build(create_wc=False, empty=True)
+  load_and_verify_dumpstream(sbox2, None, [], None, False, dump)
+
+  # Check log.
+  expected_output = svntest.verify.RegexListOutput([
+    '-+\\n',
+    'r1\ .*\n',
+    re.escape('Changed paths:\n'),
+    # Only '/bbc' is added in r1.
+    re.escape('   A /bbc\n'),
+    '-+\\n'
+  ])
+  svntest.actions.run_and_verify_svn(expected_output, [],
+                                     'log', '-v', '-q', sbox2.repo_url)
+
+def dump_include_by_pattern(sbox):
+  "svnadmin dump with paths included by pattern"
+
+  sbox.build(create_wc=False, empty=True)
+
+  # Create a couple of directories.
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "mkdir",
+                                     sbox.repo_url + '/aaa',
+                                     sbox.repo_url + '/aab',
+                                     sbox.repo_url + '/aac',
+                                     sbox.repo_url + '/bbc',
+                                     "-m", "Create repository structure.")
+
+  # Dump with paths included by pattern.
+  _, dump, _ = svntest.actions.run_and_verify_svnadmin(None, [],
+                                                       'dump', '-q',
+                                                       '--include', '/aa?',
+                                                       '--pattern',
+                                                       sbox.repo_dir)
+
+  # Load repository from dump.
+  sbox2 = sbox.clone_dependent()
+  sbox2.build(create_wc=False, empty=True)
+  load_and_verify_dumpstream(sbox2, None, [], None, False, dump)
+
+  # Check log.
+  expected_output = svntest.verify.RegexListOutput([
+    '-+\\n',
+    'r1\ .*\n',
+    # '/bbc' is not added.
+    re.escape('Changed paths:\n'),
+    re.escape('   A /aaa\n'),
+    re.escape('   A /aab\n'),
+    re.escape('   A /aac\n'),
+    '-+\\n'
+  ])
+  svntest.actions.run_and_verify_svn(expected_output, [],
+                                     'log', '-v', '-q', sbox2.repo_url)
+
+def dump_exclude_all_rev_changes(sbox):
+  "svnadmin dump with all revision changes excluded"
+
+  sbox.build(create_wc=False, empty=True)
+
+  # Create a couple of directories (r1).
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "mkdir",
+                                     sbox.repo_url + '/r1a',
+                                     sbox.repo_url + '/r1b',
+                                     sbox.repo_url + '/r1c',
+                                     "-m", "Revision 1.")
+
+  # Create a couple of directories (r2).
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "mkdir",
+                                     sbox.repo_url + '/r2a',
+                                     sbox.repo_url + '/r2b',
+                                     sbox.repo_url + '/r2c',
+                                     "-m", "Revision 2.")
+
+  # Create a couple of directories (r3).
+  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], "mkdir",
+                                     sbox.repo_url + '/r3a',
+                                     sbox.repo_url + '/r3b',
+                                     sbox.repo_url + '/r3c',
+                                     "-m", "Revision 3.")
+
+  # Dump with paths excluded by pattern.
+  _, dump, _ = svntest.actions.run_and_verify_svnadmin(None, [],
+                                                       'dump', '-q',
+                                                       '--exclude', '/r2?',
+                                                       '--pattern',
+                                                       sbox.repo_dir)
+
+  # Load repository from dump.
+  sbox2 = sbox.clone_dependent()
+  sbox2.build(create_wc=False, empty=True)
+  load_and_verify_dumpstream(sbox2, None, [], None, False, dump)
+
+  # Check log. Revision properties ('svn:log' etc.) should be empty for r2.
+  expected_output = svntest.verify.RegexListOutput([
+    '-+\\n',
+    'r3\ |\ jrandom\ |\ .*\ |\ 1\ line\\n',
+    re.escape('Changed paths:'),
+    re.escape('   A /r3a'),
+    re.escape('   A /r3b'),
+    re.escape('   A /r3c'),
+    '',
+    re.escape('Revision 3.'),
+    '-+\\n',
+    re.escape('r2 | (no author) | (no date) | 1 line'),
+    '',
+    '',
+    '-+\\n',
+    'r1\ |\ jrandom\ |\ .*\ |\ 1\ line\\n',
+    re.escape('Changed paths:'),
+    re.escape('   A /r1a'),
+    re.escape('   A /r1b'),
+    re.escape('   A /r1c'),
+    '',
+    re.escape('Revision 1.'),
+    '-+\\n',
+  ])
+  svntest.actions.run_and_verify_svn(expected_output, [],
+                                     'log', '-v',  sbox2.repo_url)
+
+def dump_invalid_filtering_option(sbox):
+  "dump with --include and --exclude simultaneously"
+
+  sbox.build(create_wc=False, empty=False)
+
+  # Attempt to dump repository with '--include' and '--exclude' options
+  # specified simultaneously.
+  expected_error = ".*: '--exclude' and '--include' options cannot be used " \
+                   "simultaneously"
+  svntest.actions.run_and_verify_svnadmin(None, expected_error,
+                                          'dump', '-q',
+                                          '--exclude', '/A/D/H',
+                                          '--include', '/A/B/E',
+                                          sbox.repo_dir)
+
 ########################################################################
 # Run the tests
 
@@ -3500,7 +3850,15 @@ test_list = [ None,
               dump_no_op_prop_change,
               load_no_flush_to_disk,
               dump_to_file,
-              load_from_file
+              load_from_file,
+              dump_exclude,
+              dump_exclude_copysource,
+              dump_include,
+              dump_not_include_copysource,
+              dump_exclude_by_pattern,
+              dump_include_by_pattern,
+              dump_exclude_all_rev_changes,
+              dump_invalid_filtering_option
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/addremove/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/svntest/actions.py?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/svntest/actions.py Tue Oct 24 12:40:47 2017
@@ -355,7 +355,8 @@ def run_and_verify_svn2(expected_stdout,
   return exit_code, out, err
 
 def run_and_verify_load(repo_dir, dump_file_content,
-                        bypass_prop_validation = False):
+                        bypass_prop_validation = False,
+                        normalize_props = False):
   "Runs 'svnadmin load' and reports any errors."
   if not isinstance(dump_file_content, list):
     raise TypeError("dump_file_content argument should have list type")
@@ -363,6 +364,8 @@ def run_and_verify_load(repo_dir, dump_f
   args = ()
   if bypass_prop_validation:
     args += ('--bypass-prop-validation',)
+  if normalize_props:
+    args += ('--normalize-props',)
   main.run_command_stdin(
     main.svnadmin_binary, expected_stderr, 0, True, dump_file_content,
     'load', '--force-uuid', '--quiet', repo_dir, *args)
@@ -473,7 +476,8 @@ def run_and_verify_svnsync2(expected_std
 
 
 def load_repo(sbox, dumpfile_path = None, dump_str = None,
-              bypass_prop_validation = False,create_wc=True):
+              bypass_prop_validation = False, create_wc=True,
+              normalize_props = False):
   "Loads the dumpfile into sbox"
   if not dump_str:
     dump_str = open(dumpfile_path, "rb").read()
@@ -485,7 +489,7 @@ def load_repo(sbox, dumpfile_path = None
 
   # Load the mergetracking dumpfile into the repos, and check it out the repo
   run_and_verify_load(sbox.repo_dir, dump_str.splitlines(True),
-                      bypass_prop_validation)
+                      bypass_prop_validation, normalize_props)
   if create_wc:
     run_and_verify_svn(None, [], "co", sbox.repo_url, sbox.wc_dir)
 

Modified: subversion/branches/addremove/subversion/tests/cmdline/svntest/verify.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/svntest/verify.py?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/svntest/verify.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/svntest/verify.py Tue Oct 24 12:40:47 2017
@@ -860,7 +860,7 @@ def make_git_diff_header(target_path, re
     ])
     if text_changes:
       output.extend([
-        "--- /dev/null\t(" + old_tag + ")\n",
+        "--- a/" + repos_relpath + src_label + "\t(" + old_tag + ")\n",
         "+++ b/" + repos_relpath + dst_label + "\t(" + new_tag + ")\n"
       ])
   elif delete:
@@ -871,7 +871,7 @@ def make_git_diff_header(target_path, re
     if text_changes:
       output.extend([
         "--- a/" + repos_relpath + src_label + "\t(" + old_tag + ")\n",
-        "+++ /dev/null\t(" + new_tag + ")\n"
+        "+++ b/" + repos_relpath + dst_label + "\t(" + new_tag + ")\n"
       ])
   elif cp:
     if copyfrom_rev:

Modified: subversion/branches/addremove/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/upgrade_tests.py?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/upgrade_tests.py Tue Oct 24 12:40:47 2017
@@ -761,61 +761,6 @@ def dirs_only_upgrade(sbox):
       })
   run_and_verify_status_no_server(sbox.wc_dir, expected_status)
 
-def read_tree_conflict_data(sbox, path):
-  dot_svn = svntest.main.get_admin_name()
-  db = svntest.sqlite3.connect(os.path.join(sbox.wc_dir, dot_svn, 'wc.db'))
-  for row in db.execute("select tree_conflict_data from actual_node "
-                        "where tree_conflict_data is not null "
-                        "and local_relpath = '%s'" % path):
-    return
-  raise svntest.Failure("conflict expected for '%s'" % path)
-
-def no_actual_node(sbox, path):
-  dot_svn = svntest.main.get_admin_name()
-  db = svntest.sqlite3.connect(os.path.join(sbox.wc_dir, dot_svn, 'wc.db'))
-  for row in db.execute("select 1 from actual_node "
-                        "where local_relpath = '%s'" % path):
-    raise svntest.Failure("no actual node expected for '%s'" % path)
-
-def upgrade_tree_conflict_data(sbox):
-  "upgrade tree conflict data (f20->f21)"
-
-  wc_dir = sbox.wc_dir
-  replace_sbox_with_tarfile(sbox, 'upgrade_tc.tar.bz2')
-
-  # Check and see if we can still read our tree conflicts
-  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
-  expected_status.tweak('A/D/G/pi', status='D ', treeconflict='C')
-  expected_status.tweak('A/D/G/tau', status='! ', treeconflict='C',
-                        wc_rev=None)
-  expected_status.tweak('A/D/G/rho', status='A ', copied='+',
-                        treeconflict='C', wc_rev='-')
-
-  # Look inside pre-upgrade database
-  read_tree_conflict_data(sbox, 'A/D/G')
-  no_actual_node(sbox, 'A/D/G/pi')
-  no_actual_node(sbox, 'A/D/G/rho')
-  no_actual_node(sbox, 'A/D/G/tau')
-
-  # While the upgrade from f20 to f21 will work the upgrade from f22
-  # to f23 will not, since working nodes are present.
-  exit_code, output, errput = svntest.main.run_svn('format 22', 'upgrade',
-                                                    wc_dir)
-
-  if not exit_code:
-    run_and_verify_status_no_server(wc_dir, expected_status)
-  else:
-    if not svntest.verify.RegexOutput('.*format 22 with WORKING nodes.*',
-                                      match_all=False).matches(errput):
-      raise svntest.Failure()
-
-  # Look insde post-upgrade database
-  read_tree_conflict_data(sbox, 'A/D/G/pi')
-  read_tree_conflict_data(sbox, 'A/D/G/rho')
-  read_tree_conflict_data(sbox, 'A/D/G/tau')
-  # no_actual_node(sbox, 'A/D/G')  ### not removed but should be?
-
-
 @Issue(3898)
 def delete_in_copy_upgrade(sbox):
   "upgrade a delete within a copy"
@@ -972,27 +917,6 @@ def tree_replace2(sbox):
     })
   run_and_verify_status_no_server(sbox.wc_dir, expected_status)
 
-def upgrade_from_format_28(sbox):
-  """upgrade from format 28: rename pristines"""
-
-  # Start with a format-28 WC that is a clean checkout of the Greek tree.
-  replace_sbox_with_tarfile(sbox, 'format_28.tar.bz2')
-
-  # Get the old and new pristine file paths for file 'iota'.
-  checksum = '2c0aa9014a0cd07f01795a333d82485ef6d083e2'
-  old_pristine_path = os.path.join(sbox.wc_dir, svntest.main.get_admin_name(),
-                                   'pristine', checksum[0:2], checksum)
-  new_pristine_path = old_pristine_path + '.svn-base'
-
-  assert os.path.exists(old_pristine_path)
-  assert not os.path.exists(new_pristine_path)
-
-  # Upgrade the WC
-  svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
-
-  assert not os.path.exists(old_pristine_path)
-  assert os.path.exists(new_pristine_path)
-
 @Issue(3901)
 def depth_exclude(sbox):
   "upgrade 1.6.x wc that has depth=exclude"
@@ -1606,13 +1530,11 @@ test_list = [ None,
               missing_dirs2,
               delete_and_keep_local,
               dirs_only_upgrade,
-              upgrade_tree_conflict_data,
               delete_in_copy_upgrade,
               replaced_files,
               upgrade_with_scheduled_change,
               tree_replace1,
               tree_replace2,
-              upgrade_from_format_28,
               depth_exclude,
               depth_exclude_2,
               add_add_del_del_tc,

Modified: subversion/branches/addremove/subversion/tests/libsvn_client/conflicts-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/libsvn_client/conflicts-test.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/branches/addremove/subversion/tests/libsvn_client/conflicts-test.c Tue Oct 24 12:40:47 2017
@@ -162,6 +162,7 @@ assert_text_conflict_options(svn_client_
 /* Some paths we'll care about. */
 static const char *trunk_path = "A";
 static const char *branch_path = "A_branch";
+static const char *branch2_path = "A_branch2";
 static const char *new_file_name = "newfile.txt";
 static const char *new_file_name_branch = "newfile-on-branch.txt";
 static const char *deleted_file_name = "mu";
@@ -4578,89 +4579,6 @@ test_update_incoming_added_dir_merge2(co
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *
-test_cherry_pick_post_move_edit(const svn_test_opts_t *opts,
-                                apr_pool_t *pool)
-{
-  svn_test__sandbox_t *b = apr_palloc(pool, sizeof(*b));
-  const char *trunk_url;
-  svn_opt_revision_t peg_rev;
-  apr_array_header_t *ranges_to_merge;
-  svn_opt_revision_range_t merge_range;
-  svn_client_ctx_t *ctx;
-  svn_client_conflict_t *conflict;
-  svn_boolean_t tree_conflicted;
-
-  SVN_ERR(svn_test__sandbox_create(b,
-                                   "test_cherry_pick_post_move_edit",
-                                   opts, pool));
-
-  SVN_ERR(sbox_add_and_commit_greek_tree(b)); /* r1 */
-  /* Create a copy of node "A". */
-  SVN_ERR(sbox_wc_copy(b, "A", "A1"));
-  SVN_ERR(sbox_wc_commit(b, "")); /* r2 */
-  /* On "trunk", move the file mu. */
-  SVN_ERR(sbox_wc_move(b, "A/mu", "A/mu-moved"));
-  SVN_ERR(sbox_wc_commit(b, "")); /* r3 */
-  /* On "trunk", edit mu-moved. This will be r4, which we'll cherry-pick. */
-  SVN_ERR(sbox_file_write(b, "A/mu-moved", "Modified content.\n"));
-  SVN_ERR(sbox_wc_commit(b, "")); /* r4 */
-  SVN_ERR(sbox_wc_update(b, "", SVN_INVALID_REVNUM));
-
-  /* Perform a cherry-pick merge of r4 from A to A1. */
-  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
-  trunk_url = apr_pstrcat(b->pool, b->repos_url, "/A", SVN_VA_NULL);
-  peg_rev.kind = svn_opt_revision_number;
-  peg_rev.value.number = 4;
-  merge_range.start.kind = svn_opt_revision_number;
-  merge_range.start.value.number = 3;
-  merge_range.end.kind = svn_opt_revision_number;
-  merge_range.end.value.number = 4;
-  ranges_to_merge = apr_array_make(b->pool, 1,
-                                   sizeof(svn_opt_revision_range_t *));
-  APR_ARRAY_PUSH(ranges_to_merge, svn_opt_revision_range_t *) = &merge_range;
-  /* This should raise a "local delete or move vs incoming edit" conflict. */
-  SVN_ERR(svn_client_merge_peg5(trunk_url, ranges_to_merge, &peg_rev,
-                                sbox_wc_path(b, "A1"), svn_depth_infinity,
-                                FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-                                NULL, ctx, b->pool));
-
-  SVN_ERR(svn_client_conflict_get(&conflict, sbox_wc_path(b, "A1/mu-moved"),
-                                  ctx, b->pool, b->pool));
-  SVN_ERR(svn_client_conflict_get_conflicted(NULL, NULL, &tree_conflicted,
-                                             conflict, b->pool, b->pool));
-  SVN_TEST_ASSERT(tree_conflicted);
-  {
-    svn_client_conflict_option_id_t expected_opts[] = {
-      svn_client_conflict_option_postpone,
-      svn_client_conflict_option_accept_current_wc_state,
-      -1 /* end of list */
-    };
-    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
-                                         b->pool));
-  }
-
-  SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
-  {
-    svn_client_conflict_option_id_t expected_opts[] = {
-      svn_client_conflict_option_postpone,
-      svn_client_conflict_option_accept_current_wc_state,
-      svn_client_conflict_option_local_move_file_text_merge,
-      -1 /* end of list */
-    };
-    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
-                                         b->pool));
-  }
-
-  /* Try to resolve the conflict. */
-  SVN_ERR(svn_client_conflict_tree_resolve_by_id(
-            conflict,
-            svn_client_conflict_option_local_move_file_text_merge,
-            ctx, b->pool));
-
-  return SVN_NO_ERROR;
-}
-
 /* Regression test for chrash fixed in r1780259. */
 static svn_error_t *
 test_cherry_pick_moved_file_with_propdel(const svn_test_opts_t *opts,
@@ -4976,6 +4894,288 @@ test_merge_incoming_move_file_text_merge
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_cherry_pick_post_move_edit(const svn_test_opts_t *opts,
+                                apr_pool_t *pool)
+{
+  svn_test__sandbox_t *b = apr_palloc(pool, sizeof(*b));
+  const char *trunk_url;
+  svn_opt_revision_t peg_rev;
+  apr_array_header_t *ranges_to_merge;
+  svn_opt_revision_range_t merge_range;
+  svn_client_ctx_t *ctx;
+  svn_client_conflict_t *conflict;
+  svn_boolean_t tree_conflicted;
+  svn_stringbuf_t *buf;
+
+  SVN_ERR(svn_test__sandbox_create(b,
+                                   "test_cherry_pick_post_move_edit",
+                                   opts, pool));
+
+  SVN_ERR(sbox_add_and_commit_greek_tree(b)); /* r1 */
+  /* Create a copy of node "A". */
+  SVN_ERR(sbox_wc_copy(b, "A", "A1"));
+  SVN_ERR(sbox_wc_commit(b, "")); /* r2 */
+  /* On "trunk", move the file mu. */
+  SVN_ERR(sbox_wc_move(b, "A/mu", "A/mu-moved"));
+  SVN_ERR(sbox_wc_commit(b, "")); /* r3 */
+  /* On "trunk", edit mu-moved. This will be r4. */
+  SVN_ERR(sbox_file_write(b, "A/mu-moved", "Modified content." APR_EOL_STR));
+  SVN_ERR(sbox_wc_commit(b, "")); /* r4 */
+  /* On "trunk", edit mu-moved. This will be r5, which we'll cherry-pick. */
+  SVN_ERR(sbox_file_write(b, "A/mu-moved",
+                          "More modified content." APR_EOL_STR));
+  SVN_ERR(sbox_wc_commit(b, "")); /* r5 */
+  SVN_ERR(sbox_wc_update(b, "", SVN_INVALID_REVNUM));
+
+  /* Perform a cherry-pick merge of r5 from A to A1. */
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+  trunk_url = apr_pstrcat(b->pool, b->repos_url, "/A", SVN_VA_NULL);
+  peg_rev.kind = svn_opt_revision_number;
+  peg_rev.value.number = 5;
+  merge_range.start.kind = svn_opt_revision_number;
+  merge_range.start.value.number = 4;
+  merge_range.end.kind = svn_opt_revision_number;
+  merge_range.end.value.number = 5;
+  ranges_to_merge = apr_array_make(b->pool, 1,
+                                   sizeof(svn_opt_revision_range_t *));
+  APR_ARRAY_PUSH(ranges_to_merge, svn_opt_revision_range_t *) = &merge_range;
+  /* This should raise a "local delete or move vs incoming edit" conflict. */
+  SVN_ERR(svn_client_merge_peg5(trunk_url, ranges_to_merge, &peg_rev,
+                                sbox_wc_path(b, "A1"), svn_depth_infinity,
+                                FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
+                                NULL, ctx, b->pool));
+
+  SVN_ERR(svn_client_conflict_get(&conflict, sbox_wc_path(b, "A1/mu-moved"),
+                                  ctx, b->pool, b->pool));
+  SVN_ERR(svn_client_conflict_get_conflicted(NULL, NULL, &tree_conflicted,
+                                             conflict, b->pool, b->pool));
+  SVN_TEST_ASSERT(tree_conflicted);
+  {
+    svn_client_conflict_option_id_t expected_opts[] = {
+      svn_client_conflict_option_postpone,
+      svn_client_conflict_option_accept_current_wc_state,
+      -1 /* end of list */
+    };
+    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
+                                         b->pool));
+  }
+
+  SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
+  {
+    svn_client_conflict_option_id_t expected_opts[] = {
+      svn_client_conflict_option_postpone,
+      svn_client_conflict_option_accept_current_wc_state,
+      svn_client_conflict_option_local_move_file_text_merge,
+      -1 /* end of list */
+    };
+    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
+                                         b->pool));
+  }
+
+  /* Try to resolve the conflict. */
+  SVN_ERR(svn_client_conflict_tree_resolve_by_id(
+            conflict,
+            svn_client_conflict_option_local_move_file_text_merge,
+            ctx, b->pool));
+
+  /* The node "A1/mu-moved" should no longer exist. */
+  SVN_TEST_ASSERT_ERROR(svn_client_conflict_get(&conflict,
+                                                sbox_wc_path(b, "A1/mu-moved"),
+                                                ctx, pool, pool),
+                        SVN_ERR_WC_PATH_NOT_FOUND);
+
+  /* And "A1/mu" should have expected contents. */
+  SVN_ERR(svn_stringbuf_from_file2(&buf, sbox_wc_path(b, "A1/mu"), pool));
+  SVN_TEST_STRING_ASSERT(buf->data, "More modified content." APR_EOL_STR);
+
+  return SVN_NO_ERROR;
+}
+
+/* A helper function which prepares a working copy for the tests below. */
+static svn_error_t *
+create_wc_with_incoming_delete_dir_conflict_across_branches(
+  svn_test__sandbox_t *b)
+{
+  svn_client_ctx_t *ctx;
+  const char *trunk_url;
+  const char *branch_url;
+  svn_opt_revision_t opt_rev;
+  const char *deleted_path;
+  const char *deleted_child_path;
+  const char *move_target_path;
+
+  SVN_ERR(sbox_add_and_commit_greek_tree(b));
+
+  /* Create a branch of node "A". */
+  SVN_ERR(sbox_wc_copy(b, trunk_path, branch_path));
+  SVN_ERR(sbox_wc_commit(b, ""));
+
+  /* Create a second branch ("branch2") of the first branch. */
+  SVN_ERR(sbox_wc_copy(b, branch_path, branch2_path));
+  SVN_ERR(sbox_wc_commit(b, ""));
+
+  /* Move a directory on the trunk. */
+  deleted_path = svn_relpath_join(trunk_path, deleted_dir_name, b->pool);
+  move_target_path = svn_relpath_join(trunk_path, new_dir_name, b->pool);
+  SVN_ERR(sbox_wc_move(b, deleted_path, move_target_path));
+  SVN_ERR(sbox_wc_commit(b, ""));
+
+  /* Modify a file in that directory on branch2. */
+  deleted_child_path = svn_relpath_join(branch2_path,
+                                        svn_relpath_join(deleted_dir_name,
+                                                         deleted_dir_child,
+                                                         b->pool),
+                                        b->pool);
+  SVN_ERR(sbox_file_write(b, deleted_child_path,
+                          modified_file_on_branch_content));
+
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+  opt_rev.kind = svn_opt_revision_head;
+  opt_rev.value.number = SVN_INVALID_REVNUM;
+  trunk_url = apr_pstrcat(b->pool, b->repos_url, "/", trunk_path,
+                          SVN_VA_NULL);
+  branch_url = apr_pstrcat(b->pool, b->repos_url, "/", branch_path,
+                          SVN_VA_NULL);
+
+  /* Commit modification and run a merge from the trunk to the branch.
+   * This merge should not raise a conflict. */
+  SVN_ERR(sbox_wc_commit(b, ""));
+  SVN_ERR(sbox_wc_update(b, "", SVN_INVALID_REVNUM));
+  SVN_ERR(svn_client_merge_peg5(trunk_url, NULL, &opt_rev,
+                                sbox_wc_path(b, branch_path),
+                                svn_depth_infinity,
+                                FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
+                                NULL, ctx, b->pool));
+
+  /* Commit merge result end run a merge from branch to branch2. */
+  SVN_ERR(sbox_wc_commit(b, ""));
+  SVN_ERR(sbox_wc_update(b, "", SVN_INVALID_REVNUM));
+
+  /* This should raise an "incoming delete vs local edit" tree conflict. */
+  SVN_ERR(svn_client_merge_peg5(branch_url, NULL, &opt_rev,
+                                sbox_wc_path(b, branch2_path),
+                                svn_depth_infinity,
+                                FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
+                                NULL, ctx, b->pool));
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_merge_incoming_move_dir_across_branches(const svn_test_opts_t *opts,
+                                             apr_pool_t *pool)
+{
+  svn_test__sandbox_t *b = apr_palloc(pool, sizeof(*b));
+  svn_client_ctx_t *ctx;
+  const char *deleted_path;
+  const char *moved_to_path;
+  const char *child_path;
+  svn_client_conflict_t *conflict;
+  struct status_baton sb;
+  struct svn_client_status_t *status;
+  svn_stringbuf_t *buf;
+  svn_opt_revision_t opt_rev;
+  apr_array_header_t *options;
+  svn_client_conflict_option_t *option;
+  apr_array_header_t *possible_moved_to_abspaths;
+
+  SVN_ERR(svn_test__sandbox_create(b,
+                                   "merge_incoming_move_dir accross branches",
+                                   opts, pool));
+
+  SVN_ERR(create_wc_with_incoming_delete_dir_conflict_across_branches(b));
+
+  deleted_path = svn_relpath_join(branch2_path, deleted_dir_name, b->pool);
+  moved_to_path = svn_relpath_join(branch2_path, new_dir_name, b->pool);
+
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+  SVN_ERR(svn_client_conflict_get(&conflict, sbox_wc_path(b, deleted_path),
+                                  ctx, b->pool, b->pool));
+  SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
+
+  /* Check possible move destinations for the directory. */
+  SVN_ERR(svn_client_conflict_tree_get_resolution_options(&options, conflict,
+                                                          ctx, b->pool,
+                                                          b->pool));
+  option = svn_client_conflict_option_find_by_id(
+             options, svn_client_conflict_option_incoming_move_dir_merge);
+  SVN_TEST_ASSERT(option != NULL);
+
+  SVN_ERR(svn_client_conflict_option_get_moved_to_abspath_candidates(
+            &possible_moved_to_abspaths, option, b->pool, b->pool));
+
+  /* The resolver finds two possible destinations for the moved folder:
+   *
+   *   Possible working copy destinations for moved-away 'A_branch/B' are:
+   *    (1): 'A_branch2/newdir'
+   *    (2): 'A_branch/newdir'
+   *   Only one destination can be a move; the others are copies.
+   */
+  SVN_TEST_INT_ASSERT(possible_moved_to_abspaths->nelts, 2);
+  SVN_TEST_STRING_ASSERT(
+    APR_ARRAY_IDX(possible_moved_to_abspaths, 0, const char *),
+    sbox_wc_path(b, moved_to_path));
+  SVN_TEST_STRING_ASSERT(
+    APR_ARRAY_IDX(possible_moved_to_abspaths, 1, const char *),
+    sbox_wc_path(b, svn_relpath_join(branch_path, new_dir_name, b->pool)));
+
+  /* Resolve the tree conflict. */
+  SVN_ERR(svn_client_conflict_option_set_moved_to_abspath(option, 0,
+                                                          ctx, b->pool));
+  SVN_ERR(svn_client_conflict_tree_resolve(conflict, option, ctx, b->pool));
+
+  /* Ensure that the moved-away directory has the expected status. */
+  sb.result_pool = b->pool;
+  opt_rev.kind = svn_opt_revision_working;
+  SVN_ERR(svn_client_status6(NULL, ctx, sbox_wc_path(b, deleted_path),
+                             &opt_rev, svn_depth_empty, TRUE, TRUE,
+                             TRUE, TRUE, FALSE, TRUE, NULL,
+                             status_func, &sb, b->pool));
+  status = sb.status;
+  SVN_TEST_ASSERT(status->kind == svn_node_dir);
+  SVN_TEST_ASSERT(status->versioned);
+  SVN_TEST_ASSERT(!status->conflicted);
+  SVN_TEST_ASSERT(status->node_status == svn_wc_status_deleted);
+  SVN_TEST_ASSERT(status->text_status == svn_wc_status_normal);
+  SVN_TEST_ASSERT(status->prop_status == svn_wc_status_none);
+  SVN_TEST_ASSERT(!status->copied);
+  SVN_TEST_ASSERT(!status->switched);
+  SVN_TEST_ASSERT(!status->file_external);
+  SVN_TEST_ASSERT(status->moved_from_abspath == NULL);
+  SVN_TEST_STRING_ASSERT(status->moved_to_abspath,
+                         sbox_wc_path(b, moved_to_path));
+
+  /* Ensure that the moved-here directory has the expected status. */
+  sb.result_pool = b->pool;
+  opt_rev.kind = svn_opt_revision_working;
+  SVN_ERR(svn_client_status6(NULL, ctx, sbox_wc_path(b, moved_to_path),
+                             &opt_rev, svn_depth_empty, TRUE, TRUE,
+                             TRUE, TRUE, FALSE, TRUE, NULL,
+                             status_func, &sb, b->pool));
+  status = sb.status;
+  SVN_TEST_ASSERT(status->kind == svn_node_dir);
+  SVN_TEST_ASSERT(status->versioned);
+  SVN_TEST_ASSERT(!status->conflicted);
+  SVN_TEST_ASSERT(status->node_status == svn_wc_status_added);
+  SVN_TEST_ASSERT(status->text_status == svn_wc_status_normal);
+  SVN_TEST_ASSERT(status->prop_status == svn_wc_status_none);
+  SVN_TEST_ASSERT(status->copied);
+  SVN_TEST_ASSERT(!status->switched);
+  SVN_TEST_ASSERT(!status->file_external);
+  SVN_TEST_STRING_ASSERT(status->moved_from_abspath,
+                         sbox_wc_path(b, deleted_path));
+  SVN_TEST_ASSERT(status->moved_to_abspath == NULL);
+
+  /* Ensure that the edited file has the expected content. */
+  child_path = svn_relpath_join(moved_to_path, deleted_dir_child,
+                                b->pool);
+  SVN_ERR(svn_stringbuf_from_file2(&buf, sbox_wc_path(b, child_path),
+                                   b->pool));
+  SVN_TEST_STRING_ASSERT(buf->data, modified_file_on_branch_content);
+
+  return SVN_NO_ERROR;
+}
+
 /* ========================================================================== */
 
 
@@ -5064,6 +5264,8 @@ static struct svn_test_descriptor_t test
                        "merge incoming move file merge with native eols"),
     SVN_TEST_OPTS_XFAIL(test_cherry_pick_post_move_edit,
                         "cherry-pick edit from moved file"),
+    SVN_TEST_OPTS_PASS(test_merge_incoming_move_dir_across_branches,
+                        "merge incoming dir move across branches"),
     SVN_TEST_NULL
   };
 

Modified: subversion/branches/addremove/subversion/tests/libsvn_repos/dump-load-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/libsvn_repos/dump-load-test.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/libsvn_repos/dump-load-test.c (original)
+++ subversion/branches/addremove/subversion/tests/libsvn_repos/dump-load-test.c Tue Oct 24 12:40:47 2017
@@ -79,7 +79,7 @@ test_dump_bad_props(svn_stringbuf_t **du
   SVN_ERR(svn_repos_dump_fs4(repos, stream, start_rev, end_rev,
                              FALSE, FALSE, TRUE, TRUE,
                              notify_func, notify_baton,
-                             NULL, NULL,
+                             NULL, NULL, NULL, NULL,
                              pool));
   svn_stream_close(stream);
 
@@ -120,13 +120,14 @@ test_load_bad_props(svn_stringbuf_t *dum
   svn_revnum_t youngest_rev;
   svn_string_t *loaded_prop_val;
 
-  SVN_ERR(svn_repos_load_fs5(repos, stream,
+  SVN_ERR(svn_repos_load_fs6(repos, stream,
                              SVN_INVALID_REVNUM, SVN_INVALID_REVNUM,
                              svn_repos_load_uuid_default,
                              parent_fspath,
                              FALSE, FALSE, /*use_*_commit_hook*/
                              validate_props,
                              FALSE /*ignore_dates*/,
+                             FALSE /*normalize_props*/,
                              notify_func, notify_baton,
                              NULL, NULL, /*cancellation*/
                              pool));

Modified: subversion/branches/addremove/subversion/tests/libsvn_subr/string-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/libsvn_subr/string-test.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/libsvn_subr/string-test.c (original)
+++ subversion/branches/addremove/subversion/tests/libsvn_subr/string-test.c Tue Oct 24 12:40:47 2017
@@ -1013,6 +1013,60 @@ test_stringbuf_set(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_cstring_join(apr_pool_t *pool)
+{
+  apr_array_header_t *arr;
+
+  {
+    arr = apr_array_make(pool, 0, sizeof(const char *));
+
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "", FALSE, pool), "");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "", TRUE, pool), "");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, ";", FALSE, pool), "");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, ";", TRUE, pool), "");
+  }
+
+  {
+    arr = apr_array_make(pool, 0, sizeof(const char *));
+    APR_ARRAY_PUSH(arr, const char *) = "";
+
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "", FALSE, pool), "");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "", TRUE, pool), "");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, ";", FALSE, pool), "");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, ";", TRUE, pool), ";");
+  }
+
+  {
+    arr = apr_array_make(pool, 0, sizeof(const char *));
+    APR_ARRAY_PUSH(arr, const char *) = "ab";
+    APR_ARRAY_PUSH(arr, const char *) = "cd";
+
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "", FALSE, pool), "abcd");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "", TRUE, pool), "abcd");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, ";", FALSE, pool), "ab;cd");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, ";", TRUE, pool), "ab;cd;");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "//", FALSE, pool), "ab//cd");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "//", TRUE, pool), "ab//cd//");
+  }
+
+  {
+    arr = apr_array_make(pool, 0, sizeof(const char *));
+    APR_ARRAY_PUSH(arr, const char *) = "";
+    APR_ARRAY_PUSH(arr, const char *) = "ab";
+    APR_ARRAY_PUSH(arr, const char *) = "";
+
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "", FALSE, pool), "ab");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "", TRUE, pool), "ab");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, ";", FALSE, pool), ";ab;");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, ";", TRUE, pool), ";ab;;");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "//", FALSE, pool), "//ab//");
+    SVN_TEST_STRING_ASSERT(svn_cstring_join2(arr, "//", TRUE, pool), "//ab////");
+  }
+
+  return SVN_NO_ERROR;
+}
+
 /*
    ====================================================================
    If you add a new test to this file, update this array.
@@ -1095,6 +1149,8 @@ static struct svn_test_descriptor_t test
                    "test svn_stringbuf_leftchop"),
     SVN_TEST_PASS2(test_stringbuf_set,
                    "test svn_stringbuf_set()"),
+    SVN_TEST_PASS2(test_cstring_join,
+                   "test svn_cstring_join2()"),
     SVN_TEST_NULL
   };
 

Modified: subversion/branches/addremove/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/libsvn_wc/utils.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/branches/addremove/subversion/tests/libsvn_wc/utils.c Tue Oct 24 12:40:47 2017
@@ -139,12 +139,9 @@ svn_test__create_fake_wc(const char *wc_
    * refer to it over its lifetime. */
   my_statements = apr_palloc(scratch_pool, 7 * sizeof(const char *));
   my_statements[0] = statements[STMT_CREATE_SCHEMA];
-  my_statements[1] = statements[STMT_CREATE_NODES];
-  my_statements[2] = statements[STMT_CREATE_NODES_TRIGGERS];
-  my_statements[3] = statements[STMT_CREATE_EXTERNALS];
-  my_statements[4] = statements[STMT_INSTALL_SCHEMA_STATISTICS];
-  my_statements[5] = extra_statements;
-  my_statements[6] = NULL;
+  my_statements[1] = statements[STMT_INSTALL_SCHEMA_STATISTICS];
+  my_statements[2] = extra_statements;
+  my_statements[3] = NULL;
 
   /* Create fake-wc/SUBDIR/.svn/ for placing the metadata. */
   SVN_ERR(svn_io_make_dir_recursively(dotsvn_abspath, scratch_pool));

Modified: subversion/branches/addremove/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/branches/addremove/subversion/tests/libsvn_wc/wc-queries-test.c Tue Oct 24 12:40:47 2017
@@ -70,9 +70,6 @@ static const int schema_statements[] =
 {
   /* Usual tables */
   STMT_CREATE_SCHEMA,
-  STMT_CREATE_NODES,
-  STMT_CREATE_NODES_TRIGGERS,
-  STMT_CREATE_EXTERNALS,
   STMT_INSTALL_SCHEMA_STATISTICS,
   /* Memory tables */
   STMT_CREATE_TARGETS_LIST,

Modified: subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh (original)
+++ subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/mkramdisk.sh Tue Oct 24 12:40:47 2017
@@ -53,7 +53,7 @@ mount | grep "^/dev/disk[0-9][0-9]* on $
 
     # Make sure we strip trailing spaces from the result of older
     # versions of hduitil.
-    device=$(echo $(hdiutil attach -nomount ram://1000000))
+    device=$(echo $(hdiutil attach -nomount ram://2000000))
     newfs_hfs -M 0700 -v "$1" "${device}"
     hdiutil mountvol "${device}"
 

Modified: subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/setenv.sh
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/setenv.sh?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/setenv.sh (original)
+++ subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/setenv.sh Tue Oct 24 12:40:47 2017
@@ -29,6 +29,7 @@
 ##     SVNBB_APR_20_DEV         Path of APR-2.0
 ##     SVNBB_JUNIT              The path of the junit.jar
 ##     SVNBB_PARALLEL           Optional: parallelization; defaults to 2
+##     SVNBB_PYTHON3ENV         Optional: Python 3 virtual environment
 ##
 ## The invoking script will set local variable named ${scripts} that
 ## is the absolute path the parent of this file.
@@ -48,6 +49,7 @@ export SVNBB_APR_15
 export SVNBB_APR_20_DEV
 export SVNBB_JUNIT
 export SVNBB_PARALLEL
+export SVNBB_PYTHON3ENV
 
 
 # Set the absolute source path

Modified: subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/svncheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/svncheck.sh?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/svncheck.sh (original)
+++ subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/svncheck.sh Tue Oct 24 12:40:47 2017
@@ -63,6 +63,7 @@ scripts=$(cd $(dirname "$0") && pwd)
 . ${scripts}/setenv.sh
 
 # Parse arguments to find out which tests we should run
+use_python3=false
 check_local=false
 check_svn=false
 check_dav=false
@@ -74,6 +75,7 @@ check_bdb=false
 
 while [ ! -z "$1" ]; do
     case "$1" in
+        python3) use_python3=true;;
         local)   check_local=true;;
         svn)     check_svn=true;;
         dav)     check_dav=true;;
@@ -87,6 +89,8 @@ while [ ! -z "$1" ]; do
     shift
 done
 
+${use_python3} && test -n "${SVNBB_PYTHON3ENV}" && . ${SVNBB_PYTHON3ENV}/bin/activate
+
 ${check_local} && check_tests local
 ${check_svn} && check_tests svn
 ${check_dav} && check_tests dav

Modified: subversion/branches/addremove/tools/client-side/bash_completion
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/tools/client-side/bash_completion?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/tools/client-side/bash_completion (original)
+++ subversion/branches/addremove/tools/client-side/bash_completion Tue Oct 24 12:40:47 2017
@@ -1102,9 +1102,9 @@ _svnadmin ()
 	cur=${COMP_WORDS[COMP_CWORD]}
 
 	# Possible expansions, without pure-prefix abbreviations such as "h".
-	cmds='crashtest create delrevprop deltify dump freeze help hotcopy \
-	      info list-dblogs \
-	      list-unused-dblogs load lock lslocks lstxns pack recover rmlocks \
+	cmds='crashtest create delrevprop deltify dump dump-revprops freeze \
+	      help hotcopy info list-dblogs list-unused-dblogs \
+	      load load-revprops lock lslocks lstxns pack recover rmlocks \
 	      rmtxns setlog setrevprop setuuid unlock upgrade verify --version'
 
 	if [[ $COMP_CWORD -eq 1 ]] ; then
@@ -1115,7 +1115,7 @@ _svnadmin ()
 	# options that require a parameter
 	# note: continued lines must end '|' continuing lines must start '|'
 	optsParam="-r|--revision|--parent-dir|--fs-type|-M|--memory-cache-size"
-	optsParam="$optsParam|-F|--file"
+	optsParam="$optsParam|-F|--file|--exclude|--include"
 
 	# if not typing an option, or if the previous option required a
 	# parameter, then fallback on ordinary filename expansion
@@ -1138,7 +1138,8 @@ _svnadmin ()
 		;;
 	dump)
 		cmdOpts="-r --revision --incremental -q --quiet --deltas \
-		         -M --memory-cache-size -F --file"
+		         -M --memory-cache-size -F --file \
+		         --exclude --include --pattern"
 		;;
 	freeze)
 		cmdOpts="-F --file"
@@ -1153,7 +1154,7 @@ _svnadmin ()
 		cmdOpts="--ignore-uuid --force-uuid --parent-dir -q --quiet \
 		         --use-pre-commit-hook --use-post-commit-hook \
 		         --bypass-prop-validation -M --memory-cache-size \
-		         --no-flush-to-disk -F --file"
+		         --no-flush-to-disk --normalize-props -F --file"
 		;;
 	lstxns)
         	cmdOpts="-r --revision"
@@ -1255,9 +1256,9 @@ _svndumpfilter ()
 	cmdOpts=
 	case ${COMP_WORDS[1]} in
 	exclude|include)
-		cmdOpts="--drop-empty-revs --renumber-revs
+		cmdOpts="--drop-empty-revs --drop-all-empty-revs --renumber-revs
 		         --skip-missing-merge-sources --targets
-		         --preserve-revprops --quiet"
+		         --preserve-revprops --quiet --pattern"
 		;;
 	help|h|\?)
 		cmdOpts="$cmds"

Modified: subversion/branches/addremove/tools/dev/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/tools/dev/svnmover/svnmover.c?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/tools/dev/svnmover/svnmover.c (original)
+++ subversion/branches/addremove/tools/dev/svnmover/svnmover.c Tue Oct 24 12:40:47 2017
@@ -3921,7 +3921,8 @@ execute(svnmover_wc_t *wc,
           wc->list_of_commands
             = apr_psprintf(pool, "%s%s\n",
                            wc->list_of_commands ? wc->list_of_commands : "",
-                           svn_cstring_join(action->action_args, " ", pool));
+                           svn_cstring_join2(action->action_args, " ",
+                                             TRUE, pool));
         }
     }
   svn_pool_destroy(iterpool);

Modified: subversion/branches/addremove/tools/dist/templates/rc-release-ann.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/tools/dist/templates/rc-release-ann.ezt?rev=1813173&r1=1813172&r2=1813173&view=diff
==============================================================================
--- subversion/branches/addremove/tools/dist/templates/rc-release-ann.ezt (original)
+++ subversion/branches/addremove/tools/dist/templates/rc-release-ann.ezt Tue Oct 24 12:40:47 2017
@@ -37,7 +37,7 @@ A pre-release means the Subversion devel
 is ready for widespread testing by the community.  There are known issues
 (and unknown ones!), so please use it at your own risk, though we do
 encourage people to test this release thoroughly.  Of particular note, please
-remember than persistent data, such as the working copy or repository
+remember that persistent data, such as the working copy or repository
 formats may change before the final release, and there may not be an
 upgrade path from the pre-releases to the final.
 



Mime
View raw message