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

svn commit: r1416996 [11/13] - in /subversion/branches/wc-collate-path: ./ build/ build/ac-macros/ build/generator/ contrib/client-side/svnmerge/ contrib/server-side/svncutter/ notes/ subversion/bindings/cxxhl/ subversion/bindings/javahl/native/ subver...

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests.py Tue Dec  4 15:35:13 2012
@@ -100,7 +100,7 @@ def run_dump_test(sbox, dumpfile_name, e
   expected_dumpfile_name is produced if provided. Additionally, the
   subdir argument appends itself to the URL"""
 
-  # Create an empty sanbox repository
+  # Create an empty sandbox repository
   build_repos(sbox)
 
   # This directory contains all the dump files
@@ -197,7 +197,6 @@ def run_load_test(sbox, dumpfile_name, e
 ######################################################################
 # Tests
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def basic_dump(sbox):
   "dump: standard sbox repos"
   sbox.build(read_only = True, create_wc = False)
@@ -210,7 +209,6 @@ def basic_dump(sbox):
   if not out[0].startswith('SVN-fs-dump-format-version:'):
     raise svntest.Failure('No valid output')
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def revision_0_dump(sbox):
   "dump: revision zero"
   run_dump_test(sbox, "revision-0.dump")
@@ -229,7 +227,6 @@ def revision_0_load(sbox):
 #     docs/         (Added r6)
 #       README      (Added r6)
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def skeleton_dump(sbox):
   "dump: skeleton repository"
   run_dump_test(sbox, "skeleton.dump")
@@ -238,7 +235,6 @@ def skeleton_load(sbox):
   "load: skeleton repository"
   run_load_test(sbox, "skeleton.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def sparse_propchanges_dump(sbox):
   "dump: sparse file/dir propchanges"
   run_dump_test(sbox, "sparse-propchanges.dump")
@@ -248,7 +244,6 @@ def sparse_propchanges_load(sbox):
   "load: sparse file/dir propchanges"
   run_load_test(sbox, "sparse-propchanges.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def copy_and_modify_dump(sbox):
   "dump: copy and modify"
   run_dump_test(sbox, "copy-and-modify.dump")
@@ -257,7 +252,6 @@ def copy_and_modify_load(sbox):
   "load: copy and modify"
   run_load_test(sbox, "copy-and-modify.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def no_author_dump(sbox):
   "dump: copy revs with no svn:author revprops"
   run_dump_test(sbox, "no-author.dump")
@@ -266,7 +260,6 @@ def no_author_load(sbox):
   "load: copy revs with no svn:author revprops"
   run_load_test(sbox, "no-author.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def copy_from_previous_version_and_modify_dump(sbox):
   "dump: copy from previous version and modify"
   run_dump_test(sbox, "copy-from-previous-version-and-modify.dump")
@@ -275,7 +268,6 @@ def copy_from_previous_version_and_modif
   "load: copy from previous version and modify"
   run_load_test(sbox, "copy-from-previous-version-and-modify.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def modified_in_place_dump(sbox):
   "dump: modified in place"
   run_dump_test(sbox, "modified-in-place.dump")
@@ -284,7 +276,6 @@ def modified_in_place_load(sbox):
   "load: modified in place"
   run_load_test(sbox, "modified-in-place.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def move_and_modify_in_the_same_revision_dump(sbox):
   "dump: move parent & modify child file in same rev"
   run_dump_test(sbox, "move-and-modify.dump")
@@ -293,7 +284,6 @@ def move_and_modify_in_the_same_revision
   "load: move parent & modify child file in same rev"
   run_load_test(sbox, "move-and-modify.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def tag_empty_trunk_dump(sbox):
   "dump: tag empty trunk"
   run_dump_test(sbox, "tag-empty-trunk.dump")
@@ -302,7 +292,6 @@ def tag_empty_trunk_load(sbox):
   "load: tag empty trunk"
   run_load_test(sbox, "tag-empty-trunk.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def tag_trunk_with_file_dump(sbox):
   "dump: tag trunk containing a file"
   run_dump_test(sbox, "tag-trunk-with-file.dump")
@@ -311,7 +300,6 @@ def tag_trunk_with_file_load(sbox):
   "load: tag trunk containing a file"
   run_load_test(sbox, "tag-trunk-with-file.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def tag_trunk_with_file2_dump(sbox):
   "dump: tag trunk containing a file (#2)"
   run_dump_test(sbox, "tag-trunk-with-file2.dump")
@@ -320,7 +308,6 @@ def tag_trunk_with_file2_load(sbox):
   "load: tag trunk containing a file (#2)"
   run_load_test(sbox, "tag-trunk-with-file2.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def dir_prop_change_dump(sbox):
   "dump: directory property changes"
   run_dump_test(sbox, "dir-prop-change.dump")
@@ -329,7 +316,6 @@ def dir_prop_change_load(sbox):
   "load: directory property changes"
   run_load_test(sbox, "dir-prop-change.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def copy_parent_modify_prop_dump(sbox):
   "dump: copy parent and modify prop"
   run_dump_test(sbox, "copy-parent-modify-prop.dump")
@@ -338,7 +324,6 @@ def copy_parent_modify_prop_load(sbox):
   "load: copy parent and modify prop"
   run_load_test(sbox, "copy-parent-modify-prop.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def copy_revprops_dump(sbox):
   "dump: copy revprops other than svn:*"
   run_dump_test(sbox, "revprops.dump")
@@ -347,21 +332,16 @@ def copy_revprops_load(sbox):
   "load: copy revprops other than svn:*"
   run_load_test(sbox, "revprops.dump")
 
-@XFail()
-@Skip(svntest.main.is_ra_type_dav_serf)
 def only_trunk_dump(sbox):
   "dump: subdirectory"
   run_dump_test(sbox, "trunk-only.dump", subdir="/trunk",
-                expected_dumpfile_name="trunk-only.expected.dump")
+                expected_dumpfile_name="trunk-only.expected.dump",)
 
-@XFail()
-@Skip(svntest.main.is_ra_type_dav_serf)
 def only_trunk_A_with_changes_dump(sbox):
   "dump: subdirectory with changes on root"
   run_dump_test(sbox, "trunk-A-changes.dump", subdir="/trunk/A",
            expected_dumpfile_name="trunk-A-changes.expected.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def url_encoding_dump(sbox):
   "dump: url encoding issues"
   run_dump_test(sbox, "url-encoding-bug.dump")
@@ -370,21 +350,18 @@ def url_encoding_load(sbox):
   "load: url encoding issues"
   run_load_test(sbox, "url-encoding-bug.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def copy_bad_line_endings_dump(sbox):
   "dump: inconsistent line endings in svn:* props"
   run_dump_test(sbox, "copy-bad-line-endings.dump",
                 expected_dumpfile_name="copy-bad-line-endings.expected.dump",
                 bypass_prop_validation=True)
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def copy_bad_line_endings2_dump(sbox):
   "dump: non-LF line endings in svn:* props"
   run_dump_test(sbox, "copy-bad-line-endings2.dump",
                 expected_dumpfile_name="copy-bad-line-endings2.expected.dump",
                 bypass_prop_validation=True, ignore_base_checksums=True)
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def commit_a_copy_of_root_dump(sbox):
   "dump: commit a copy of root"
   run_dump_test(sbox, "repo-with-copy-of-root-dir.dump")
@@ -393,7 +370,6 @@ def commit_a_copy_of_root_load(sbox):
   "load: commit a copy of root"
   run_load_test(sbox, "repo-with-copy-of-root-dir.dump")
 
-@Skip(svntest.main.is_ra_type_dav_serf)
 def descend_into_replace_dump(sbox):
   "dump: descending into replaced dir looks in src"
   run_dump_test(sbox, "descend-into-replace.dump", subdir='/trunk/H',
@@ -404,7 +380,6 @@ def descend_into_replace_load(sbox):
   run_load_test(sbox, "descend-into-replace.dump")
 
 @Issue(3847)
-@Skip(svntest.main.is_ra_type_dav_serf)
 def add_multi_prop_dump(sbox):
   "dump: add with multiple props"
   run_dump_test(sbox, "add-multi-prop.dump")
@@ -419,7 +394,6 @@ def multi_prop_edit_load(sbox):
 # revs in svn:mergeinfo' but uses 'svnrdump load' in place of
 # 'svnadmin load'.
 @Issue(3890)
-@Skip(svntest.main.is_ra_type_dav_serf)
 def reflect_dropped_renumbered_revs(sbox):
   "svnrdump renumbers dropped revs in mergeinfo"
 
@@ -483,7 +457,6 @@ def reflect_dropped_renumbered_revs(sbox
 # from incremental dump' but uses 'svnrdump [dump|load]' in place of
 # 'svnadmin [dump|load]'.
 @Issue(3890)
-@Skip(svntest.main.is_ra_type_dav_serf)
 def dont_drop_valid_mergeinfo_during_incremental_svnrdump_loads(sbox):
   "don't drop mergeinfo revs in incremental svnrdump"
 

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests_data/trunk-A-changes.expected.dump
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests_data/trunk-A-changes.expected.dump?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
Files subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests_data/trunk-A-changes.expected.dump (original) and subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests_data/trunk-A-changes.expected.dump Tue Dec  4 15:35:13 2012 differ

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests_data/trunk-only.expected.dump
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests_data/trunk-only.expected.dump?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
Files subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests_data/trunk-only.expected.dump (original) and subversion/branches/wc-collate-path/subversion/tests/cmdline/svnrdump_tests_data/trunk-only.expected.dump Tue Dec  4 15:35:13 2012 differ

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/actions.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/actions.py Tue Dec  4 15:35:13 2012
@@ -1918,7 +1918,11 @@ def get_wc_base_rev(wc_dir):
 def hook_failure_message(hook_name):
   """Return the error message that the client prints for failure of the
   specified hook HOOK_NAME. The wording changed with Subversion 1.5."""
-  if svntest.main.options.server_minor_version < 5:
+
+  # Output depends on the server version, not the repository version.
+  # This gets the wrong result for modern servers with old format
+  # repositories.
+  if svntest.main.options.server_minor_version < 5 and not svntest.main.is_ra_type_file():
     return "'%s' hook failed with error output:\n" % hook_name
   else:
     if hook_name in ["start-commit", "pre-commit"]:
@@ -1985,8 +1989,12 @@ def create_failing_post_commit_hook(repo
 # set_prop can be used for properties with NULL characters which are not
 # handled correctly when passed to subprocess.Popen() and values like "*"
 # which are not handled correctly on Windows.
-def set_prop(name, value, path, expected_re_string=None):
+def set_prop(name, value, path, expected_re_string=None, force=None):
   """Set a property with specified value"""
+  if not force:
+    propset = ('propset',)
+  else:
+    propset = ('propset', '--force')
   if value and (value[0] == '-' or '\x00' in value or sys.platform == 'win32'):
     from tempfile import mkstemp
     (fd, value_file_path) = mkstemp()
@@ -1995,12 +2003,12 @@ def set_prop(name, value, path, expected
     value_file.write(value)
     value_file.flush()
     value_file.close()
-    exit_code, out, err = main.run_svn(expected_re_string, 'propset',
-                                       '-F', value_file_path, name, path)
+    propset += ('-F', value_file_path, name, path)
+    exit_code, out, err = main.run_svn(expected_re_string, *propset)
     os.remove(value_file_path)
   else:
-    exit_code, out, err = main.run_svn(expected_re_string, 'propset',
-                                       name, value, path)
+    propset += (name, value, path)
+    exit_code, out, err = main.run_svn(expected_re_string, *propset)
   if expected_re_string:
     if not expected_re_string.startswith(".*"):
       expected_re_string = ".*(" + expected_re_string + ")"

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/factory.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/factory.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/factory.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/factory.py Tue Dec  4 15:35:13 2012
@@ -310,6 +310,7 @@ class TestFactory:
 
     # Wether we ever used the variables 'wc_dir' and 'url' (tiny tweak)
     self.used_wc_dir = False
+    self.used_abs_wc_dir = False
     self.used_url = False
 
     # The alternate working copy directories created that need to be
@@ -350,6 +351,8 @@ class TestFactory:
       # main wc_dir and url
       if self.used_wc_dir:
         init += 'wc_dir = sbox.wc_dir\n'
+      if self.used_abs_wc_dir:
+        init += 'abs_wc_dir = os.path.abspath(sbox.wc_dir)\n'
       if self.used_url:
         init += 'url = sbox.repo_url\n'
 
@@ -447,9 +450,14 @@ class TestFactory:
         return self.cmd_svn_checkout(args[2:])
 
       if second in ['propset','pset','ps']:
-        return self.cmd_svn(args[1:], False,
+        multiline_args = [arg.replace(r'\n', '\n') for arg in args[1:]]
+        return self.cmd_svn(multiline_args, False,
           self.keep_args_of, 3)
 
+      if second in ['propget','pget','pg']:
+        return self.cmd_svn(args[1:], False,
+          self.keep_args_of, 2)
+
       if second in ['delete','del','remove', 'rm']:
         return self.cmd_svn(args[1:], False,
           self.keep_args_of + ['--with-revprop'])
@@ -1115,7 +1123,7 @@ class TestFactory:
         if not runpath:
           continue
         strlen = len(runpath)
-        item = [strlen, name, runpath]
+        item = (strlen, name, runpath)
         bisect.insort(lst, item)
 
     return lst
@@ -1128,14 +1136,14 @@ class TestFactory:
     urls = []
     for name in self.vars:
       if name.startswith('url_'):
-        bisect.insort(urls, [name.lower(), name])
+        bisect.insort(urls, (name.lower(), name))
       else:
-        bisect.insort(paths, [name.lower(), name])
+        bisect.insort(paths, (name.lower(), name))
     list = []
     for path in paths:
-      list += [path[1]]
+      list.append(path[1])
     for url in urls:
-      list += [url[1]]
+      list.append(url[1])
     return list
 
 
@@ -1168,8 +1176,20 @@ class TestFactory:
       path = var[2]
       str = replace(str, path, name, quote)
 
-    str = replace(str, self.sbox.wc_dir, 'wc_dir', quote)
-    str = replace(str, self.sbox.repo_url, 'url', quote)
+    str2 = replace(str, os.path.abspath(self.sbox.wc_dir), 'abs_wc_dir', quote)
+    if str != str2:
+      self.used_abs_wc_dir = True
+    str = str2
+
+    str2 = replace(str, self.sbox.wc_dir, 'wc_dir', quote)
+    if str != str2:
+      self.used_wc_dir = True
+    str = str2
+
+    str2 = replace(str, self.sbox.repo_url, 'url', quote)
+    if str != str2:
+      self.used_url = True
+    str = str2
 
     # now remove trailing null-str adds:
     #   '' + url_A_C + ''
@@ -1615,6 +1635,7 @@ class TestFactory:
 
     # special case: if a path is '.', simply use wc_dir.
     if pathelements == ['.']:
+      self.used_wc_dir = True
       return wc.py, wc.realpath
 
     name = "_".join(pathelements)

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/main.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/main.py Tue Dec  4 15:35:13 2012
@@ -337,9 +337,10 @@ def get_fsfs_format_file_path(repo_dir):
   return os.path.join(repo_dir, "db", "format")
 
 def filter_dbg(lines):
-  for line in lines:
-    if not line.startswith('DBG:'):
-      yield line
+  excluded = filter(lambda line: line.startswith('DBG:'), lines)
+  included = filter(lambda line: not line.startswith('DBG:'), lines)
+  sys.stdout.write(''.join(excluded))
+  return included
 
 # Run any binary, logging the command line and return code
 def run_command(command, error_expected, binary_mode=0, *varargs):
@@ -537,11 +538,11 @@ def run_command_stdin(command, error_exp
     raise Failure
 
   return exit_code, \
-         [line for line in stdout_lines if not line.startswith("DBG:")], \
+         filter_dbg(stdout_lines), \
          stderr_lines
 
 def create_config_dir(cfgdir, config_contents=None, server_contents=None,
-                      ssl_cert=None, ssl_url=None):
+                      ssl_cert=None, ssl_url=None, http_proxy=None):
   "Create config directories and files"
 
   # config file names
@@ -568,13 +569,19 @@ interactive-conflicts = false
     http_library_str = ""
     if options.http_library:
       http_library_str = "http-library=%s" % (options.http_library)
+    http_proxy_str = ""
+    if options.http_proxy:
+      http_proxy_parsed = urlparse("//" + options.http_proxy)
+      http_proxy_str = "http-proxy-host=%s\n" % (http_proxy_parsed.hostname) + \
+                       "http-proxy-port=%d" % (http_proxy_parsed.port or 80)
     server_contents = """
 #
 [global]
 %s
+%s
 store-plaintext-passwords=yes
 store-passwords=yes
-""" % (http_library_str)
+""" % (http_library_str, http_proxy_str)
 
   file_write(cfgfile_cfg, config_contents)
   file_write(cfgfile_srv, server_contents)
@@ -713,7 +720,7 @@ def run_entriesdump(path):
   class Entry(object):
     pass
   entries = { }
-  exec(''.join([line for line in stdout_lines if not line.startswith("DBG:")]))
+  exec(''.join(filter_dbg(stdout_lines)))
   return entries
 
 def run_entriesdump_subdirs(path):
@@ -722,7 +729,7 @@ def run_entriesdump_subdirs(path):
   # to stdout in verbose mode.
   exit_code, stdout_lines, stderr_lines = spawn_process(entriesdump_binary,
                                                         0, 0, None, '--subdirs', path)
-  return [line.strip() for line in stdout_lines if not line.startswith("DBG:")]
+  return map(lambda line: line.strip(), filter_dbg(stdout_lines))
 
 def run_atomic_ra_revprop_change(url, revision, propname, skel, want_error):
   """Run the atomic-ra-revprop-change helper, returning its exit code, stdout,
@@ -829,12 +836,7 @@ def create_repos(path, minor_version = N
   opts = ("--bdb-txn-nosync",)
   if not minor_version or minor_version > options.server_minor_version:
     minor_version = options.server_minor_version
-  if minor_version < 4:
-    opts += ("--pre-1.4-compatible",)
-  elif minor_version < 5:
-    opts += ("--pre-1.5-compatible",)
-  elif minor_version < 6:
-    opts += ("--pre-1.6-compatible",)
+  opts += ("--compatible-version=1.%d" % (minor_version),)
   if options.fs_type is not None:
     opts += ("--fs-type=" + options.fs_type,)
   exit_code, stdout, stderr = run_command(svnadmin_binary, 1, 0, "create",
@@ -1287,6 +1289,8 @@ class TestSpawningThread(threading.Threa
       args.append('--milestone-filter=' + options.milestone_filter)
     if options.ssl_cert:
       args.append('--ssl-cert=' + options.ssl_cert)
+    if options.http_proxy:
+      args.append('--http-proxy=' + options.http_proxy)
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, 0, None,
                                                        *args)
@@ -1640,6 +1644,8 @@ def _create_parser():
                     help='Source directory.')
   parser.add_option('--ssl-cert', action='store',
                     help='Path to SSL server certificate.')
+  parser.add_option('--http-proxy', action='store',
+                    help='Use the HTTP Proxy at hostname:port.')
 
   # most of the defaults are None, but some are other values, set them here
   parser.set_defaults(
@@ -1953,7 +1959,8 @@ def execute_tests(test_list, serial_only
     # Build out the default configuration directory
     create_config_dir(default_config_dir,
                       ssl_cert=options.ssl_cert,
-                      ssl_url=options.test_area_url)
+                      ssl_url=options.test_area_url,
+                      http_proxy=options.http_proxy)
 
     # Setup the pristine repository
     svntest.actions.setup_pristine_greek_repository()

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/sandbox.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/sandbox.py Tue Dec  4 15:35:13 2012
@@ -307,6 +307,17 @@ class Sandbox:
         raise Exception("Unexpected line '" + line + "' in proplist output" + str(out))
     return props
 
+  def simple_add_symlink(self, dest, target):
+    """Create a symlink TARGET pointing to DEST and add it to subversion"""
+    if svntest.main.is_posix_os():
+      os.symlink(dest, self.ospath(target))
+    else:
+      svntest.main.file_write(self.ospath(target), "link %s" % dest)
+    self.simple_add(target)
+    if not svntest.main.is_posix_os():
+      # '*' is evaluated on Windows
+      self.simple_propset('svn:special', 'X', target)
+
   def simple_copy(self, source, dest):
     """Copy SOURCE to DEST in the WC.
        SOURCE and DEST are relpaths relative to the WC."""

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/verify.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/verify.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/verify.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/verify.py Tue Dec  4 15:35:13 2012
@@ -362,7 +362,7 @@ def compare_and_display_lines(message, l
 
   if isinstance(actual, str):
     actual = [actual]
-  actual = [line for line in actual if not line.startswith('DBG:')]
+  actual = svntest.main.filter_dbg(actual)
 
   if not expected.matches(actual, except_re):
     expected.display_differences(message, label, actual)

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/wc.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/svntest/wc.py Tue Dec  4 15:35:13 2012
@@ -886,6 +886,14 @@ def text_base_path(file_path):
 
   raise svntest.Failure("No pristine text for " + relpath)
 
+def sqlite_stmt(wc_root_path, stmt):
+  """Execute STMT on the SQLite wc.db in WC_ROOT_PATH and return the
+     results."""
+
+  db = open_wc_db(wc_root_path)[0]
+  c = db.cursor()
+  c.execute(stmt)
+  return c.fetchall()
 
 # ------------
 ### probably toss these at some point. or major rework. or something.

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/switch_tests.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/switch_tests.py Tue Dec  4 15:35:13 2012
@@ -586,6 +586,11 @@ def file_dir_file(sbox):
   if not os.path.isdir(file_path):
     raise svntest.Failure
 
+  # The reason the following switch currently fails is that the node
+  # is determined to be a 'root', because it is switched against its parent.
+  # In this specific case the switch editor is designed to be rooted on the node
+  # itself instead of its ancestor. If you would use sbox.ospath('A') for
+  # file_path the switch works both ways.
   svntest.actions.run_and_verify_svn(None, None, [], 'switch',
                                      '--ignore-ancestry', file_url, file_path)
   if not os.path.isfile(file_path):
@@ -2219,8 +2224,9 @@ def switch_to_root(sbox):
 
 #----------------------------------------------------------------------
 # Make sure that switch continue after deleting locally modified
-# directories, as it update and merge do.
+# directories, as update and merge do.
 
+@Issue(2505)
 def tolerate_local_mods(sbox):
   "tolerate deletion of a directory with local mods"
 

Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/update_tests.py?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/update_tests.py Tue Dec  4 15:35:13 2012
@@ -5523,6 +5523,16 @@ def update_to_HEAD_plus_1(sbox):
                                         None, None,
                                         None, None, None, wc_dir, '-r', '2')
 
+  other_wc = sbox.add_wc_path('other')
+  other_url = sbox.repo_url + '/A'
+  svntest.actions.run_and_verify_svn("subtree checkout", None, [],
+                                     'co', other_url, other_wc)
+  svntest.actions.run_and_verify_update(other_wc,
+                                        None, None, None,
+                                        "E160006.*No such.*revision",
+                                        None, None,
+                                        None, None, None, other_wc, '-r', '2')
+
 @XFail()
 def update_moved_dir_leaf_del(sbox):
   "update locally moved dir with leaf del"
@@ -5735,6 +5745,7 @@ def update_moved_dir_file_move(sbox):
                                         None, None, 1)
 
 @XFail()
+@Issue(3144,3630)
 def update_move_text_mod(sbox):
   "text mod to moved files"
 
@@ -5784,6 +5795,7 @@ def update_move_text_mod(sbox):
                                         None, None, 1)
 
 @XFail()
+@Issue(3144,3630)
 def update_nested_move_text_mod(sbox):
   "text mod to moved file in moved dir"
 

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_client/client-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_client/client-test.c Tue Dec  4 15:35:13 2012
@@ -636,8 +636,8 @@ test_16k_add(const svn_test_opts_t *opts
                                        svn_io_file_del_none,
                                        iterpool, iterpool));
 
-      SVN_ERR(svn_client_add4(path, svn_depth_unknown, FALSE, FALSE, FALSE,
-                              ctx, iterpool));
+      SVN_ERR(svn_client_add5(path, svn_depth_unknown, FALSE, FALSE, FALSE,
+                              FALSE, ctx, iterpool));
     }
 
   targets = apr_array_make(pool, 1, sizeof(const char *));
@@ -721,88 +721,6 @@ test_youngest_common_ancestor(const svn_
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *
-test_externals_parse(const svn_test_opts_t *opts, apr_pool_t *pool)
-{
-  int i;
-  struct external_info
-    {
-      const char *line;
-      const char *url;
-      const char *local_path;
-      svn_revnum_t peg_rev;
-      svn_revnum_t rev;
-      
-    } items[] = {
-        {
-            "dir http://server/svn/a",
-            "http://server/svn/a",
-            "dir"
-        },
-        {
-            "/svn/home dir",
-            "u://svr/svn/home",
-            "dir"
-        },
-        {
-            "//server/home dir",
-            "u://server/home",
-            "dir"
-        },
-        {
-            "../../../../home dir",
-            "u://svr/svn/home",
-            "dir",
-        },
-        {
-            "^/../repB/tools/scripts scripts",
-            "u://svr/svn/cur/repB/tools/scripts",
-            "scripts"
-        },
-        { 
-            "^/../repB/tools/README.txt scripts/README.txt",
-            "u://svr/svn/cur/repB/tools/README.txt",
-            "scripts/README.txt"
-        },
-    };
-  
-
-  for (i = 0; i < sizeof(items) / sizeof(items[0]); i++)
-    {
-      apr_array_header_t *results;
-      svn_wc_external_item2_t *external_item;
-      const char *resolved_url;
-      SVN_ERR(svn_wc_parse_externals_description3(&results, "/my/current/dir",
-                                                  items[i].line, FALSE, pool));
-
-      SVN_TEST_ASSERT(results && results->nelts == 1);
-
-      external_item = APR_ARRAY_IDX(results, 0, svn_wc_external_item2_t *);
-
-      SVN_ERR(svn_wc__resolve_relative_external_url(&resolved_url,
-                                                    external_item,
-                                                    "u://svr/svn/cur/dir",
-                                                    "u://svr/svn/cur/dir/sd/fl",
-                                                    pool, pool));
-
-      SVN_TEST_STRING_ASSERT(resolved_url, items[i].url);
-      SVN_TEST_STRING_ASSERT(external_item->target_dir, items[i].local_path);
-
-      if (items[i].peg_rev != 0)
-        SVN_TEST_ASSERT(external_item->peg_revision.value.number
-                                == items[i].peg_rev);
-      if (items[i].rev != 0)
-        SVN_TEST_ASSERT(external_item->revision.value.number == items[i].rev);
-      SVN_TEST_ASSERT(svn_uri_is_canonical(resolved_url, pool));
-    }
-
-
-  return SVN_NO_ERROR;
-
-}
-
-
-
 
 /* ========================================================================== */
 
@@ -820,6 +738,5 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_OPTS_PASS(test_16k_add, "test adding 16k files"),
 #endif
     SVN_TEST_OPTS_PASS(test_youngest_common_ancestor, "test youngest_common_ancestor"),
-    SVN_TEST_OPTS_PASS(test_externals_parse, "test svn_wc_parse_externals_description3"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_fs/fs-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_fs/fs-test.c Tue Dec  4 15:35:13 2012
@@ -3533,7 +3533,8 @@ static int my_rand(apr_uint64_t scalar, 
 {
   static const apr_uint32_t TEST_RAND_MAX = 0xffffffffUL;
   /* Assumes TEST_RAND_MAX+1 can be exactly represented in a double */
-  return (int)(((double)svn_test_rand(seed)
+  apr_uint32_t r = svn_test_rand(seed);
+  return (int)(((double)r
                 / ((double)TEST_RAND_MAX+1.0))
                * (double)scalar);
 }
@@ -4895,6 +4896,36 @@ node_history(const svn_test_opts_t *opts
   return SVN_NO_ERROR;
 }
 
+/* Test svn_fs_delete_fs(). */
+static svn_error_t *
+delete_fs(const svn_test_opts_t *opts,
+             apr_pool_t *pool)
+{
+  const char *path;
+  svn_node_kind_t kind;
+
+  /* We have to use a subpool to close the svn_fs_t before calling
+     svn_fs_delete_fs.  See issue 4264. */
+  {
+    svn_fs_t *fs;
+    apr_pool_t *subpool = svn_pool_create(pool);
+    SVN_ERR(svn_test__create_fs(&fs, "test-repo-delete-fs", opts, subpool));
+    path = svn_fs_path(fs, pool);
+    svn_pool_destroy(subpool);
+  }
+
+  SVN_ERR(svn_io_check_path(path, &kind, pool));
+  SVN_TEST_ASSERT(kind != svn_node_none);
+  SVN_ERR(svn_fs_delete_fs(path, pool));
+  SVN_ERR(svn_io_check_path(path, &kind, pool));
+  SVN_TEST_ASSERT(kind == svn_node_none);
+
+  /* Recreate dir so that test cleanup doesn't fail. */
+  SVN_ERR(svn_io_dir_make(path, APR_OS_DEFAULT, pool));
+
+  return SVN_NO_ERROR;
+}
+
 
 
 /* ------------------------------------------------------------------------ */
@@ -4978,5 +5009,7 @@ struct svn_test_descriptor_t test_funcs[
                        "create and modify small file"),
     SVN_TEST_OPTS_PASS(node_history,
                        "test svn_fs_node_history"),
+    SVN_TEST_OPTS_PASS(delete_fs,
+                       "test svn_fs_delete_fs"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_repos/repos-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_repos/repos-test.c Tue Dec  4 15:35:13 2012
@@ -49,6 +49,20 @@
 #define MIN(a,b) (((a)<(b))?(a):(b))
 #endif
 
+/* Compare strings, like strcmp but either or both may be NULL which
+ * compares equal to NULL and not equal to any non-NULL string. */
+static int
+strcmp_null(const char *s1, const char *s2)
+{
+  if (s1 && s2)
+    return strcmp(s1, s2);
+  else if (s1 || s2)
+    return 1;
+  else
+    return 0;
+}
+
+
 
 static svn_error_t *
 dir_deltas(const svn_test_opts_t *opts,
@@ -1706,15 +1720,17 @@ commit_continue_txn(const svn_test_opts_
 }
 
 
+
+/* A baton for check_location_segments(). */
 struct nls_receiver_baton
 {
   int count;
-  svn_location_segment_t *expected_segments;
+  const svn_location_segment_t *expected_segments;
 };
 
-
+/* Return a pretty-printed string representing SEGMENT. */
 static const char *
-format_segment(svn_location_segment_t *segment,
+format_segment(const svn_location_segment_t *segment,
                apr_pool_t *pool)
 {
   return apr_psprintf(pool, "[r%ld-r%ld: /%s]",
@@ -1723,14 +1739,15 @@ format_segment(svn_location_segment_t *s
                       segment->path ? segment->path : "(null)");
 }
 
-
+/* A location segment receiver for check_location_segments().
+ * Implements svn_location_segment_receiver_t. */
 static svn_error_t *
 nls_receiver(svn_location_segment_t *segment,
              void *baton,
              apr_pool_t *pool)
 {
   struct nls_receiver_baton *b = baton;
-  svn_location_segment_t *expected_segment = b->expected_segments + b->count;
+  const svn_location_segment_t *expected_segment = b->expected_segments + b->count;
 
   /* expected_segments->range_end can't be 0, so if we see that, it's
      our end-of-the-list sentry. */
@@ -1739,7 +1756,9 @@ nls_receiver(svn_location_segment_t *seg
                              "Got unexpected location segment: %s",
                              format_segment(segment, pool));
 
-  if (expected_segment->range_start != segment->range_start)
+  if (expected_segment->range_start != segment->range_start
+      || expected_segment->range_end != segment->range_end
+      || strcmp_null(expected_segment->path, segment->path) != 0)
     return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
                              "Location segments differ\n"
                              "   Expected location segment: %s\n"
@@ -1750,18 +1769,22 @@ nls_receiver(svn_location_segment_t *seg
   return SVN_NO_ERROR;
 }
 
-
+/* Run a svn_repos_node_location_segments() query with REPOS, PATH, PEG_REV,
+ * START_REV, END_REV.  Check that the result exactly matches the list of
+ * segments EXPECTED_SEGMENTS, which is terminated by an entry with
+ * 'range_end'==0.
+ */
 static svn_error_t *
 check_location_segments(svn_repos_t *repos,
                         const char *path,
                         svn_revnum_t peg_rev,
                         svn_revnum_t start_rev,
                         svn_revnum_t end_rev,
-                        svn_location_segment_t *expected_segments,
+                        const svn_location_segment_t *expected_segments,
                         apr_pool_t *pool)
 {
   struct nls_receiver_baton b;
-  svn_location_segment_t *segment;
+  const svn_location_segment_t *segment;
 
   /* Run svn_repos_node_location_segments() with a receiver that
      validates against EXPECTED_SEGMENTS.  */
@@ -1783,6 +1806,21 @@ check_location_segments(svn_repos_t *rep
   return SVN_NO_ERROR;
 }
 
+/* Inputs and expected outputs for svn_repos_node_location_segments() tests.
+ */
+typedef struct location_segment_test_t
+{
+  /* Path and peg revision to query */
+  const char *path;
+  svn_revnum_t peg;
+  /* Start (youngest) and end (oldest) revisions to query */
+  svn_revnum_t start;
+  svn_revnum_t end;
+
+  /* Expected segments */
+  svn_location_segment_t segments[10];
+
+} location_segment_test_t;
 
 static svn_error_t *
 node_location_segments(const svn_test_opts_t *opts,
@@ -1795,6 +1833,72 @@ node_location_segments(const svn_test_op
   svn_fs_root_t *txn_root, *root;
   svn_revnum_t youngest_rev = 0;
 
+  static const location_segment_test_t subtests[] =
+  {
+    { /* Check locations for /@HEAD. */
+      "", SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, SVN_INVALID_REVNUM,
+      {
+        { 0, 7, "" },
+        { 0 }
+      }
+    },
+    { /* Check locations for A/D@HEAD. */
+      "A/D", SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, SVN_INVALID_REVNUM,
+      {
+        { 7, 7, "A/D" },
+        { 3, 6, "A/D2" },
+        { 1, 2, "A/D" },
+        { 0 }
+      }
+    },
+    { /* Check a subset of the locations for A/D@HEAD. */
+      "A/D", SVN_INVALID_REVNUM, 5, 2,
+      {
+        { 3, 5, "A/D2" },
+        { 2, 2, "A/D" },
+        { 0 }
+      },
+    },
+    { /* Check a subset of locations for A/D2@5. */
+      "A/D2", 5, 3, 2,
+      {
+        { 3, 3, "A/D2" },
+        { 2, 2, "A/D" },
+        { 0 }
+      },
+    },
+    { /* Check locations for A/D@6. */
+      "A/D", 6, 6, SVN_INVALID_REVNUM,
+      {
+        { 1, 6, "A/D" },
+        { 0 }
+      },
+    },
+    { /* Check locations for A/D/G@HEAD. */
+      "A/D/G", SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, SVN_INVALID_REVNUM,
+      {
+        { 7, 7, "A/D/G" },
+        { 6, 6, "A/D2/G" },
+        { 5, 5, NULL },
+        { 3, 4, "A/D2/G" },
+        { 1, 2, "A/D/G" },
+        { 0 }
+      },
+    },
+    { /* Check a subset of the locations for A/D/G@HEAD. */
+      "A/D/G", SVN_INVALID_REVNUM, 3, 2,
+      {
+        { 3, 3, "A/D2/G" },
+        { 2, 2, "A/D/G" },
+        { 0 }
+      },
+    },
+    {
+      NULL
+    },
+  };
+  const location_segment_test_t *subtest;
+
   /* Bail (with success) on known-untestable scenarios */
   if ((strcmp(opts->fs_type, "bdb") == 0)
       && (opts->server_minor_version == 4))
@@ -1868,117 +1972,19 @@ node_location_segments(const svn_test_op
   SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
   svn_pool_clear(subpool);
 
-  /* Check locations for /@HEAD. */
-  {
-    svn_location_segment_t expected_segments[] =
-      {
-        { 0, 7, "" },
-        { 0 }
-      };
-    SVN_ERR(check_location_segments(repos, "",
-                                    SVN_INVALID_REVNUM,
-                                    SVN_INVALID_REVNUM,
-                                    SVN_INVALID_REVNUM,
-                                    expected_segments, pool));
-  }
-
-  /* Check locations for A/D@HEAD. */
-  {
-    svn_location_segment_t expected_segments[] =
-      {
-        { 7, 7, "A/D" },
-        { 3, 6, "A/D2" },
-        { 1, 2, "A/D" },
-        { 0 }
-      };
-    SVN_ERR(check_location_segments(repos, "A/D",
-                                    SVN_INVALID_REVNUM,
-                                    SVN_INVALID_REVNUM,
-                                    SVN_INVALID_REVNUM,
-                                    expected_segments, pool));
-  }
-
-  /* Check a subset of the locations for A/D@HEAD. */
-  {
-    svn_location_segment_t expected_segments[] =
-      {
-        { 3, 5, "A/D2" },
-        { 2, 2, "A/D" },
-        { 0 }
-      };
-    SVN_ERR(check_location_segments(repos, "A/D",
-                                    SVN_INVALID_REVNUM,
-                                    5,
-                                    2,
-                                    expected_segments, pool));
-  }
-
-  /* Check a subset of locations for A/D2@5. */
-  {
-    svn_location_segment_t expected_segments[] =
-      {
-        { 3, 3, "A/D2" },
-        { 2, 2, "A/D" },
-        { 0 }
-      };
-    SVN_ERR(check_location_segments(repos, "A/D2",
-                                    5,
-                                    3,
-                                    2,
-                                    expected_segments, pool));
-  }
-
-  /* Check locations for A/D@6. */
-  {
-    svn_location_segment_t expected_segments[] =
-      {
-        { 1, 6, "A/D" },
-        { 0 }
-      };
-    SVN_ERR(check_location_segments(repos, "A/D",
-                                    6,
-                                    6,
-                                    SVN_INVALID_REVNUM,
-                                    expected_segments, pool));
-  }
-
-  /* Check locations for A/D/G@HEAD. */
-  {
-    svn_location_segment_t expected_segments[] =
-      {
-        { 7, 7, "A/D/G" },
-        { 6, 6, "A/D2/G" },
-        { 5, 5, NULL },
-        { 3, 4, "A/D2/G" },
-        { 1, 2, "A/D2/G" },
-        { 0 }
-      };
-    SVN_ERR(check_location_segments(repos, "A/D/G",
-                                    SVN_INVALID_REVNUM,
-                                    SVN_INVALID_REVNUM,
-                                    SVN_INVALID_REVNUM,
-                                    expected_segments, pool));
-  }
-
-  /* Check a subset of the locations for A/D/G@HEAD. */
-  {
-    svn_location_segment_t expected_segments[] =
-      {
-        { 3, 3, "A/D2/G" },
-        { 2, 2, "A/D2/G" },
-        { 0 }
-      };
-    SVN_ERR(check_location_segments(repos, "A/D/G",
-                                    SVN_INVALID_REVNUM,
-                                    3,
-                                    2,
-                                    expected_segments, pool));
-  }
+  /*  */
+  for (subtest = subtests; subtest->path; subtest++)
+    {
+      SVN_ERR(check_location_segments(repos, subtest->path, subtest->peg,
+                                      subtest->start, subtest->end,
+                                      subtest->segments, pool));
+    }
 
   return SVN_NO_ERROR;
 }
 
 
+
 /* Test that the reporter doesn't send deltas under excluded paths. */
 static svn_error_t *
 reporter_depth_exclude(const svn_test_opts_t *opts,

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/dirent_uri-test.c Tue Dec  4 15:35:13 2012
@@ -886,14 +886,17 @@ static const testcase_canonicalize_t uri
     { "svn://SERVER:443/",     "svn://server:443" },
     { "file:///C%7C/temp/REPOS", "file:///C%7C/temp/REPOS" },
     { "file:///C|/temp/REPOS", "file:///C%7C/temp/REPOS" },
+    { "file:///C:/",           "file:///C:" },
 #ifdef SVN_USE_DOS_PATHS
     { "file:///c:/temp/repos", "file:///C:/temp/repos" },
     { "file:///c:/temp/REPOS", "file:///C:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
+    { "file:///c:/",           "file:///C:" },
 #else /* !SVN_USE_DOS_PATHS */
     { "file:///c:/temp/repos", "file:///c:/temp/repos" },
     { "file:///c:/temp/REPOS", "file:///c:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
+    { "file:///c:/",           "file:///c:" },
 #endif /* SVN_USE_DOS_PATHS */
   /* svn_uri_is_canonical() was a private function in the 1.6 API, and
      has since taken a MAJOR change of direction, namely that only
@@ -2369,7 +2372,7 @@ test_file_url_from_dirent(apr_pool_t *po
   } tests[] = {
 #ifdef SVN_USE_DOS_PATHS
     { "C:/file",                   "file:///C:/file" },
-    { "C:/",                       "file:///C:/" },
+    { "C:/",                       "file:///C:" },
     { "C:/File#$",                 "file:///C:/File%23$" },
     /* We can't check these as svn_dirent_get_absolute() won't work
        on shares that don't exist */
@@ -2396,6 +2399,8 @@ test_file_url_from_dirent(apr_pool_t *po
                                  "svn_uri_get_file_url_from_dirent(\"%s\") "
                                  "returned \"%s\" expected \"%s\"",
                                  tests[i].dirent, result, tests[i].result);
+
+      SVN_TEST_ASSERT(svn_uri_is_canonical(result, pool));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/path-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/path-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/path-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/path-test.c Tue Dec  4 15:35:13 2012
@@ -21,6 +21,13 @@
  * ====================================================================
  */
 
+#ifdef _MSC_VER
+#include <direct.h>
+#define getcwd _getcwd
+#else
+#include <unistd.h> /* for getcwd() */
+#endif
+
 #include <stdio.h>
 #include <string.h>
 #include <apr_general.h>
@@ -1195,7 +1202,6 @@ test_path_splitext(apr_pool_t *pool)
     const char *path;
     const char *path_root;
     const char *path_ext;
-    svn_boolean_t result;
   } tests[] = {
     { "no-ext",                    "no-ext",                 "" },
     { "test-file.py",              "test-file.",             "py" },
@@ -1465,6 +1471,160 @@ test_path_internal_style(apr_pool_t *poo
 }
 
 
+/* The type of a function to be tested by condense_targets_tests_helper().
+ * Matches svn_path_condense_targets().
+ */
+typedef svn_error_t *(*condense_targets_func_t)
+                           (const char **pcommon,
+                            apr_array_header_t **pcondensed_targets,
+                            const apr_array_header_t *targets,
+                            svn_boolean_t remove_redundancies,
+                            apr_pool_t *pool);
+
+/** Executes function CONDENSE_TARGETS twice - with and without requesting the
+ * condensed targets list -  on TEST_TARGETS (comma sep. string) and compares
+ * the results with EXP_COMMON and EXP_TARGETS (comma sep. string).
+ *
+ * @note: a '%' character at the beginning of EXP_COMMON or EXP_TARGETS will
+ * be replaced by the current working directory.
+ *
+ * Returns an error if any of the comparisons fail.
+ */
+static svn_error_t *
+condense_targets_tests_helper(const char* title,
+                              const char* test_targets,
+                              const char* exp_common,
+                              const char* exp_targets,
+                              const char* func_name,
+                              condense_targets_func_t condense_targets,
+                              apr_pool_t *pool)
+{
+  apr_array_header_t *targets;
+  apr_array_header_t *condensed_targets;
+  const char *common_path, *common_path2, *curdir;
+  char *token, *iter;
+  const char *exp_common_abs = exp_common;
+  int i;
+  char buf[8192];
+
+  if (! getcwd(buf, sizeof(buf)))
+    return svn_error_create(SVN_ERR_BASE, NULL, "getcwd() failed");
+  curdir = svn_path_internal_style(buf, pool);
+
+  /* Create the target array */
+  targets = apr_array_make(pool, sizeof(test_targets), sizeof(const char *));
+  token = apr_strtok(apr_pstrdup(pool, test_targets), ",", &iter);
+  while (token)
+    {
+      APR_ARRAY_PUSH(targets, const char *) =
+        svn_path_internal_style(token, pool);
+      token = apr_strtok(NULL, ",", &iter);
+    };
+
+  /* Call the function */
+  SVN_ERR(condense_targets(&common_path, &condensed_targets, targets,
+                           TRUE, pool));
+
+  /* Verify the common part with the expected (prefix with cwd). */
+  if (*exp_common == '%')
+    exp_common_abs = apr_pstrcat(pool, curdir, exp_common + 1, (char *)NULL);
+
+  if (strcmp(common_path, exp_common_abs) != 0)
+    {
+      return svn_error_createf
+        (SVN_ERR_TEST_FAILED, NULL,
+         "%s (test %s) returned %s instead of %s",
+           func_name, title,
+           common_path, exp_common_abs);
+    }
+
+  /* Verify the condensed targets */
+  token = apr_strtok(apr_pstrdup(pool, exp_targets), ",", &iter);
+  for (i = 0; i < condensed_targets->nelts; i++)
+    {
+      const char * target = APR_ARRAY_IDX(condensed_targets, i, const char*);
+      if (token && (*token == '%'))
+        token = apr_pstrcat(pool, curdir, token + 1, (char *)NULL);
+      if (! token ||
+          (target && (strcmp(target, token) != 0)))
+        {
+          return svn_error_createf
+            (SVN_ERR_TEST_FAILED, NULL,
+             "%s (test %s) couldn't find %s in expected targets list",
+               func_name, title,
+               target);
+        }
+      token = apr_strtok(NULL, ",", &iter);
+    }
+
+  /* Now ensure it works without the pbasename */
+  SVN_ERR(condense_targets(&common_path2, NULL, targets, TRUE, pool));
+
+  /* Verify the common part again */
+  if (strcmp(common_path, common_path2) != 0)
+    {
+      return svn_error_createf
+        (SVN_ERR_TEST_FAILED, NULL,
+         "%s (test %s): Common path without getting targets %s does not match" \
+         "common path with targets %s",
+          func_name, title,
+          common_path2, common_path);
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+test_path_condense_targets(apr_pool_t *pool)
+{
+  int i;
+  struct {
+    const char* title;
+    const char* targets;
+    const char* exp_common;
+    const char* exp_targets;
+  } tests[] = {
+    { "normal use", "z/A/B,z/A,z/A/C,z/D/E,z/D/F,z/D,z/G,z/G/H,z/G/I",
+      "%/z", "A,D,G" },
+    {"identical dirs", "z/A,z/A,z/A,z/A",
+     "%/z/A", "" },
+    {"identical files", "z/A/file,z/A/file,z/A/file,z/A/file",
+     "%/z/A/file", "" },
+    {"single dir", "z/A",
+     "%/z/A", "" },
+    {"single file", "z/A/file",
+     "%/z/A/file", "" },
+    {"URLs", "http://host/A/C,http://host/A/C/D,http://host/A/B/D",
+     "http://host/A", "C,B/D" },
+    {"URLs with no common prefix",
+     "http://host1/A/C,http://host2/A/C/D,http://host3/A/B/D",
+     "", "http://host1/A/C,http://host2/A/C/D,http://host3/A/B/D" },
+    {"file URLs with no common prefix", "file:///A/C,file:///B/D",
+     "", "file:///A/C,file:///B/D" },
+    {"URLs with mixed protocols",
+     "http://host/A/C,file:///B/D,gopher://host/A",
+     "", "http://host/A/C,file:///B/D,gopher://host/A" },
+    {"mixed paths and URLs",
+     "z/A/B,z/A,http://host/A/C/D,http://host/A/C",
+     "", "%/z/A,http://host/A/C" },
+  };
+
+  for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
+    {
+      SVN_ERR(condense_targets_tests_helper(tests[i].title,
+                                            tests[i].targets,
+                                            tests[i].exp_common,
+                                            tests[i].exp_targets,
+                                            "svn_path_condense_targets",
+                                            svn_path_condense_targets,
+                                            pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
 /* local define to support XFail-ing tests on Windows/Cygwin only */
 #ifdef SVN_USE_DOS_PATHS
 #define WINDOWS_OR_CYGWIN TRUE
@@ -1526,5 +1686,7 @@ struct svn_test_descriptor_t test_funcs[
                    "test svn_path_local_style"),
     SVN_TEST_PASS2(test_path_internal_style,
                    "test svn_path_internal_style"),
+    SVN_TEST_PASS2(test_path_condense_targets,
+                   "test svn_path_condense_targets"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/spillbuf-test.c Tue Dec  4 15:35:13 2012
@@ -28,9 +28,9 @@
 #include "../svn_test.h"
 
 
-static const char basic_data[] = ("abcdefghijklmnopqrstuvwxyz"
-                                  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-                                  "0123456789");
+static const char basic_data[] = "abcdefghijklmnopqrstuvwxyz"
+                                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                 "0123456789";
 
 
 /* Validate that BUF is STARTING_SIZE in length. Then read some data from

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/stream-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/stream-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/stream-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/stream-test.c Tue Dec  4 15:35:13 2012
@@ -576,7 +576,7 @@ test_stream_base64(apr_pool_t *pool)
    The two data writes caused the base 64 code to allocate a buffer
    that was a byte short but exactly matched a stringbuf blocksize.
    That meant the stringbuf didn't overallocate and a write beyond
-   the end of the buffer occured.
+   the end of the buffer occurred.
  */
 static svn_error_t *
 test_stream_base64_2(apr_pool_t *pool)

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/string-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/string-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/string-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_subr/string-test.c Tue Dec  4 15:35:13 2012
@@ -612,6 +612,105 @@ test_stringbuf_replace(apr_pool_t *pool)
   return expect_stringbuf_equal(a, "test hello, world!!!", pool);
 }
 
+static svn_error_t *
+test_string_similarity(apr_pool_t *pool)
+{
+  const struct sim_score_test_t
+  {
+    const char *stra;
+    const char *strb;
+    apr_size_t lcs;
+    int score;
+  } tests[] =
+      {
+#define SCORE(lcs, len) ((2000 * (lcs) + (len)/2) / (len))
+
+        /* Equality */
+        {"",       "",          0, 1000},
+        {"quoth",  "quoth",     5, SCORE(5, 5+5)},
+
+        /* Deletion at start */
+        {"quoth",  "uoth",      4, SCORE(4, 5+4)},
+        {"uoth",   "quoth",     4, SCORE(4, 4+5)},
+
+        /* Deletion at end */
+        {"quoth",  "quot",      4, SCORE(4, 5+4)},
+        {"quot",   "quoth",     4, SCORE(4, 4+5)},
+
+        /* Insertion at start */
+        {"quoth",  "Xquoth",    5, SCORE(5, 5+6)},
+        {"Xquoth", "quoth",     5, SCORE(5, 6+5)},
+
+        /* Insertion at end */
+        {"quoth",  "quothX",    5, SCORE(5, 5+6)},
+        {"quothX", "quoth",     5, SCORE(5, 6+5)},
+
+        /* Insertion in middle */
+        {"quoth",  "quoXth",    5, SCORE(5, 5+6)},
+        {"quoXth", "quoth",     5, SCORE(5, 6+5)},
+
+        /* Transposition at start */
+        {"quoth",  "uqoth",     4, SCORE(4, 5+5)},
+        {"uqoth",  "quoth",     4, SCORE(4, 5+5)},
+
+        /* Transposition at end */
+        {"quoth",  "quoht",     4, SCORE(4, 5+5)},
+        {"quoht",  "quoth",     4, SCORE(4, 5+5)},
+
+        /* Transposition in middle */
+        {"quoth",  "qutoh",     4, SCORE(4, 5+5)},
+        {"qutoh",  "quoth",     4, SCORE(4, 5+5)},
+
+        /* Difference */
+        {"quoth",  "raven",     0, SCORE(0, 5+5)},
+        {"raven",  "quoth",     0, SCORE(0, 5+5)},
+        {"x",      "",          0, SCORE(0, 1+0)},
+        {"",       "x",         0, SCORE(0, 0+1)},
+        {"",       "quoth",     0, SCORE(0, 0+5)},
+        {"quoth",  "",          0, SCORE(0, 5+0)},
+        {"quoth",  "the raven", 2, SCORE(2, 5+9)},
+        {"the raven",  "quoth", 2, SCORE(2, 5+9)},
+        {NULL, NULL}
+      };
+
+  const struct sim_score_test_t *t;
+  svn_membuf_t buffer;
+
+  svn_membuf__create(&buffer, 0, pool);
+  for (t = tests; t->stra; ++t)
+    {
+      apr_size_t lcs;
+      const unsigned int score =
+        svn_cstring__similarity(t->stra, t->strb, &buffer, &lcs);
+      /*
+      fprintf(stderr,
+              "lcs %s ~ %s score %.3f (%"APR_SIZE_T_FMT
+              ") expected %.3f (%"APR_SIZE_T_FMT"))\n",
+              t->stra, t->strb, score/1000.0, lcs, t->score/1000.0, t->lcs);
+      */
+      if (score != t->score)
+        return fail(pool, "%s ~ %s score %.3f <> expected %.3f",
+                    t->stra, t->strb, score/1000.0, t->score/1000.0);
+
+      if (lcs != t->lcs)
+        return fail(pool,
+                    "%s ~ %s lcs %"APR_SIZE_T_FMT
+                    " <> expected %"APR_SIZE_T_FMT,
+                    t->stra, t->strb, lcs, t->lcs);
+    }
+
+  /* Test partial similarity */
+  {
+    const svn_string_t foo = {"svn:foo", 4};
+    const svn_string_t bar = {"svn:bar", 4};
+    if (1000 != svn_string__similarity(&foo, &bar, &buffer, NULL))
+      return fail(pool, "'%s'[:4] ~ '%s'[:4] found different",
+                  foo.data, bar.data);
+  }
+
+  return SVN_NO_ERROR;
+}
+
 /*
    ====================================================================
    If you add a new test to this file, update this array.
@@ -677,5 +776,7 @@ struct svn_test_descriptor_t test_funcs[
                    "check deletion from svn_stringbuf_t"),
     SVN_TEST_PASS2(test_stringbuf_replace,
                    "check replacement in svn_stringbuf_t"),
+    SVN_TEST_PASS2(test_string_similarity,
+                   "test string similarity scores"),
     SVN_TEST_NULL
   };

Propchange: subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Dec  4 15:35:13 2012
@@ -11,3 +11,4 @@ tree-conflict-data-test
 wc-incomplete-tester
 wc-lock-tester
 wc-queries-test
+wc-test

Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/db-test.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_wc/db-test.c Tue Dec  4 15:35:13 2012
@@ -664,7 +664,7 @@ test_inserting_nodes(apr_pool_t *pool)
             props,
             1, TIME_1a, AUTHOR_1,
             checksum,
-            NULL, FALSE, FALSE, NULL, FALSE, FALSE,
+            NULL, FALSE, FALSE, NULL, NULL, FALSE, FALSE,
             NULL, NULL,
             pool));
 
@@ -677,7 +677,7 @@ test_inserting_nodes(apr_pool_t *pool)
             props,
             1, TIME_1a, AUTHOR_1,
             "O-target",
-            NULL, FALSE, FALSE, NULL, FALSE, FALSE,
+            NULL, FALSE, FALSE, NULL, NULL, FALSE, FALSE,
             NULL, NULL,
             pool));