subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1301216 [3/4] - in /subversion/branches/inheritable-props: ./ notes/ notes/directory-index/ subversion/bindings/javahl/ subversion/bindings/swig/ruby/test/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversio...
Date Thu, 15 Mar 2012 21:40:17 GMT
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/main.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/main.py Thu Mar 15 21:40:15 2012
@@ -23,18 +23,18 @@
 #    under the License.
 ######################################################################
 
-import sys     # for argv[]
+import sys
 import os
-import shutil  # for rmtree()
+import shutil
 import re
-import stat    # for ST_MODE
+import stat
 import subprocess
-import time    # for time()
-import traceback # for print_exc()
+import time
 import threading
-import optparse # for argument parsing
+import optparse
 import xml
 import urllib
+import logging
 
 try:
   # Python >=3.0
@@ -78,6 +78,15 @@ SVN_VER_MINOR = 8
 
 default_num_threads = 5
 
+# Set up logging
+logger = logging.getLogger()
+handler = logging.StreamHandler(sys.stdout)
+formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s',
+                              '%Y-%m-%d %H:%M:%S')
+handler.setFormatter(formatter)
+logger.addHandler(handler)
+
+
 class SVNProcessTerminatedBySignal(Failure):
   "Exception raised if a spawned process segfaulted, aborted, etc."
   pass
@@ -105,7 +114,7 @@ class SVNRepositoryCreateFailure(Failure
 # Windows specifics
 if sys.platform == 'win32':
   windows = True
-  file_scheme_prefix = 'file:///'
+  file_scheme_prefix = 'file:'
   _exe = '.exe'
   _bat = '.bat'
   os.environ['SVN_DBG_STACKTRACES_TO_STDERR'] = 'y'
@@ -132,23 +141,6 @@ wc_author2 = 'jconstant' # use the same 
 # Set C locale for command line programs
 os.environ['LC_ALL'] = 'C'
 
-# This function mimics the Python 2.3 urllib function of the same name.
-def pathname2url(path):
-  """Convert the pathname PATH from the local syntax for a path to the form
-  used in the path component of a URL. This does not produce a complete URL.
-  The return value will already be quoted using the quote() function."""
-
-  # Don't leave ':' in file://C%3A/ escaped as our canonicalization
-  # rules will replace this with a ':' on input.
-  return urllib_parse_quote(path.replace('\\', '/')).replace('%3A', ':')
-
-# This function mimics the Python 2.3 urllib function of the same name.
-def url2pathname(path):
-  """Convert the path component PATH from an encoded URL to the local syntax
-  for a path. This does not accept a complete URL. This function uses
-  unquote() to decode PATH."""
-  return os.path.normpath(urllib_parse_unquote(path))
-
 ######################################################################
 # The locations of the svn, svnadmin and svnlook binaries, relative to
 # the only scripts that import this file right now (they live in ../).
@@ -444,22 +436,16 @@ def wait_on_pipe(waiter, binary_mode, st
       exit_signal = exit_code
 
     if stdout_lines is not None:
-      sys.stdout.write("".join(stdout_lines))
-      sys.stdout.flush()
+      logger.info("".join(stdout_lines))
     if stderr_lines is not None:
-      sys.stderr.write("".join(stderr_lines))
-      sys.stderr.flush()
-    if options.verbose:
-      # show the whole path to make it easier to start a debugger
-      sys.stderr.write("CMD: %s terminated by signal %d\n"
-                       % (command_string, exit_signal))
-      sys.stderr.flush()
+      logger.warning("".join(stderr_lines))
+    # show the whole path to make it easier to start a debugger
+    logger.warning("CMD: %s terminated by signal %d"
+                     % (command_string, exit_signal))
     raise SVNProcessTerminatedBySignal
   else:
-    if exit_code and options.verbose:
-      sys.stderr.write("CMD: %s exited with %d\n"
-                       % (command_string, exit_code))
-      sys.stderr.flush()
+    if exit_code:
+      logger.info("CMD: %s exited with %d" % (command_string, exit_code))
     return stdout_lines, stderr_lines, exit_code
 
 def spawn_process(command, bufsize=0, binary_mode=0, stdin_lines=None,
@@ -477,10 +463,9 @@ def spawn_process(command, bufsize=0, bi
     raise TypeError("stdin_lines should have list type")
 
   # Log the command line
-  if options.verbose and not command.endswith('.py'):
-    sys.stdout.write('CMD: %s %s\n' % (os.path.basename(command),
-                                      ' '.join([_quote_arg(x) for x in varargs])))
-    sys.stdout.flush()
+  if not command.endswith('.py'):
+    logger.info('CMD: %s %s' % (os.path.basename(command),
+                                  ' '.join([_quote_arg(x) for x in varargs])))
 
   infile, outfile, errfile, kid = open_pipe([command] + list(varargs), bufsize)
 
@@ -511,8 +496,7 @@ def run_command_stdin(command, error_exp
   If ERROR_EXPECTED is None, any stderr output will be printed and any
   stderr output or a non-zero exit code will raise an exception."""
 
-  if options.verbose:
-    start = time.time()
+  start = time.time()
 
   exit_code, stdout_lines, stderr_lines = spawn_process(command,
                                                         bufsize,
@@ -520,18 +504,16 @@ def run_command_stdin(command, error_exp
                                                         stdin_lines,
                                                         *varargs)
 
-  if options.verbose:
-    stop = time.time()
-    print('<TIME = %.6f>' % (stop - start))
-    for x in stdout_lines:
-      sys.stdout.write(x)
-    for x in stderr_lines:
-      sys.stdout.write(x)
+  stop = time.time()
+  logger.info('<TIME = %.6f>' % (stop - start))
+  for x in stdout_lines:
+    logger.info(x[:-1])
+  for x in stderr_lines:
+    logger.info(x)
 
   if (not error_expected) and ((stderr_lines) or (exit_code != 0)):
-    if not options.verbose:
-      for x in stderr_lines:
-        sys.stdout.write(x)
+    for x in stderr_lines:
+      logger.warning(x[:-1])
     raise Failure
 
   return exit_code, \
@@ -873,11 +855,10 @@ def copy_repos(src_path, dst_path, head_
 
   if ignore_uuid:
     load_args = load_args + ['--ignore-uuid']
-  if options.verbose:
-    sys.stdout.write('CMD: %s %s | %s %s\n' %
+
+  logger.info('CMD: %s %s | %s %s' %
                      (os.path.basename(svnadmin_binary), ' '.join(dump_args),
                       os.path.basename(svnadmin_binary), ' '.join(load_args)))
-    sys.stdout.flush()
   start = time.time()
 
   dump_in, dump_out, dump_err, dump_kid = open_pipe(
@@ -887,8 +868,7 @@ def copy_repos(src_path, dst_path, head_
     stdin=dump_out) # Attached to dump_kid
 
   stop = time.time()
-  if options.verbose:
-    print('<TIME = %.6f>' % (stop - start))
+  logger.info('<TIME = %.6f>' % (stop - start))
 
   load_stdout, load_stderr, load_exit_code = wait_on_pipe(load_kid, True)
   dump_stdout, dump_stderr, dump_exit_code = wait_on_pipe(dump_kid, True)
@@ -1201,7 +1181,7 @@ class TestSpawningThread(threading.Threa
       args.append('--fs-type=' + options.fs_type)
     if options.test_area_url:
       args.append('--url=' + options.test_area_url)
-    if options.verbose:
+    if logger.getEffectiveLevel() <= logging.DEBUG:
       args.append('-v')
     if options.cleanup:
       args.append('--cleanup')
@@ -1275,7 +1255,7 @@ class TestRunner:
       # If there is no filter or this test made if through
       # the filter then print it!
       if options.milestone_filter is None or len(issues):
-        if options.verbose and self.pred.inprogress:
+        if self.pred.inprogress:
           tail += " [[%s]]" % self.pred.inprogress
         else:
           print(" %3d    %-5s  %s%s" % (self.index,
@@ -1347,32 +1327,29 @@ class TestRunner:
       result = svntest.testcase.RESULT_SKIP
     except Failure, ex:
       result = svntest.testcase.RESULT_FAIL
+      msg = ''
       # We captured Failure and its subclasses. We don't want to print
       # anything for plain old Failure since that just indicates test
       # failure, rather than relevant information. However, if there
       # *is* information in the exception's arguments, then print it.
       if ex.__class__ != Failure or ex.args:
         ex_args = str(ex)
-        print('CWD: %s' % os.getcwd())
+        logger.warn('CWD: %s' % os.getcwd())
         if ex_args:
-          print('EXCEPTION: %s: %s' % (ex.__class__.__name__, ex_args))
+          msg = 'EXCEPTION: %s: %s' % (ex.__class__.__name__, ex_args)
         else:
-          print('EXCEPTION: %s' % ex.__class__.__name__)
-      traceback.print_exc(file=sys.stdout)
-      sys.stdout.flush()
+          msg = 'EXCEPTION: %s' % ex.__class__.__name__
+      logger.warn(msg, exc_info=True)
     except KeyboardInterrupt:
-      print('Interrupted')
+      logger.error('Interrupted')
       sys.exit(0)
     except SystemExit, ex:
-      print('EXCEPTION: SystemExit(%d), skipping cleanup' % ex.code)
+      logger.error('EXCEPTION: SystemExit(%d), skipping cleanup' % ex.code)
       self._print_name(ex.code and 'FAIL: ' or 'PASS: ')
       raise
     except:
       result = svntest.testcase.RESULT_FAIL
-      print('CWD: %s' % os.getcwd())
-      print('UNEXPECTED EXCEPTION:')
-      traceback.print_exc(file=sys.stdout)
-      sys.stdout.flush()
+      logger.warn('CWD: %s' % os.getcwd(), exc_info=True)
 
     os.chdir(saved_dir)
     exit_code, result_text, result_benignity = self.pred.results(result)
@@ -1490,6 +1467,12 @@ def create_default_options():
 
 def _create_parser():
   """Return a parser for our test suite."""
+  def set_log_level(option, opt, value, parser, level=None):
+    if level:
+      logger.setLevel(level)
+    else:
+      logger.setLevel(value)
+
   # set up the parser
   _default_http_library = 'serf'
   usage = 'usage: %prog [options] [<test> ...]'
@@ -1498,8 +1481,10 @@ def _create_parser():
                     help='Print test doc strings instead of running them')
   parser.add_option('--milestone-filter', action='store', dest='milestone_filter',
                     help='Limit --list to those with target milestone specified')
-  parser.add_option('-v', '--verbose', action='store_true', dest='verbose',
-                    help='Print binary command-lines (not with --quiet)')
+  parser.add_option('-v', '--verbose', action='callback',
+                    callback=set_log_level, callback_args=(logging.DEBUG, ),
+                    help='Print binary command-lines (same as ' +
+                         '"--set-log-level logging.DEBUG")')
   parser.add_option('-q', '--quiet', action='store_true',
                     help='Print only unexpected results (not with --verbose)')
   parser.add_option('-p', '--parallel', action='store_const',
@@ -1537,6 +1522,8 @@ def _create_parser():
                     help='Default shard size (for fsfs)')
   parser.add_option('--config-file', action='store',
                     help="Configuration file for tests.")
+  parser.add_option('--set-log-level', action='callback', type='int',
+                    callback=set_log_level)
   parser.add_option('--keep-local-tmp', action='store_true',
                     help="Don't remove svn-test-work/local_tmp after test " +
                          "run is complete.  Useful for debugging failures.")
@@ -1551,7 +1538,8 @@ def _create_parser():
   # most of the defaults are None, but some are other values, set them here
   parser.set_defaults(
         server_minor_version=SVN_VER_MINOR,
-        url=file_scheme_prefix + pathname2url(os.path.abspath(os.getcwd())),
+        url=file_scheme_prefix + \
+                        urllib.pathname2url(os.path.abspath(os.getcwd())),
         http_library=_default_http_library)
 
   return parser
@@ -1567,8 +1555,6 @@ def _parse_options(arglist=sys.argv[1:])
   (options, args) = parser.parse_args(arglist)
 
   # some sanity checking
-  if options.verbose and options.quiet:
-    parser.error("'verbose' and 'quiet' are incompatible")
   if options.fsfs_packing and not options.fsfs_sharding:
     parser.error("--fsfs-packing requires --fsfs-sharding")
 
@@ -1719,7 +1705,8 @@ def execute_tests(test_list, serial_only
                    "or function '%s'\n" % arg)
 
   # Calculate pristine_greek_repos_url from test_area_url.
-  pristine_greek_repos_url = options.test_area_url + '/' + pathname2url(pristine_greek_repos_dir)
+  pristine_greek_repos_url = options.test_area_url + '/' + \
+                                urllib.pathname2url(pristine_greek_repos_dir)
 
   if options.use_jsvn:
     if options.svn_bin is None:

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/sandbox.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/sandbox.py Thu Mar 15 21:40:15 2012
@@ -24,9 +24,13 @@
 import os
 import shutil
 import copy
+import urllib
+import logging
 
 import svntest
 
+logger = logging.getLogger()
+
 
 class Sandbox:
   """Manages a sandbox (one or more repository/working copy pairs) for
@@ -49,7 +53,7 @@ class Sandbox:
     if not read_only:
       self.repo_dir = os.path.join(svntest.main.general_repo_dir, self.name)
       self.repo_url = (svntest.main.options.test_area_url + '/'
-                       + svntest.main.pathname2url(self.repo_dir))
+                       + urllib.pathname2url(self.repo_dir))
     else:
       self.repo_dir = svntest.main.pristine_greek_repos_dir
       self.repo_url = svntest.main.pristine_greek_repos_url
@@ -126,7 +130,7 @@ class Sandbox:
     path = (os.path.join(svntest.main.general_repo_dir, self.name)
             + '.' + suffix)
     url = svntest.main.options.test_area_url + \
-                                        '/' + svntest.main.pathname2url(path)
+                                        '/' + urllib.pathname2url(path)
     self.add_test_path(path, remove)
     return path, url
 
@@ -206,7 +210,8 @@ class Sandbox:
     svntest.main.run_svn(False, 'update', target)
 
   def simple_switch(self, url, target=None):
-    """Switch a TARGET to URL"""
+    """Switch the WC or TARGET to URL.
+       TARGET is a relpath relative to the WC."""
     if target is None:
       target = self.wc_dir
     else:
@@ -228,61 +233,72 @@ class Sandbox:
                          target)
 
   def simple_rm(self, *targets):
-    """TARGET is a relpath relative to the WC."""
+    """Schedule TARGETS for deletion.
+       TARGETS are relpaths relative to the WC."""
     assert len(targets) > 0
     targets = self.ospaths(targets)
     svntest.main.run_svn(False, 'rm', *targets)
 
   def simple_mkdir(self, *targets):
-    """TARGET is a relpath relative to the WC."""
+    """Create TARGETS as directories scheduled for addition.
+       TARGETS are relpaths relative to the WC."""
     assert len(targets) > 0
     targets = self.ospaths(targets)
     svntest.main.run_svn(False, 'mkdir', *targets)
 
   def simple_add(self, *targets):
-    """TARGET is a relpath relative to the WC."""
+    """Schedule TARGETS for addition.
+       TARGETS are relpaths relative to the WC."""
     assert len(targets) > 0
     targets = self.ospaths(targets)
     svntest.main.run_svn(False, 'add', *targets)
 
   def simple_revert(self, *targets):
-    """TARGET is a relpath relative to the WC."""
+    """Revert TARGETS.
+       TARGETS are relpaths relative to the WC."""
     assert len(targets) > 0
     targets = self.ospaths(targets)
     svntest.main.run_svn(False, 'revert', *targets)
 
   def simple_propset(self, name, value, *targets):
-    """TARGET is a relpath relative to the WC."""
+    """Set property NAME to VALUE on TARGETS.
+       TARGETS are relpaths relative to the WC."""
     assert len(targets) > 0
     targets = self.ospaths(targets)
     svntest.main.run_svn(False, 'propset', name, value, *targets)
 
   def simple_propdel(self, name, *targets):
-    """TARGET is a relpath relative to the WC."""
+    """Delete property NAME from TARGETS.
+       TARGETS are relpaths relative to the WC."""
     assert len(targets) > 0
     targets = self.ospaths(targets)
     svntest.main.run_svn(False, 'propdel', name, *targets)
 
   def simple_copy(self, source, dest):
-    """SOURCE and DEST are relpaths relative to the WC."""
+    """Copy SOURCE to DEST in the WC.
+       SOURCE and DEST are relpaths relative to the WC."""
     source = self.ospath(source)
     dest = self.ospath(dest)
     svntest.main.run_svn(False, 'copy', source, dest)
 
   def simple_move(self, source, dest):
-    """SOURCE and DEST are relpaths relative to the WC."""
+    """Move SOURCE to DEST in the WC.
+       SOURCE and DEST are relpaths relative to the WC."""
     source = self.ospath(source)
     dest = self.ospath(dest)
     svntest.main.run_svn(False, 'move', source, dest)
 
   def simple_repo_copy(self, source, dest):
-    """SOURCE and DEST are relpaths relative to the repo root."""
+    """Copy SOURCE to DEST in the repository, committing the result with a
+       default log message.
+       SOURCE and DEST are relpaths relative to the repo root."""
     svntest.main.run_svn(False, 'copy', '-m', svntest.main.make_log_msg(),
                          self.repo_url + '/' + source,
                          self.repo_url + '/' + dest)
 
   def simple_append(self, dest, contents, truncate=False):
-    """Append CONTENTS to file DEST, optionally truncating it first."""
+    """Append CONTENTS to file DEST, optionally truncating it first.
+       DEST is a relpath relative to the WC."""
     open(self.ospath(dest), truncate and 'w' or 'a').write(contents)
 
 
@@ -306,14 +322,13 @@ def cleanup_deferred_test_paths():
 
 
 def _cleanup_test_path(path, retrying=False):
-  if svntest.main.options.verbose:
-    if retrying:
-      print("CLEANUP: RETRY: %s" % path)
-    else:
-      print("CLEANUP: %s" % path)
+  if retrying:
+    logger.info("CLEANUP: RETRY: %s", path)
+  else:
+    logger.info("CLEANUP: %s", path)
+
   try:
     svntest.main.safe_rmtree(path)
   except:
-    if svntest.main.options.verbose:
-      print("WARNING: cleanup failed, will try again later")
+    logger.info("WARNING: cleanup failed, will try again later")
     _deferred_test_paths.append(path)

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/tree.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/tree.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/tree.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/tree.py Thu Mar 15 21:40:15 2012
@@ -31,12 +31,15 @@ if sys.version_info[0] >= 3:
   from io import StringIO
 else:
   # Python <3.0
-  from StringIO import StringIO
+  from cStringIO import StringIO
 from xml.dom.minidom import parseString
 import base64
+import logging
 
 import svntest
 
+logger = logging.getLogger()
+
 # Tree Exceptions.
 
 # All tree exceptions should inherit from SVNTreeError
@@ -569,7 +572,7 @@ def get_child(node, name):
   """If SVNTreeNode NODE contains a child named NAME, return child;
   else, return None. If SVNTreeNode is not a directory, exit completely."""
   if node.children == None:
-    print("Error: Foolish call to get_child.")
+    logger.error("Foolish call to get_child.")
     sys.exit(1)
   for n in node.children:
     if name == n.name:
@@ -581,8 +584,8 @@ def get_child(node, name):
 def default_singleton_handler(node, description):
   """Print SVNTreeNode NODE's name, describing it with the string
   DESCRIPTION, then raise SVNTreeUnequal."""
-  print("Couldn't find node '%s' in %s tree" % (node.name, description))
-  node.pprint()
+  logger.warn("Couldn't find node '%s' in %s tree" % (node.name, description))
+  logger.warn(str(node))
   raise SVNTreeUnequal
 
 # A test helper function implementing the singleton_handler_a API.
@@ -599,8 +602,8 @@ def detect_conflict_files(node, extra_fi
       break
   else:
     msg = "Encountered unexpected disk path '" + node.name + "'"
-    print(msg)
-    node.pprint()
+    logger.warn(msg)
+    logger.warn(str(node))
     raise SVNTreeUnequal(msg)
 
 ###########################################################################
@@ -634,17 +637,20 @@ def compare_trees(label,
 
   def display_nodes(a, b):
     'Display two nodes, expected and actual.'
-    print("=============================================================")
-    print("Expected '%s' and actual '%s' in %s tree are different!"
-          % (b.name, a.name, label))
-    print("=============================================================")
-    print("EXPECTED NODE TO BE:")
-    print("=============================================================")
-    b.pprint()
-    print("=============================================================")
-    print("ACTUAL NODE FOUND:")
-    print("=============================================================")
-    a.pprint()
+    o = StringIO()
+    o.write("=============================================================\n")
+    o.write("Expected '%s' and actual '%s' in %s tree are different!\n"
+                % (b.name, a.name, label))
+    o.write("=============================================================\n")
+    o.write("EXPECTED NODE TO BE:\n")
+    o.write("=============================================================\n")
+    b.pprint(o)
+    o.write("=============================================================\n")
+    o.write("ACTUAL NODE FOUND:\n")
+    o.write("=============================================================\n")
+    a.pprint(o)
+    logger.warn(o.getvalue())
+    o.close()
 
   # Setup singleton handlers
   if singleton_handler_a is None:
@@ -690,21 +696,21 @@ def compare_trees(label,
         if b_child not in accounted_for:
           singleton_handler_b(b_child, b_baton)
   except SVNTypeMismatch:
-    print('Unequal Types: one Node is a file, the other is a directory')
+    logger.warn('Unequal Types: one Node is a file, the other is a directory')
     raise SVNTreeUnequal
   except IndexError:
-    print("Error: unequal number of children")
+    logger.warn("Error: unequal number of children")
     raise SVNTreeUnequal
   except SVNTreeUnequal:
     if a.name != root_node_name:
-      print("Unequal at node %s" % a.name)
+      logger.warn("Unequal at node %s" % a.name)
     raise
 
 
 
 # Visually show a tree's structure
 
-def dump_tree(n,indent=""):
+def _dump_tree(n,indent="",stream=sys.stdout):
   """Print out a nice representation of the structure of the tree in
   the SVNTreeNode N. Prefix each line with the string INDENT."""
 
@@ -712,18 +718,25 @@ def dump_tree(n,indent=""):
   tmp_children = sorted(n.children or [])
 
   if n.name == root_node_name:
-    print("%s%s" % (indent, "ROOT"))
+    stream.write("%s%s\n" % (indent, "ROOT"))
   else:
-    print("%s%s" % (indent, n.name))
+    stream.write("%s%s\n" % (indent, n.name))
 
   indent = indent.replace("-", " ")
   indent = indent.replace("+", " ")
   for i in range(len(tmp_children)):
     c = tmp_children[i]
     if i == len(tmp_children)-1:
-      dump_tree(c,indent + "  +-- ")
+      _dump_tree(c,indent + "  +-- ",stream)
     else:
-      dump_tree(c,indent + "  |-- ")
+      _dump_tree(c,indent + "  |-- ",stream)
+
+
+def dump_tree(n):
+    output = StringIO()
+    _dump_tree(n,stream=output)
+    logger.warn(output.getvalue())
+    output.close()
 
 
 def dump_tree_script__crawler(n, subtree="", stream=sys.stdout):

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/verify.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/verify.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/verify.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/verify.py Thu Mar 15 21:40:15 2012
@@ -27,9 +27,12 @@
 import re, sys
 from difflib import unified_diff, ndiff
 import pprint
+import logging
 
 import svntest
 
+logger = logging.getLogger()
+
 
 ######################################################################
 # Exception types
@@ -230,7 +233,7 @@ class AnyOutput(ExpectedOutput):
 
   def display_differences(self, message, label, actual):
     if message:
-      print(message)
+      logger.warn(message)
 
 
 class RegexOutput(ExpectedOutput):
@@ -296,12 +299,12 @@ class UnorderedRegexOutput(UnorderedOutp
 def display_trees(message, label, expected, actual):
   'Print two trees, expected and actual.'
   if message is not None:
-    print(message)
+    logger.warn(message)
   if expected is not None:
-    print('EXPECTED %s:' % label)
+    logger.warn('EXPECTED %s:', label)
     svntest.tree.dump_tree(expected)
   if actual is not None:
-    print('ACTUAL %s:' % label)
+    logger.warn('ACTUAL %s:', label)
     svntest.tree.dump_tree(actual)
 
 
@@ -311,7 +314,7 @@ def display_lines(message, label, expect
   with LABEL) followed by ACTUAL (also labeled with LABEL).
   Both EXPECTED and ACTUAL may be strings or lists of strings."""
   if message is not None:
-    print(message)
+    logger.warn(message)
   if expected is not None:
     output = 'EXPECTED %s' % label
     if expected_is_regexp:
@@ -320,17 +323,17 @@ def display_lines(message, label, expect
     if expected_is_unordered:
       output += ' (unordered)'
     output += ':'
-    print(output)
+    logger.warn(output)
     for x in expected:
       sys.stdout.write(x)
   if actual is not None:
-    print('ACTUAL %s:' % label)
+    logger.warn('ACTUAL %s:', label)
     for x in actual:
       sys.stdout.write(x)
 
   # Additionally print unified diff
   if not expected_is_regexp:
-    print('DIFF ' + ' '.join(output.split(' ')[1:]))
+    logger.warn('DIFF ' + ' '.join(output.split(' ')[1:]))
 
     if type(expected) is str:
       expected = [expected]

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/wc.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/wc.py Thu Mar 15 21:40:15 2012
@@ -27,9 +27,20 @@ import os
 import sys
 import re
 import urllib
+import logging
+import pprint
+
+if sys.version_info[0] >= 3:
+  # Python >=3.0
+  from io import StringIO
+else:
+  # Python <3.0
+  from cStringIO import StringIO
 
 import svntest
 
+logger = logging.getLogger()
+
 
 #
 # 'status -v' output looks like this:
@@ -362,9 +373,8 @@ class State:
     if 0:
       check = tree.as_state()
       if self != check:
-        import pprint
-        pprint.pprint(self.desc)
-        pprint.pprint(check.desc)
+        logger.warn(pprint.pformat(self.desc))
+        logger.warn(pprint.pformat(check.desc))
         # STATE -> TREE -> STATE is lossy.
         # In many cases, TREE -> STATE -> TREE is not.
         # Even though our conversion from a TREE has lost some information, we
@@ -894,21 +904,29 @@ def display_nodes(label, path, expected,
   'Display two nodes, expected and actual.'
   expected = item_to_node(path, expected)
   actual = item_to_node(path, actual)
-  print("=============================================================")
-  print("Expected '%s' and actual '%s' in %s tree are different!"
-        % (expected.name, actual.name, label))
-  print("=============================================================")
-  print("EXPECTED NODE TO BE:")
-  print("=============================================================")
-  expected.pprint()
-  print("=============================================================")
-  print("ACTUAL NODE FOUND:")
-  print("=============================================================")
-  actual.pprint()
+
+  o = StringIO()
+  o.write("=============================================================\n")
+  o.write("Expected '%s' and actual '%s' in %s tree are different!\n"
+                % (expected.name, actual.name, label))
+  o.write("=============================================================\n")
+  o.write("EXPECTED NODE TO BE:\n")
+  o.write("=============================================================\n")
+  expected.pprint(o)
+  o.write("=============================================================\n")
+  o.write("ACTUAL NODE FOUND:\n")
+  o.write("=============================================================\n")
+  actual.pprint(o)
+
+  logger.warn(o.getvalue())
+  o.close()
 
 ### yanked from tree.py
 def default_singleton_handler(description, path, item):
   node = item_to_node(path, item)
-  print("Couldn't find node '%s' in %s tree" % (node.name, description))
-  node.pprint()
+  logger.warn("Couldn't find node '%s' in %s tree" % (node.name, description))
+  o = StringIO()
+  node.pprint(o)
+  logger.warn(o.getvalue())
+  o.close()
   raise svntest.tree.SVNTreeUnequal

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/tree_conflict_tests.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/tree_conflict_tests.py Thu Mar 15 21:40:15 2012
@@ -38,6 +38,7 @@ from svntest.actions import run_and_veri
 from svntest.actions import run_and_verify_info
 from svntest.actions import get_virginal_state
 import shutil
+import logging
 
 # (abbreviation)
 Skip = svntest.testcase.Skip_deco
@@ -49,16 +50,7 @@ Wimp = svntest.testcase.Wimp_deco
 Item = svntest.wc.StateItem
 AnyOutput = svntest.verify.AnyOutput
 
-# If verbose mode is enabled, print the LINE and a newline.
-def verbose_print(line):
-  if main.options.verbose:
-    print(line)
-
-# If verbose mode is enabled, print the (assumed newline-terminated) LINES.
-def verbose_printlines(lines):
-  if main.options.verbose:
-    for line in lines:
-      sys.stdout.write(line)
+logger = logging.getLogger()
 
 ######################################################################
 # Tests
@@ -388,14 +380,14 @@ def ensure_tree_conflict(sbox, operation
   def url_of(repo_relative_path):
     return sbox.repo_url + '/' + repo_relative_path
 
-  verbose_print("")
-  verbose_print("=== Starting a set of '" + operation + "' tests.")
+  logger.debug("")
+  logger.debug("=== Starting a set of '" + operation + "' tests.")
 
   # Path to source branch, relative to wc_dir.
   # Source is where the "incoming" mods are made.
   source_br = "branch1"
 
-  verbose_print("--- Creating changes in repos")
+  logger.debug("--- Creating changes in repos")
   source_wc_dir = os.path.join(wc_dir, source_br)
   source_left_rev, source_right_rev = set_up_repos(wc_dir, source_wc_dir,
                                                    incoming_scenarios)
@@ -430,9 +422,9 @@ def ensure_tree_conflict(sbox, operation
       source_url = url_of(source_br + '/' + scen_name)
       target_path = os.path.join(target_br, scen_name)
 
-      verbose_print("=== " + str(inc_action) + " onto " + str(loc_action))
+      logger.debug("=== " + str(inc_action) + " onto " + str(loc_action))
 
-      verbose_print("--- Making local mods")
+      logger.debug("--- Making local mods")
       for modaction in loc_action:
         modify(modaction, localmod_paths(".", target_path), is_init=False)
       if commit_local_mods:
@@ -444,7 +436,7 @@ def ensure_tree_conflict(sbox, operation
       # For update, verify the pre-condition that WC is out of date.
       # For switch/merge, there is no such precondition.
       if operation == 'update':
-        verbose_print("--- Trying to commit (expecting 'out-of-date' error)")
+        logger.debug("--- Trying to commit (expecting 'out-of-date' error)")
         run_and_verify_commit(".", None, None, "Commit failed",
                               target_path)
 
@@ -462,15 +454,15 @@ def ensure_tree_conflict(sbox, operation
                                                       match_all=False)
       # Do the main action
       if operation == 'update':
-        verbose_print("--- Updating")
+        logger.debug("--- Updating")
         run_and_verify_svn(None, expected_stdout, [],
                            'update', target_path)
       elif operation == 'switch':
-        verbose_print("--- Switching")
+        logger.debug("--- Switching")
         run_and_verify_svn(None, expected_stdout, [],
                            'switch', source_url, target_path)
       elif operation == 'merge':
-        verbose_print("--- Merging")
+        logger.debug("--- Merging")
         run_and_verify_svn(None, expected_stdout, [],
                            'merge', '--ignore-ancestry',
                            '--allow-mixed-revisions',
@@ -479,7 +471,7 @@ def ensure_tree_conflict(sbox, operation
       else:
         raise Exception("unknown operation: '" + operation + "'")
 
-      verbose_print("--- Checking that 'info' reports the conflict")
+      logger.debug("--- Checking that 'info' reports the conflict")
       if operation == 'update' or operation == 'switch':
         incoming_left_rev = target_start_rev
       else:
@@ -495,39 +487,39 @@ def ensure_tree_conflict(sbox, operation
             re.escape(victim_name + '@' + str(incoming_right_rev)) + r')' }
       run_and_verify_info([expected_info], victim_path)
 
-      verbose_print("--- Trying to commit (expecting 'conflict' error)")
+      logger.debug("--- Trying to commit (expecting 'conflict' error)")
       ### run_and_verify_commit() requires an "output_tree" argument, but
       #   here we get away with passing None because we know an implementation
       #   detail: namely that it's not going to look at that argument if it
       #   gets the stderr that we're expecting.
       run_and_verify_commit(".", None, None, ".*conflict.*", victim_path)
 
-      verbose_print("--- Checking that 'status' reports the conflict")
+      logger.debug("--- Checking that 'status' reports the conflict")
       expected_stdout = svntest.verify.RegexOutput("^......C.* " +
                                                    re.escape(victim_path) + "$",
                                                    match_all=False)
       run_and_verify_svn(None, expected_stdout, [],
                          'status', victim_path)
 
-      verbose_print("--- Resolving the conflict")
+      logger.debug("--- Resolving the conflict")
       # Make sure resolving the parent does nothing.
       run_and_verify_resolved([], os.path.dirname(victim_path))
       # The real resolved call.
       run_and_verify_resolved([victim_path])
 
-      verbose_print("--- Checking that 'status' does not report a conflict")
+      logger.debug("--- Checking that 'status' does not report a conflict")
       exitcode, stdout, stderr = run_and_verify_svn(None, None, [],
                                                 'status', victim_path)
       for line in stdout:
         if line[6] == 'C': # and line.endswith(victim_path + '\n'):
           raise svntest.Failure("unexpected status C") # on victim_path
 
-      # verbose_print("--- Committing (should now succeed)")
+      # logger.debug("--- Committing (should now succeed)")
       # run_and_verify_svn(None, None, [],
       #                    'commit', '-m', '', target_path)
       # target_start_rev += 1
 
-      verbose_print("")
+      logger.debug("")
 
     os.chdir(saved_cwd)
 

Modified: subversion/branches/inheritable-props/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/libsvn_client/client-test.c?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/inheritable-props/subversion/tests/libsvn_client/client-test.c Thu Mar 15 21:40:15 2012
@@ -572,7 +572,7 @@ test_copy_crash(const svn_test_opts_t *o
   /* Create a filesytem and repository containing the Greek tree. */
   SVN_ERR(create_greek_repos(&repos_url, "test-copy-crash", opts, pool));
 
-  svn_client_create_context(&ctx, pool);
+  SVN_ERR(svn_client_create_context(&ctx, pool));
 
   rev.kind = svn_opt_revision_head;
   dest = svn_path_url_add_component2(repos_url, "A/E", pool);
@@ -668,7 +668,7 @@ test_youngest_common_ancestor(const svn_
   /* Create a filesytem and repository containing the Greek tree. */
   SVN_ERR(create_greek_repos(&repos_url, "test-youngest-common-ancestor", opts, pool));
 
-  svn_client_create_context(&ctx, pool);
+  SVN_ERR(svn_client_create_context(&ctx, pool));
 
   /* Copy a file into dir 'A', keeping its own basename. */
   sources = apr_array_make(pool, 1, sizeof(svn_client_copy_source_t *));

Modified: subversion/branches/inheritable-props/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/libsvn_wc/db-test.c?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/inheritable-props/subversion/tests/libsvn_wc/db-test.c Thu Mar 15 21:40:15 2012
@@ -228,8 +228,12 @@ static const char * const TESTING_DATA =
   "  1, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "',"
   "  10, null, null, null);"
   "insert into nodes values ("
-  "  1, 'moved/file', 0, 'moved', 2, 'moved/file', 2, 'base-deleted',"
-  "  0, 'J/J-d', 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "',"
+  "  1, 'moved/file', 0, 'moved', 2, 'moved/file', 2, 'normal',"
+  "  0, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "',"
+  "  10, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'moved/file', 2, 'moved', 2, 'moved/file', 2, 'base-deleted',"
+  "  0, 'J/J-d', 'file', '()', null, null, null, null, null, null,"
   "  10, null, null, null);"
   "insert into nodes values ("
   "  1, 'J/J-e', 1, 'J', null, null, null, 'normal',"

Modified: subversion/branches/inheritable-props/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/libsvn_wc/op-depth-test.c?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/inheritable-props/subversion/tests/libsvn_wc/op-depth-test.c Thu Mar 15 21:40:15 2012
@@ -328,7 +328,7 @@ typedef struct nodes_row_t {
 
 /* Macro for filling in the REPO_* fields of a non-base NODES_ROW_T
  * that has no copy-from info. */
-#define NO_COPY_FROM SVN_INVALID_REVNUM, NULL
+#define NO_COPY_FROM SVN_INVALID_REVNUM, NULL, FALSE
 #define MOVED_HERE FALSE, NULL, TRUE
 
 /* Return a human-readable string representing ROW. */
@@ -1713,8 +1713,8 @@ test_wc_move(const svn_test_opts_t *opts
       { 0, "",           "normal",       1, "" },
       { 0, "A",          "normal",       1, "A" },
       { 0, "A/B",        "normal",       1, "A/B" },
-      { 0, "A/B/C",      "normal",       1, "A/B/C", FALSE, "A/B/C-move" },
-      { 3, "A/B/C",      "base-deleted", NO_COPY_FROM },
+      { 0, "A/B/C",      "normal",       1, "A/B/C"},
+      { 3, "A/B/C",      "base-deleted", NO_COPY_FROM, "A/B/C-move" },
       { 3, "A/B/C-move", "normal",       1, "A/B/C", MOVED_HERE },
       { 0 }
     };
@@ -1726,13 +1726,13 @@ test_wc_move(const svn_test_opts_t *opts
     nodes_row_t rows[] = {
       { 0, "",                "normal",       1, "" },
       { 0, "A",               "normal",       1, "A" },
-      { 0, "A/B",             "normal",       1, "A/B", FALSE, "A/B-move" },
-      { 0, "A/B/C",           "normal",       1, "A/B/C", FALSE, "A/B-move/C-move" },
-      { 2, "A/B",             "base-deleted", NO_COPY_FROM },
-      { 2, "A/B/C",           "base-deleted", NO_COPY_FROM },
+      { 0, "A/B",             "normal",       1, "A/B"},
+      { 0, "A/B/C",           "normal",       1, "A/B/C"},
+      { 2, "A/B",             "base-deleted", NO_COPY_FROM, "A/B-move" },
+      { 2, "A/B/C",           "base-deleted", NO_COPY_FROM},
       { 2, "A/B-move",        "normal",       1, "A/B", MOVED_HERE },
       { 2, "A/B-move/C",      "normal",       1, "A/B/C", MOVED_HERE },
-      { 3, "A/B-move/C",      "base-deleted", NO_COPY_FROM },
+      { 3, "A/B-move/C",      "base-deleted", NO_COPY_FROM, "A/B-move/C-move" },
       { 3, "A/B-move/C-move", "normal",       1, "A/B/C", MOVED_HERE },
       { 0 }
     };
@@ -3773,8 +3773,8 @@ nested_moves_child_first(const svn_test_
       {0, "",       "normal",       1, ""},
       {0, "A",      "normal",       1, "A"},
       {0, "A/B",    "normal",       1, "A/B"},
-      {0, "A/B/C",  "normal",       1, "A/B/C", FALSE, "A/B/C2"},
-      {3, "A/B/C",  "base-deleted", NO_COPY_FROM},
+      {0, "A/B/C",  "normal",       1, "A/B/C"},
+      {3, "A/B/C",  "base-deleted", NO_COPY_FROM, "A/B/C2"},
       {3, "A/B/C2", "normal",       1, "A/B/C", MOVED_HERE},
       {0}
     };
@@ -3785,13 +3785,13 @@ nested_moves_child_first(const svn_test_
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
       {0, "A",       "normal",       1, "A"},
-      {0, "A/B",     "normal",       1, "A/B",   FALSE, "A/B2"},
-      {0, "A/B/C",   "normal",       1, "A/B/C", FALSE, "A/B2/C2"},
-      {2, "A/B",     "base-deleted", NO_COPY_FROM},
+      {0, "A/B",     "normal",       1, "A/B"},
+      {0, "A/B/C",   "normal",       1, "A/B/C"},
+      {2, "A/B",     "base-deleted", NO_COPY_FROM, "A/B2"},
       {2, "A/B/C",   "base-deleted", NO_COPY_FROM},
       {2, "A/B2",    "normal",       1, "A/B",   MOVED_HERE},
       {2, "A/B2/C",  "normal",       1, "A/B/C", MOVED_HERE},
-      {3, "A/B2/C",  "base-deleted", NO_COPY_FROM},
+      {3, "A/B2/C",  "base-deleted", NO_COPY_FROM, "A/B2/C2"},
       {3, "A/B2/C2", "normal",       1, "A/B/C", MOVED_HERE},
       {0}
     };
@@ -3801,20 +3801,20 @@ nested_moves_child_first(const svn_test_
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
-      {0, "A",       "normal",       1, "A",     FALSE, "A2"},
-      {0, "A/B",     "normal",       1, "A/B",   FALSE, "A2/B2"},
-      {0, "A/B/C",   "normal",       1, "A/B/C", FALSE, "A2/B2/C2"},
-      {1, "A",       "base-deleted", NO_COPY_FROM},
+      {0, "A",       "normal",       1, "A"},
+      {0, "A/B",     "normal",       1, "A/B"},
+      {0, "A/B/C",   "normal",       1, "A/B/C"},
+      {1, "A",       "base-deleted", NO_COPY_FROM, "A2"},
       {1, "A/B",     "base-deleted", NO_COPY_FROM},
       {1, "A/B/C",   "base-deleted", NO_COPY_FROM},
       {1, "A2",      "normal",       1, "A",     MOVED_HERE},
       {1, "A2/B",    "normal",       1, "A/B",   MOVED_HERE},
       {1, "A2/B/C",  "normal",       1, "A/B/C", MOVED_HERE},
-      {2, "A2/B",    "base-deleted", NO_COPY_FROM},
+      {2, "A2/B",    "base-deleted", NO_COPY_FROM, "A2/B2"},
       {2, "A2/B/C",  "base-deleted", NO_COPY_FROM},
       {2, "A2/B2",   "normal",       1, "A/B",   MOVED_HERE},
       {2, "A2/B2/C", "normal",       1, "A/B/C", MOVED_HERE},
-      {3, "A2/B2/C", "base-deleted", NO_COPY_FROM},
+      {3, "A2/B2/C", "base-deleted", NO_COPY_FROM, "A2/B2/C2"},
       {3, "A2/B2/C2","normal",       1, "A/B/C", MOVED_HERE},
       {0}
     };
@@ -3827,10 +3827,10 @@ nested_moves_child_first(const svn_test_
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
-      {0, "A",       "normal",       1, "A",     FALSE, "A2"},
+      {0, "A",       "normal",       1, "A"},
       {0, "A/B",     "normal",       1, "A/B"},
       {0, "A/B/C",   "normal",       1, "A/B/C"},
-      {1, "A",       "base-deleted", NO_COPY_FROM},
+      {1, "A",       "base-deleted", NO_COPY_FROM, "A2"},
       {1, "A/B",     "base-deleted", NO_COPY_FROM},
       {1, "A/B/C",   "base-deleted", NO_COPY_FROM},
       {1, "A2",      "normal",       1, "A",     MOVED_HERE},
@@ -3871,10 +3871,10 @@ nested_moves_child_last(const svn_test_o
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
-      {0, "A",       "normal",       1, "A",     FALSE, "A2"},
+      {0, "A",       "normal",       1, "A"},
       {0, "A/B",     "normal",       1, "A/B"},
       {0, "A/B/C",   "normal",       1, "A/B/C"},
-      {1, "A",       "base-deleted", NO_COPY_FROM},
+      {1, "A",       "base-deleted", NO_COPY_FROM, "A2"},
       {1, "A/B",     "base-deleted", NO_COPY_FROM},
       {1, "A/B/C",   "base-deleted", NO_COPY_FROM},
       {1, "A2",      "normal",       1, "A",     MOVED_HERE},
@@ -3888,16 +3888,16 @@ nested_moves_child_last(const svn_test_o
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
-      {0, "A",       "normal",       1, "A",     FALSE, "A2"},
-      {0, "A/B",     "normal",       1, "A/B",   FALSE, "A2/B2"},
+      {0, "A",       "normal",       1, "A"},
+      {0, "A/B",     "normal",       1, "A/B"},
       {0, "A/B/C",   "normal",       1, "A/B/C"},
-      {1, "A",       "base-deleted", NO_COPY_FROM},
+      {1, "A",       "base-deleted", NO_COPY_FROM, "A2"},
       {1, "A/B",     "base-deleted", NO_COPY_FROM},
       {1, "A/B/C",   "base-deleted", NO_COPY_FROM},
       {1, "A2",      "normal",       1, "A",     MOVED_HERE},
       {1, "A2/B",    "normal",       1, "A/B",   MOVED_HERE},
       {1, "A2/B/C",  "normal",       1, "A/B/C", MOVED_HERE},
-      {2, "A2/B",    "base-deleted", NO_COPY_FROM},
+      {2, "A2/B",    "base-deleted", NO_COPY_FROM, "A2/B2"},
       {2, "A2/B/C",  "base-deleted", NO_COPY_FROM},
       {2, "A2/B2",   "normal",       1, "A/B",   MOVED_HERE},
       {2, "A2/B2/C", "normal",       1, "A/B/C", MOVED_HERE},
@@ -3909,20 +3909,20 @@ nested_moves_child_last(const svn_test_o
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
-      {0, "A",       "normal",       1, "A",     FALSE, "A2"},
-      {0, "A/B",     "normal",       1, "A/B",   FALSE, "A2/B2"},
-      {0, "A/B/C",   "normal",       1, "A/B/C", FALSE, "A2/B2/C2"},
-      {1, "A",       "base-deleted", NO_COPY_FROM},
+      {0, "A",       "normal",       1, "A"},
+      {0, "A/B",     "normal",       1, "A/B"},
+      {0, "A/B/C",   "normal",       1, "A/B/C"},
+      {1, "A",       "base-deleted", NO_COPY_FROM, "A2"},
       {1, "A/B",     "base-deleted", NO_COPY_FROM},
       {1, "A/B/C",   "base-deleted", NO_COPY_FROM},
       {1, "A2",      "normal",       1, "A",     MOVED_HERE},
       {1, "A2/B",    "normal",       1, "A/B",   MOVED_HERE},
       {1, "A2/B/C",  "normal",       1, "A/B/C", MOVED_HERE},
-      {2, "A2/B",    "base-deleted", NO_COPY_FROM},
+      {2, "A2/B",    "base-deleted", NO_COPY_FROM, "A2/B2"},
       {2, "A2/B/C",  "base-deleted", NO_COPY_FROM},
       {2, "A2/B2",   "normal",       1, "A/B",   MOVED_HERE},
       {2, "A2/B2/C", "normal",       1, "A/B/C", MOVED_HERE},
-      {3, "A2/B2/C", "base-deleted", NO_COPY_FROM},
+      {3, "A2/B2/C", "base-deleted", NO_COPY_FROM, "A2/B2/C2"},
       {3, "A2/B2/C2","normal",       1, "A/B/C", MOVED_HERE},
       {0}
     };
@@ -3935,10 +3935,10 @@ nested_moves_child_last(const svn_test_o
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
-      {0, "A",       "normal",       1, "A",     FALSE, "A2"},
+      {0, "A",       "normal",       1, "A"},
       {0, "A/B",     "normal",       1, "A/B"},
       {0, "A/B/C",   "normal",       1, "A/B/C"},
-      {1, "A",       "base-deleted", NO_COPY_FROM},
+      {1, "A",       "base-deleted", NO_COPY_FROM, "A2"},
       {1, "A/B",     "base-deleted", NO_COPY_FROM},
       {1, "A/B/C",   "base-deleted", NO_COPY_FROM},
       {1, "A2",      "normal",       1, "A",     MOVED_HERE},
@@ -3976,8 +3976,7 @@ move_in_copy(const svn_test_opts_t *opts
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
-  SVN_ERR(wc_move(&b, "A2/B", "A2/B2")); /* ### Moved-here gets recorded, but
-                                            not moved-to. */
+  SVN_ERR(wc_move(&b, "A2/B", "A2/B2"));
   {
     nodes_row_t nodes[] = {
       {0, "",      "normal",       1, ""},
@@ -3985,8 +3984,8 @@ move_in_copy(const svn_test_opts_t *opts
       {0, "A/B",   "normal",       1, "A/B"},
       {1, "A2",    "normal",       1, "A"},
       {1, "A2/B",  "normal",       1, "A/B"},
-      {2, "A2/B",  "base-deleted", NO_COPY_FROM},
-      {2, "A2/B2", "normal",       1, "A/B"},
+      {2, "A2/B",  "base-deleted", NO_COPY_FROM, "A2/B2"},
+      {2, "A2/B2", "normal",       1, "A/B", MOVED_HERE},
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
@@ -4024,9 +4023,7 @@ move_in_replace(const svn_test_opts_t *o
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
-  SVN_ERR(wc_move(&b, "A/B", "A/B2")); /* ### Moved-to gets recorded on A/B
-                                          at op-depth=0, that's not the node
-                                          that got moved. */
+  SVN_ERR(wc_move(&b, "A/B", "A/B2"));
   {
     nodes_row_t nodes[] = {
       {0, "",     "normal",       1, ""},
@@ -4036,7 +4033,7 @@ move_in_replace(const svn_test_opts_t *o
       {0, "X/B",  "normal",       1, "X/B"},
       {1, "A",    "normal",       1, "X"},
       {1, "A/B",  "normal",       1, "X/B"},
-      {2, "A/B",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B",  "base-deleted", NO_COPY_FROM, "A/B2"},
       {2, "A/B2", "normal",       1, "X/B", MOVED_HERE},
       {0}
     };
@@ -4075,9 +4072,9 @@ copy_a_move(const svn_test_opts_t *opts,
       {0, "",      "normal",       1, ""},
       {0, "A",     "normal",       1, "A"},
       {0, "A/B",   "normal",       1, "A/B"},
-      {0, "A/B/C", "normal",       1, "A/B/C", FALSE, "A/C2"},
+      {0, "A/B/C", "normal",       1, "A/B/C"},
       {2, "A/C2",  "normal",       1, "A/B/C", MOVED_HERE},
-      {3, "A/B/C", "base-deleted", NO_COPY_FROM},
+      {3, "A/B/C", "base-deleted", NO_COPY_FROM, "A/C2"},
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
@@ -4091,14 +4088,14 @@ copy_a_move(const svn_test_opts_t *opts,
       {0, "",       "normal",       1, ""},
       {0, "A",      "normal",       1, "A"},
       {0, "A/B",    "normal",       1, "A/B"},
-      {0, "A/B/C",  "normal",       1, "A/B/C", FALSE, "A/C2"},
+      {0, "A/B/C",  "normal",       1, "A/B/C"},
       {2, "A/C2",   "normal",       1, "A/B/C", MOVED_HERE},
-      {3, "A/B/C",  "base-deleted", NO_COPY_FROM},
+      {3, "A/B/C",  "base-deleted", NO_COPY_FROM, "A/C2"},
       {1, "A2",     "normal",       1, "A"},
       {1, "A2/B",   "normal",       1, "A/B"},
       {1, "A2/B/C", "normal",       1, "A/B/C"},
-      {2, "A2/C2",  "normal",       1, "A/B/C"},
-      {3, "A2/B/C", "base-deleted", NO_COPY_FROM},
+      {2, "A2/C2",  "normal",       1, "A/B/C"},   /* MOVED_HERE? */
+      {3, "A2/B/C", "base-deleted", NO_COPY_FROM}, /* "A2/C2"? */
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
@@ -4128,12 +4125,12 @@ move_to_swap(const svn_test_opts_t *opts
     nodes_row_t nodes[] = {
       {0, "",    "normal",       1, ""},
       {0, "A",   "normal",       1, "A"},
-      {0, "A/B", "normal",       1, "A/B", FALSE, "X/B"},
+      {0, "A/B", "normal",       1, "A/B"},
       {0, "X",   "normal",       1, "X"},
-      {0, "X/Y", "normal",       1, "X/Y", FALSE, "A/Y"},
-      {2, "A/B", "base-deleted", NO_COPY_FROM},
+      {0, "X/Y", "normal",       1, "X/Y"},
+      {2, "A/B", "base-deleted", NO_COPY_FROM, "X/B"},
       {2, "A/Y", "normal",       1, "X/Y", MOVED_HERE},
-      {2, "X/Y", "base-deleted", NO_COPY_FROM},
+      {2, "X/Y", "base-deleted", NO_COPY_FROM, "A/Y"},
       {2, "X/B", "normal",       1, "A/B", MOVED_HERE},
       {0}
     };
@@ -4141,26 +4138,69 @@ move_to_swap(const svn_test_opts_t *opts
   }
 
   SVN_ERR(wc_move(&b, "A", "A2"));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",     "normal",       1, ""},
+      {0, "A",    "normal",       1, "A"},
+      {0, "A/B",  "normal",       1, "A/B"},
+      {0, "X",    "normal",       1, "X"},
+      {0, "X/Y",  "normal",       1, "X/Y"},
+      {1, "A",    "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",  "base-deleted", NO_COPY_FROM},
+      {1, "A2",   "normal",       1, "A", MOVED_HERE},
+      {1, "A2/B", "normal",       1, "A/B", MOVED_HERE},
+      {2, "A2/B", "base-deleted", NO_COPY_FROM, "X/B"},
+      {2, "A2/Y", "normal",       1, "X/Y", MOVED_HERE},
+      {2, "X/Y",  "base-deleted", NO_COPY_FROM, "A2/Y"},
+      {2, "X/B",  "normal",       1, "A/B", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   SVN_ERR(wc_move(&b, "X", "A"));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",     "normal",       1, ""},
+      {0, "A",    "normal",       1, "A"},
+      {0, "A/B",  "normal",       1, "A/B"},
+      {0, "X",    "normal",       1, "X"},
+      {0, "X/Y",  "normal",       1, "X/Y"},
+      {1, "A",    "normal",       1, "X", FALSE, "A2", TRUE},
+      {1, "A/B",  "base-deleted", NO_COPY_FROM},
+      {1, "A/Y",  "normal",       1, "X/Y", MOVED_HERE},
+      {1, "A2",   "normal",       1, "A", MOVED_HERE},
+      {1, "A2/B", "normal",       1, "A/B", MOVED_HERE},
+      {1, "X",    "base-deleted", NO_COPY_FROM, "A"},
+      {1, "X/Y",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B",  "normal",       1, "A/B", MOVED_HERE},
+      {2, "A/Y",  "base-deleted", NO_COPY_FROM, "A2/Y"},
+      {2, "A2/B", "base-deleted", NO_COPY_FROM, "A/B"},
+      {2, "A2/Y", "normal",       1, "X/Y", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   SVN_ERR(wc_move(&b, "A2", "X"));
 
-  /* Is this correct or should A/Y and X/B at op-depth=1 be marked
-     moved-here? */
   {
     nodes_row_t nodes[] = {
       {0, "",    "normal",       1, ""},
-      {0, "A",   "normal",       1, "A",   FALSE, "X"},
-      {0, "A/B", "normal",       1, "A/B", FALSE, "A/B"},
-      {0, "X",   "normal",       1, "X",   FALSE, "A"},
-      {0, "X/Y", "normal",       1, "X/Y", FALSE, "X/Y"},
-      {1, "A",   "normal",       1, "X",   MOVED_HERE},
+      {0, "A",   "normal",       1, "A"},
+      {0, "A/B", "normal",       1, "A/B"},
+      {0, "X",   "normal",       1, "X"},
+      {0, "X/Y", "normal",       1, "X/Y"},
+      {1, "A",   "normal",       1, "X",   FALSE, "X", TRUE},
       {1, "A/Y", "normal",       1, "X/Y", MOVED_HERE},
       {1, "A/B", "base-deleted", NO_COPY_FROM},
-      {1, "X",   "normal",       1, "A",   MOVED_HERE},
+      {1, "X",   "normal",       1, "A",   FALSE, "A", TRUE},
       {1, "X/B", "normal",       1, "A/B", MOVED_HERE},
       {1, "X/Y", "base-deleted", NO_COPY_FROM},
-      {2, "A/Y", "base-deleted", NO_COPY_FROM},
-      {2, "X/B", "base-deleted", NO_COPY_FROM},
+      {2, "A/Y", "base-deleted", NO_COPY_FROM, "X/Y"},
+      {2, "X/B", "base-deleted", NO_COPY_FROM, "A/B"},
       {2, "A/B", "normal",       1, "A/B", MOVED_HERE},
       {2, "X/Y", "normal",       1, "X/Y", MOVED_HERE},
       {0}
@@ -4178,14 +4218,14 @@ move_to_swap(const svn_test_opts_t *opts
   {
     nodes_row_t nodes[] = {
       {0, "",    "normal",       1, ""},
-      {0, "A",   "normal",       1, "A",   FALSE, "X"},
+      {0, "A",   "normal",       1, "A"},
       {0, "A/B", "normal",       1, "A/B"},
-      {0, "X",   "normal",       1, "X",   FALSE, "A"},
+      {0, "X",   "normal",       1, "X"},
       {0, "X/Y", "normal",       1, "X/Y"},
-      {1, "A",   "normal",       1, "X",   MOVED_HERE},
+      {1, "A",   "normal",       1, "X",   FALSE, "X", TRUE},
       {1, "A/Y", "normal",       1, "X/Y", MOVED_HERE},
       {1, "A/B", "base-deleted", NO_COPY_FROM},
-      {1, "X",   "normal",       1, "A",   MOVED_HERE},
+      {1, "X",   "normal",       1, "A",   FALSE, "A", TRUE},
       {1, "X/B", "normal",       1, "A/B", MOVED_HERE},
       {1, "X/Y", "base-deleted", NO_COPY_FROM},
       {0}
@@ -4199,18 +4239,18 @@ move_to_swap(const svn_test_opts_t *opts
   {
     nodes_row_t nodes[] = {
       {0, "",    "normal",       1, ""},
-      {0, "A",   "normal",       1, "A",   FALSE, "X"},
-      {0, "A/B", "normal",       1, "A/B", FALSE, "A/B"},
-      {0, "X",   "normal",       1, "X",   FALSE, "A"},
-      {0, "X/Y", "normal",       1, "X/Y", FALSE, "X/Y"},
-      {1, "A",   "normal",       1, "X",   MOVED_HERE},
+      {0, "A",   "normal",       1, "A"},
+      {0, "A/B", "normal",       1, "A/B"},
+      {0, "X",   "normal",       1, "X"},
+      {0, "X/Y", "normal",       1, "X/Y"},
+      {1, "A",   "normal",       1, "X",   FALSE, "X", TRUE},
       {1, "A/Y", "normal",       1, "X/Y", MOVED_HERE},
       {1, "A/B", "base-deleted", NO_COPY_FROM},
-      {1, "X",   "normal",       1, "A",   MOVED_HERE},
+      {1, "X",   "normal",       1, "A",   FALSE, "A", TRUE},
       {1, "X/B", "normal",       1, "A/B", MOVED_HERE},
       {1, "X/Y", "base-deleted", NO_COPY_FROM},
-      {2, "A/Y", "base-deleted", NO_COPY_FROM},
-      {2, "X/B", "base-deleted", NO_COPY_FROM},
+      {2, "A/Y", "base-deleted", NO_COPY_FROM, "X/Y"},
+      {2, "X/B", "base-deleted", NO_COPY_FROM, "A/B"},
       {2, "A/B", "normal",       1, "A/B", MOVED_HERE},
       {2, "X/Y", "normal",       1, "X/Y", MOVED_HERE},
       {0}
@@ -4227,10 +4267,10 @@ revert_nested_move(const svn_test_opts_t
   svn_test__sandbox_t b;
   nodes_row_t nodes_A_moved[] = {
     {0, "",       "normal",       1, ""},
-    {0, "A",      "normal",       1, "A",     FALSE, "A2"},
+    {0, "A",      "normal",       1, "A"},
     {0, "A/B",    "normal",       1, "A/B"},
     {0, "A/B/C",  "normal",       1, "A/B/C"},
-    {1, "A",      "base-deleted", NO_COPY_FROM},
+    {1, "A",      "base-deleted", NO_COPY_FROM, "A2"},
     {1, "A/B",    "base-deleted", NO_COPY_FROM},
     {1, "A/B/C",  "base-deleted", NO_COPY_FROM},
     {1, "A2",     "normal",       1, "A",     MOVED_HERE},
@@ -4240,16 +4280,16 @@ revert_nested_move(const svn_test_opts_t
   };
   nodes_row_t nodes_AB_moved[] = {
     {0, "",        "normal",       1, ""},
-    {0, "A",       "normal",       1, "A",     FALSE, "A2"},
-    {0, "A/B",     "normal",       1, "A/B",   FALSE, "A2/B2"},
+    {0, "A",       "normal",       1, "A"},
+    {0, "A/B",     "normal",       1, "A/B"},
     {0, "A/B/C",   "normal",       1, "A/B/C"},
-    {1, "A",       "base-deleted", NO_COPY_FROM},
+    {1, "A",       "base-deleted", NO_COPY_FROM, "A2"},
     {1, "A/B",     "base-deleted", NO_COPY_FROM},
     {1, "A/B/C",   "base-deleted", NO_COPY_FROM},
     {1, "A2",      "normal",       1, "A",     MOVED_HERE},
     {1, "A2/B",    "normal",       1, "A/B",   MOVED_HERE},
     {1, "A2/B/C",  "normal",       1, "A/B/C", MOVED_HERE},
-    {2, "A2/B",    "base-deleted", NO_COPY_FROM},
+    {2, "A2/B",    "base-deleted", NO_COPY_FROM, "A2/B2"},
     {2, "A2/B/C",  "base-deleted", NO_COPY_FROM},
     {2, "A2/B2",   "normal",       1, "A/B",   MOVED_HERE},
     {2, "A2/B2/C", "normal",       1, "A/B/C", MOVED_HERE},
@@ -4257,20 +4297,20 @@ revert_nested_move(const svn_test_opts_t
   };
   nodes_row_t nodes_ABC_moved[] = {
     {0, "",         "normal",       1, ""},
-    {0, "A",        "normal",       1, "A",     FALSE, "A2"},
-    {0, "A/B",      "normal",       1, "A/B",   FALSE, "A2/B2"},
-    {0, "A/B/C",    "normal",       1, "A/B/C", FALSE, "A2/B2/C2"},
-    {1, "A",        "base-deleted", NO_COPY_FROM},
+    {0, "A",        "normal",       1, "A"},
+    {0, "A/B",      "normal",       1, "A/B"},
+    {0, "A/B/C",    "normal",       1, "A/B/C"},
+    {1, "A",        "base-deleted", NO_COPY_FROM, "A2"},
     {1, "A/B",      "base-deleted", NO_COPY_FROM},
     {1, "A/B/C",    "base-deleted", NO_COPY_FROM},
     {1, "A2",       "normal",       1, "A",     MOVED_HERE},
     {1, "A2/B",     "normal",       1, "A/B",   MOVED_HERE},
     {1, "A2/B/C",   "normal",       1, "A/B/C", MOVED_HERE},
-    {2, "A2/B",     "base-deleted", NO_COPY_FROM},
+    {2, "A2/B",     "base-deleted", NO_COPY_FROM, "A2/B2"},
     {2, "A2/B/C",   "base-deleted", NO_COPY_FROM},
     {2, "A2/B2",    "normal",       1, "A/B",   MOVED_HERE},
     {2, "A2/B2/C",  "normal",       1, "A/B/C", MOVED_HERE},
-    {3, "A2/B2/C",  "base-deleted", NO_COPY_FROM},
+    {3, "A2/B2/C",  "base-deleted", NO_COPY_FROM, "A2/B2/C2"},
     {3, "A2/B2/C2", "normal",       1, "A/B/C", MOVED_HERE},
     {0}
   };
@@ -4308,6 +4348,13 @@ revert_nested_move(const svn_test_opts_t
   SVN_ERR(wc_revert(&b, "A2/B2", svn_depth_infinity));
   SVN_ERR(check_db_rows(&b, "", nodes_A_moved));
 
+  /* Check moves in reverse order */
+  SVN_ERR(wc_revert(&b, "", svn_depth_infinity));
+  SVN_ERR(wc_move(&b, "A/B/C", "A/B/C2"));
+  SVN_ERR(wc_move(&b, "A/B", "A/B2"));
+  SVN_ERR(wc_move(&b, "A", "A2"));
+  SVN_ERR(check_db_rows(&b, "", nodes_ABC_moved));
+
   return SVN_NO_ERROR;
 }
 
@@ -4333,34 +4380,30 @@ move_on_move(const svn_test_opts_t *opts
     nodes_row_t nodes[] = {
       {0, "",         "normal",       1, ""},
       {0, "A",        "normal",       1, "A"},
-      {0, "A/B",      "normal",       1, "A/B", FALSE, "B2"},
+      {0, "A/B",      "normal",       1, "A/B"},
       {0, "X",        "normal",       1, "X"},
       {0, "X/B",      "normal",       1, "X/B"},
       {1, "B2",       "normal",       1, "A/B", MOVED_HERE},
       {1, "A",        "normal",       1, "X"},
-      {1, "A/B",      "normal",       1, "X/B"},
+      {1, "A/B",      "normal",       1, "X/B", FALSE, "B2"},
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
-  /* A/B to B2 is already recorded in A/B but the copy has given us
-     another A/B that we can move.  A second move overwites the first
-     move stored in A/B even though it's a different node being moved,
-     and that breaks the recording of the move to B2. */
   SVN_ERR(wc_move(&b, "A/B", "B3"));
   {
     nodes_row_t nodes[] = {
       {0, "",         "normal",       1, ""},
       {0, "A",        "normal",       1, "A"},
-      {0, "A/B",      "normal",       1, "A/B",   FALSE, "B2"}, /* XFAIL */
+      {0, "A/B",      "normal",       1, "A/B"},
       {0, "X",        "normal",       1, "X"},
       {0, "X/B",      "normal",       1, "X/B"},
       {1, "B2",       "normal",       1, "A/B",   MOVED_HERE},
       {1, "B3",       "normal",       1, "X/B",   MOVED_HERE},
       {1, "A",        "normal",       1, "X"},
-      {1, "A/B",      "normal",       1, "X/B"},         /* moved_to=B3? */
-      {2, "A/B",      "base-deleted", NO_COPY_FROM},
+      {1, "A/B",      "normal",       1, "X/B", FALSE, "B2"},
+      {2, "A/B",      "base-deleted", NO_COPY_FROM, "B3"},
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
@@ -4390,37 +4433,33 @@ move_on_move2(const svn_test_opts_t *opt
   {
     nodes_row_t nodes[] = {
       {0, "",         "normal",       1, ""},
-      {0, "A",        "normal",       1, "A",   FALSE, "A2"},
+      {0, "A",        "normal",       1, "A"},
       {0, "A/B",      "normal",       1, "A/B"},
       {0, "X",        "normal",       1, "X"},
       {0, "X/B",      "normal",       1, "X/B"},
       {1, "A2",       "normal",       1, "A",   MOVED_HERE},
       {1, "A2/B",     "normal",       1, "A/B", MOVED_HERE},
-      {1, "A",        "normal",       1, "X"},
+      {1, "A",        "normal",       1, "X", FALSE, "A2"},
       {1, "A/B",      "normal",       1, "X/B"},
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
-  /* A/B is already moved to A2/B but there is no explicit moved_to,
-     we derive it from A.  The copy has given us another A/B that we
-     can move doing so stores explicit moved_to in A/B that breaks the
-     recording of the first move to A2/B. */
   SVN_ERR(wc_move(&b, "A/B", "B3"));
   {
     nodes_row_t nodes[] = {
       {0, "",         "normal",       1, ""},
-      {0, "A",        "normal",       1, "A",   FALSE, "A2"},
-      {0, "A/B",      "normal",       1, "A/B"},               /* XFAIL */
+      {0, "A",        "normal",       1, "A"},
+      {0, "A/B",      "normal",       1, "A/B"},
       {0, "X",        "normal",       1, "X"},
       {0, "X/B",      "normal",       1, "X/B"},
       {1, "A2",       "normal",       1, "A",   MOVED_HERE},
       {1, "A2/B",     "normal",       1, "A/B", MOVED_HERE},
       {1, "B3",       "normal",       1, "X/B", MOVED_HERE},
-      {1, "A",        "normal",       1, "X"},
-      {1, "A/B",      "normal",       1, "X/B"},           /* moved_to=B3? */
-      {2, "A/B",      "base-deleted", NO_COPY_FROM},
+      {1, "A",        "normal",       1, "X", FALSE, "A2"},
+      {1, "A/B",      "normal",       1, "X/B"},
+      {2, "A/B",      "base-deleted", NO_COPY_FROM, "B3"},
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
@@ -4450,9 +4489,9 @@ move_added(const svn_test_opts_t *opts, 
   {
     nodes_row_t nodes[] = {
       {0, "",         "normal",       1, ""},
-      {0, "A",        "normal",       1, "A",   FALSE, "A2"},
+      {0, "A",        "normal",       1, "A"},
       {0, "A/B",      "normal",       1, "A/B"},
-      {1, "A",        "base-deleted", NO_COPY_FROM},
+      {1, "A",        "base-deleted", NO_COPY_FROM, "A2"},
       {1, "A/B",      "base-deleted", NO_COPY_FROM},
       {1, "A2",       "normal",       1, "A",   MOVED_HERE},
       {1, "A2/B",     "normal",       1, "A/B", MOVED_HERE},
@@ -4540,9 +4579,9 @@ struct svn_test_descriptor_t test_funcs[
                        "nested_moves_child_first"),
     SVN_TEST_OPTS_PASS(nested_moves_child_last,
                        "nested_moves_child_last"),
-    SVN_TEST_OPTS_XFAIL(move_in_copy,
+    SVN_TEST_OPTS_PASS(move_in_copy,
                        "move_in_copy"),
-    SVN_TEST_OPTS_XFAIL(move_in_replace,
+    SVN_TEST_OPTS_PASS(move_in_replace,
                        "move_in_replace"),
     SVN_TEST_OPTS_PASS(copy_a_move,
                        "copy_a_move"),
@@ -4550,9 +4589,9 @@ struct svn_test_descriptor_t test_funcs[
                        "move_to_swap"),
     SVN_TEST_OPTS_PASS(revert_nested_move,
                        "revert_nested_move"),
-    SVN_TEST_OPTS_XFAIL(move_on_move,
+    SVN_TEST_OPTS_PASS(move_on_move,
                        "move_on_move"),
-    SVN_TEST_OPTS_XFAIL(move_on_move2,
+    SVN_TEST_OPTS_PASS(move_on_move2,
                        "move_on_move2"),
     SVN_TEST_OPTS_XFAIL(move_added,
                        "move_added"),

Modified: subversion/branches/inheritable-props/tools/dev/merge-graph.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/dev/merge-graph.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/dev/merge-graph.py (original)
+++ subversion/branches/inheritable-props/tools/dev/merge-graph.py Thu Mar 15 21:40:15 2012
@@ -37,7 +37,7 @@ if __name__ == '__main__':
 
   for config_filename in sys.argv[1:]:
     print prog_name + ": reading '" + config_filename + "',",
-    graph = MergeDot(config_filename, rankdir='LR')
+    graph = MergeDot(config_filename, rankdir='LR', dpi='72')
     print "writing '" + graph.filename + "'"
     graph.write_png(graph.filename)
 

Modified: subversion/branches/inheritable-props/tools/dev/mergegraph/mergegraph.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/dev/mergegraph/mergegraph.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/dev/mergegraph/mergegraph.py (original)
+++ subversion/branches/inheritable-props/tools/dev/mergegraph/mergegraph.py Thu Mar 15 21:40:15 2012
@@ -136,7 +136,7 @@ class MergeGraph(pydot.Graph):
              label='"' + label + '"',
              color=color, fontcolor=color,
              style='bold')
-    if kind == 'cherry':
+    if kind.startswith('cherry'):
       e.set_style('dashed')
     graph.add_edge(e)
 
@@ -158,7 +158,7 @@ class MergeGraph(pydot.Graph):
     """Add a merge"""
     base_node, src_node, tgt_node, kind = merge
 
-    if base_node and src_node:  # and kind != 'cherry':
+    if base_node and src_node:  # and not kind.startwith('cherry'):
       graph.mk_mergeinfo_edge(base_node, src_node, important)
 
     # Merge target node

Modified: subversion/branches/inheritable-props/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/dist/release.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/dist/release.py (original)
+++ subversion/branches/inheritable-props/tools/dist/release.py Thu Mar 15 21:40:15 2012
@@ -485,8 +485,6 @@ def post_candidates(args):
 def clean_dist(args):
     'Clean the distribution directory of all but the most recent artifacts.'
 
-    regex = re.compile('subversion-(\d+).(\d+).(\d+)(?:-(?:(rc|alpha|beta)(\d+)))?')
-
     if not args.dist_dir:
         assert_people()
         args.dist_dir = people_dist_dir
@@ -556,7 +554,7 @@ def write_news(args):
     template.generate(sys.stdout, data)
 
 
-def get_sha1info(args):
+def get_sha1info(args, replace=False):
     'Return a list of sha1 info for the release'
     sha1s = glob.glob(os.path.join(get_deploydir(args.base_dir), '*.sha1'))
 
@@ -566,7 +564,13 @@ def get_sha1info(args):
     sha1info = []
     for s in sha1s:
         i = info()
-        i.filename = os.path.basename(s)[:-5]
+        # strip ".sha1"
+        fname = os.path.basename(s)[:-5]
+        if replace:
+            # replace the version number with the [version] reference
+            i.filename = Version.regex.sub('[version]', fname)
+        else:
+            i.filename = fname
         i.sha1 = open(s, 'r').read()
         sha1info.append(i)
 
@@ -596,7 +600,7 @@ def write_announcement(args):
 
 def write_downloads(args):
     'Output the download section of the website.'
-    sha1info = get_sha1info(args)
+    sha1info = get_sha1info(args, replace=True)
 
     data = { 'version'              : str(args.version),
              'fileinfo'             : sha1info,
@@ -630,7 +634,8 @@ def check_sigs(args):
 
     good_sigs = {}
 
-    for filename in glob.glob(os.path.join(target, 'subversion-*.asc')):
+    glob_pattern = os.path.join(target, 'subversion-%s*.asc' % args.version)
+    for filename in glob.glob(glob_pattern):
         text = open(filename).read()
         keys = text.split(key_start)
 

Modified: subversion/branches/inheritable-props/tools/server-side/svnpubsub/README.txt
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/server-side/svnpubsub/README.txt?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/server-side/svnpubsub/README.txt (original)
+++ subversion/branches/inheritable-props/tools/server-side/svnpubsub/README.txt Thu Mar 15 21:40:15 2012
@@ -1 +1,16 @@
 ### write a README
+
+
+TODO:
+- bulk update at startup time to avoid backlog warnings
+- switch to host:port format in config file
+- fold BDEC into Daemon
+- fold WorkingCopy._get_match() into __init__
+- remove wc_ready(). assume all WorkingCopy instances are usable.
+  place the instances into .watch at creation. the .update_applies()
+  just returns if the wc is disabled (eg. could not find wc dir)
+- figure out way to avoid the ASF-specific PRODUCTION_RE_FILTER
+  (a base path exclusion list should work for the ASF)
+- add support for SIGHUP to reread the config and reinitialize working copies
+- joes will write documentation for svnpubsub as these items become fulfilled
+- make LOGLEVEL configurable

Modified: subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub (original)
+++ subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub Thu Mar 15 21:40:15 2012
@@ -18,22 +18,21 @@ load_rc_config $name
 svnwcsub_enable=${svnwcsub_enable-"NO"}
 svnwcsub_user=${svnwcsub_user-"svnwc"}
 svnwcsub_group=${svnwcsub_group-"svnwc"}
-svnwcsub_reactor=${svnwcsub_reactor-"poll"}
 svnwcsub_pidfile=${svnwcsub_pidfile-"/var/run/svnwcsub/svnwcsub.pub"}
-svnwcsub_program=${svnwcsub_program-"/usr/local/bin/twistd"}
 svnwcsub_env="PYTHON_EGG_CACHE"
 svnwcsub_cmd_int=${svnwcsub_cmd_int-"python"}
+svnwcsub_config=${svnwcsub_config-"/etc/svnwcsub.conf"}
+svnwcsub_logfile=${svnwcsub_logfile-"/var/log/svnwcsub/svnwcsub.log"}
 pidfile="${svnwcsub_pidfile}"
 
 export PYTHON_EGG_CACHE="/var/run/svnwcsub"
 
-command="/usr/local/bin/twistd"
+command="/usr/local/svnpubsub/svnwcsub.py"
 command_interpreter="/usr/local/bin/${svnwcsub_cmd_int}"
-command_args="-y /usr/local/svnpubsub/svnwcsub.tac \
-            --logfile=/var/log/svnwcsub.log \
-            --pidfile=${pidfile} \
-            --uid=${svnwcsub_user} --gid=${svnwcsub_group} \
-            --umask=002 -r${svnwcsub_reactor}"
+command_args="--daemon \
+              --logfile=${svnwcsub_logfile} \
+              --pidfile=${pidfile} \
+              --uid=${svnwcsub_user} --gid=${svnwcsub_group} \
+              --umask=002 ${svnwcsub_config}"
 
 run_rc_command "$1"
-

Modified: subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub.debian
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub.debian?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub.debian (original)
+++ subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub.debian Thu Mar 15 21:40:15 2012
@@ -14,21 +14,23 @@
 
 svnwcsub_user=${svnwcsub_user-"svnwc"}
 svnwcsub_group=${svnwcsub_group-"svnwc"}
-svnwcsub_reactor=${svnwcsub_reactor-"poll"}
 svnwcsub_pidfile=${svnwcsub_pidfile-"/var/run/svnwcsub.pid"}
+svnwcsub_config=${svnwcsub_config-"/etc/svnwcsub.conf"}
+svnwcsub_logfile=${svnwcsub_logfile-"/var/bwlog/svnwcsub/svnwcsub.log"}
 pidfile="${svnwcsub_pidfile}"
 
-TWSITD_CMD="/usr/bin/twistd -y /opt/svnpubsub/svnwcsub.tac \
-            --logfile=/var/bwlog/svnpubsub/svnwcsub.log \
-            --pidfile=${pidfile} \
-            --uid=${svnwcsub_user} --gid=${svnwcsub_group} \
-            -r${svnwcsub_reactor}"
+SVNWCSUB_CMD="/opt/svnpubsub/svnwcsub.py \
+              --daemon \
+              --logfile=${svnwcsub_logfile} \
+              --pidfile=${pidfile} \
+              --uid=${svnwcsub_user} --gid=${svnwcsub_group} \
+              ${svnwcsub_config} "
 
 RETVAL=0
  
 start() {
     echo "Starting SvnWcSub Server: "
-    $TWSITD_CMD
+    $SVNWCSUB_CMD
     RETVAL=$?
     [ $RETVAL -eq 0 ] && echo "ok" || echo "failed"
     return $RETVAL

Modified: subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris (original)
+++ subversion/branches/inheritable-props/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris Thu Mar 15 21:40:15 2012
@@ -5,22 +5,24 @@
 
 svnwcsub_user=${svnwcsub_user-"svnwc"}
 svnwcsub_group=${svnwcsub_group-"other"}
-svnwcsub_reactor=${svnwcsub_reactor-"poll"}
 svnwcsub_pidfile=${svnwcsub_pidfile-"/var/run/svnwcsub/svnwcsub.pid"}
+svnwcsub_config=${svnwcsub_config-"/etc/svnwcsub.conf"}
+svnwcsub_logfile=${svnwcsub_logfile-"/x1/log/svnwcsub/svnwcsub.log"}
 pidfile="${svnwcsub_pidfile}"
 
-TWSITD_CMD="/opt/python/2.6.2/bin/twistd -y /usr/local/svnpubsub/svnwcsub.tac \
-            --logfile=/x1/log/svnwcsub.log \
-            --pidfile=${pidfile} \
-            --umask=002 \
-            --uid=${svnwcsub_user} --gid=${svnwcsub_group} \
-            -r${svnwcsub_reactor}"
+SVNWCSUB_CMD="/usr/local/svnpubsub/svnwcsub.py \
+              --daemon \
+              --logfile=${svnwcsub_logfile} \
+              --pidfile=${pidfile} \
+              --umask=002 \
+              --uid=${svnwcsub_user} --gid=${svnwcsub_group} \
+              ${svnwcsub_config}"
 
 RETVAL=0
  
 start() {
     echo "Starting SvnWcSub Server: "
-    $TWSITD_CMD
+    $SVNWCSUB_CMD
     RETVAL=$?
     [ $RETVAL -eq 0 ] && echo "ok" || echo "failed"
     return $RETVAL

Modified: subversion/branches/inheritable-props/tools/server-side/svnpubsub/svnpubsub/client.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/server-side/svnpubsub/svnpubsub/client.py?rev=1301216&r1=1301215&r2=1301216&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/server-side/svnpubsub/svnpubsub/client.py (original)
+++ subversion/branches/inheritable-props/tools/server-side/svnpubsub/svnpubsub/client.py Thu Mar 15 21:40:15 2012
@@ -74,7 +74,12 @@ class Client(asynchat.async_chat):
     self.skipping_headers = True
 
     self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
-    self.connect((host, port))
+    try:
+      self.connect((host, port))
+    except:
+      self.handle_error()
+      return
+        
     ### should we allow for repository restrictions?
     self.push('GET /commits/xml HTTP/1.0\r\n\r\n')
 
@@ -117,7 +122,7 @@ class XMLStreamHandler(xml.sax.handler.C
 
   def startElement(self, name, attrs):
     if name == 'commit':
-      self.rev = Revision(attrs['repository'], attrs['revision'])
+      self.rev = Revision(attrs['repository'], int(attrs['revision']))
     # No other elements to worry about.
 
   def characters(self, data):



Mime
View raw message