You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/08/11 18:43:31 UTC

svn commit: r984468 [21/25] - in /subversion/branches/ignore-mergeinfo: ./ build/ build/generator/ build/generator/templates/ notes/ notes/tree-conflicts/ notes/wc-ng/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subvers...

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/checkout_tests.py?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/checkout_tests.py Wed Aug 11 16:43:22 2010
@@ -46,7 +46,7 @@ def test_stderr(re_string, stderr):
   for line in stderr:
     if exp_err_re.search(line):
       return
-  if svntest.main.verbose_mode:
+  if svntest.main.options.verbose:
     for x in stderr:
       sys.stdout.write(x)
     print("Expected stderr reg-ex: '" + re_string + "'")
@@ -151,13 +151,88 @@ def make_local_tree(sbox, mod_files=Fals
 #----------------------------------------------------------------------
 
 def checkout_with_obstructions(sbox):
-  """co with obstructions should fail without --force"""
+  """co with obstructions conflicts without --force"""
 
   make_local_tree(sbox, False, False)
 
-  svntest.actions.run_and_verify_svn("No error where some expected",
-                                     None, svntest.verify.AnyOutput,
-                                     "co", sbox.repo_url, sbox.wc_dir)
+  #svntest.factory.make(sbox,
+  #       """# Checkout with unversioned obstructions lying around.
+  #          svn co url wc_dir
+  #          svn status""")
+  #svntest.factory.make(sbox,
+  #       """# Now see to it that we can recover from the obstructions.
+  #          rm -rf A iota
+  #          svn up""")
+  #exit(0)
+
+  wc_dir = sbox.wc_dir
+  url = sbox.repo_url
+
+  # Checkout with unversioned obstructions causes tree conflicts.
+  # svn co url wc_dir
+  expected_output = svntest.wc.State(wc_dir, {
+    'iota'              : Item(status='  ', treeconflict='C'),
+    'A'                 : Item(status='  ', treeconflict='C'),
+  })
+
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F',
+    'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau',
+    'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi', 'A/D/gamma', 'A/C')
+
+  actions.run_and_verify_checkout2(False, url, wc_dir, expected_output,
+    expected_disk, None, None, None, None)
+
+  # svn status
+  expected_status = actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A', 'iota', status='? ', wc_rev=None,
+    treeconflict='C')
+  expected_status.tweak('A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau',
+    'A/D/H', 'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi', 'A/D/gamma', 'A/B',
+    'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F', 'A/B/lambda', 'A/C',
+    wc_rev=None)
+  expected_status.tweak('A/mu', status='? ', wc_rev=None)
+
+  actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+
+
+  # Now see to it that we can recover from the obstructions.
+  # rm -rf A iota
+  svntest.main.safe_rmtree( os.path.join(wc_dir, 'A') )
+  os.remove( os.path.join(wc_dir, 'iota') )
+
+  # svn up
+  expected_output = svntest.wc.State(wc_dir, {
+    'A'                 : Item(status='A '),
+    'A/D'               : Item(status='A '),
+    'A/D/gamma'         : Item(status='A '),
+    'A/D/G'             : Item(status='A '),
+    'A/D/G/rho'         : Item(status='A '),
+    'A/D/G/pi'          : Item(status='A '),
+    'A/D/G/tau'         : Item(status='A '),
+    'A/D/H'             : Item(status='A '),
+    'A/D/H/chi'         : Item(status='A '),
+    'A/D/H/omega'       : Item(status='A '),
+    'A/D/H/psi'         : Item(status='A '),
+    'A/B'               : Item(status='A '),
+    'A/B/E'             : Item(status='A '),
+    'A/B/E/beta'        : Item(status='A '),
+    'A/B/E/alpha'       : Item(status='A '),
+    'A/B/F'             : Item(status='A '),
+    'A/B/lambda'        : Item(status='A '),
+    'A/C'               : Item(status='A '),
+    'A/mu'              : Item(status='A '),
+    'iota'              : Item(status='A '),
+  })
+
+  expected_disk = svntest.main.greek_state.copy()
+
+  expected_status = actions.get_virginal_state(wc_dir, 1)
+
+  actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
+    expected_status, None, None, None, None, None, False, wc_dir)
+
+
 
 #----------------------------------------------------------------------
 
@@ -209,23 +284,83 @@ def forced_checkout_of_file_with_dir_obs
 #----------------------------------------------------------------------
 
 def forced_checkout_of_dir_with_file_obstructions(sbox):
-  """forced co fails if a file obstructs a dir"""
+  """forced co flags conflict if a file obstructs a dir"""
 
   make_local_tree(sbox, False, False)
 
-  # Make the "other" working copy
-  other_wc = sbox.add_wc_path('other')
-  os.mkdir(other_wc)
-  svntest.main.file_append(os.path.join(other_wc, "A"), "The file A")
+  #svntest.factory.make(sbox,"""
+  #          mkdir wc_dir_other
+  #          echo "The file A" > wc_dir_other/A
+  #          svn co --force url wc_dir_other
+  #          """)
+  #svntest.factory.make(sbox,"""
+  #          # Now see to it that we can recover from the obstructions.
+  #          rm wc_dir_other/A
+  #          svn up wc_dir_other""")
+  #exit(0)
 
-  # Checkout the standard greek repos into a directory that has a file named
-  # "A" obstructing the dir "A" in the repos.  This should fail.
-  exit_code, sout, serr = svntest.actions.run_and_verify_svn(
-    "Expected error during co", None, svntest.verify.AnyOutput,
-    "co", "--force", sbox.repo_url, other_wc)
+  url = sbox.repo_url
+  wc_dir_other = sbox.add_wc_path('other')
+
+  other_A = os.path.join(wc_dir_other, 'A')
+
+  # mkdir wc_dir_other
+  os.makedirs(wc_dir_other)
+
+  # echo "The file A" > wc_dir_other/A
+  svntest.main.file_write(other_A, 'The file A\n')
+
+  # svn co --force url wc_dir_other
+  expected_output = svntest.wc.State(wc_dir_other, {
+    'iota'              : Item(status='A '),
+    'A'                 : Item(status='  ', treeconflict='C'),
+  })
+
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F',
+    'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau',
+    'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi', 'A/D/gamma', 'A/mu',
+    'A/C')
+  expected_disk.tweak('A', contents='The file A\n')
+
+  actions.run_and_verify_checkout(url, wc_dir_other, expected_output,
+    expected_disk, None, None, None, None, '--force')
+
+
+  # Now see to it that we can recover from the obstructions.
+  # rm wc_dir_other/A
+  os.remove(other_A)
+
+  # svn up wc_dir_other
+  expected_output = svntest.wc.State(wc_dir_other, {
+    'A'                 : Item(status='A '),
+    'A/mu'              : Item(status='A '),
+    'A/D'               : Item(status='A '),
+    'A/D/G'             : Item(status='A '),
+    'A/D/G/tau'         : Item(status='A '),
+    'A/D/G/pi'          : Item(status='A '),
+    'A/D/G/rho'         : Item(status='A '),
+    'A/D/H'             : Item(status='A '),
+    'A/D/H/psi'         : Item(status='A '),
+    'A/D/H/omega'       : Item(status='A '),
+    'A/D/H/chi'         : Item(status='A '),
+    'A/D/gamma'         : Item(status='A '),
+    'A/C'               : Item(status='A '),
+    'A/B'               : Item(status='A '),
+    'A/B/E'             : Item(status='A '),
+    'A/B/E/beta'        : Item(status='A '),
+    'A/B/E/alpha'       : Item(status='A '),
+    'A/B/F'             : Item(status='A '),
+    'A/B/lambda'        : Item(status='A '),
+  })
+
+  expected_disk = svntest.main.greek_state.copy()
+
+  expected_status = actions.get_virginal_state(wc_dir_other, 1)
+
+  actions.run_and_verify_update(wc_dir_other, expected_output, expected_disk,
+    expected_status, None, None, None, None, None, False, wc_dir_other)
 
-  test_stderr(".*Failed to add directory.*a non-directory object of the " \
-              "same name already exists", serr)
 
 #----------------------------------------------------------------------
 

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/commit_tests.py?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/commit_tests.py Wed Aug 11 16:43:22 2010
@@ -86,11 +86,15 @@ def make_standard_slew_of_changes(wc_dir
   svntest.main.run_svn(None, 'add', 'Q')
 
   # Remove two directories
-  svntest.main.run_svn(None, 'rm', os.path.join('A', 'B', 'E'))
+  A_B_E = os.path.join('A', 'B', 'E')
+  svntest.main.run_svn(None, 'rm', A_B_E)
   svntest.main.run_svn(None, 'rm', os.path.join('A', 'C'))
 
   # Replace one of the removed directories
-  svntest.main.run_svn(None, 'add', os.path.join('A', 'B', 'E'))
+  # But first recreate if it doesn't exist (single-db)
+  if not os.path.exists(A_B_E):
+    os.mkdir(A_B_E)
+  svntest.main.run_svn(None, 'add', A_B_E)
 
   # Make property mods to two directories
   svntest.main.run_svn(None, 'propset', 'foo', 'bar', os.curdir)
@@ -452,16 +456,21 @@ def nested_dir_replacements(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
+  A_D = os.path.join(wc_dir, 'A', 'D')
+
   # Delete and re-add A/D (a replacement), and A/D/H (another replace).
-  svntest.main.run_svn(None, 'rm', os.path.join(wc_dir, 'A', 'D'))
-  svntest.main.run_svn(None, 'add', '--depth=empty',
-                       os.path.join(wc_dir, 'A', 'D'))
-  svntest.main.run_svn(None, 'add', '--depth=empty',
-                       os.path.join(wc_dir, 'A', 'D', 'H'))
+  svntest.main.run_svn(None, 'rm', A_D)
+
+  # Recreate directories for single-db
+  if not os.path.exists(A_D):
+    os.mkdir(A_D)
+    os.mkdir(os.path.join(A_D, 'H'))
+  svntest.main.run_svn(None, 'add', '--depth=empty', A_D)
+  svntest.main.run_svn(None, 'add', '--depth=empty', os.path.join(A_D, 'H'))
 
   # For kicks, add new file A/D/bloo.
-  svntest.main.file_append(os.path.join(wc_dir, 'A', 'D', 'bloo'), "hi")
-  svntest.main.run_svn(None, 'add', os.path.join(wc_dir, 'A', 'D', 'bloo'))
+  svntest.main.file_append(os.path.join(A_D, 'bloo'), "hi")
+  svntest.main.run_svn(None, 'add', os.path.join(A_D, 'bloo'))
 
   # Verify pre-commit status:
   #
@@ -1497,8 +1506,10 @@ def commit_multiple_wc_multiple_repos(sb
 
   # Commit should fail, since WCs come from different repositories.
   # The exact error message depends on whether or not the tests are
-  # run below a 1.7 working copy
-  error_re = ".*(is not a|Are all targets part of the same) working copy.*"
+  # run below an existing working copy
+  error_re = ( ".*(is not a working copy" +
+                 "|Are all targets part of the same working copy" +
+                 "|was not found).*" )
   svntest.actions.run_and_verify_svn("Expected output on stderr doesn't match",
                                      [], error_re,
                                      'commit', '-m', 'log',
@@ -1946,6 +1957,9 @@ def mods_in_schedule_delete(sbox):
   C_path = os.path.join(wc_dir, 'A', 'C')
   svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
                                      'rm', C_path)
+
+  if not os.path.exists(C_path):
+    os.mkdir(C_path)
   foo_path = os.path.join(C_path, 'foo')
   foo_contents = 'zig\nzag\n'
   svntest.main.file_append(foo_path, foo_contents)
@@ -2659,15 +2673,16 @@ def start_commit_detect_capabilities(sbo
 def commit_url(sbox):
   "'svn commit SOME_URL' should error"
   sbox.build()
-  wc_dir = sbox.wc_dir
-  repos_url = sbox.repo_url
+  url = sbox.repo_url
 
   # Commit directly to a URL
+  expected_error = ("svn: '" + url + 
+                    "' is a URL, but URLs cannot be commit targets")
   svntest.actions.run_and_verify_commit(None,
                                         None,
                                         None,
-                                        "Must give local path",
-                                        repos_url)
+                                        expected_error,
+                                        url)
 
 # Test for issue #3198
 def commit_added_missing(sbox):

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/copy_tests.py?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/copy_tests.py Wed Aug 11 16:43:22 2010
@@ -36,6 +36,7 @@ from svntest.main import SVN_PROP_MERGEI
 Skip = svntest.testcase.Skip
 SkipUnless = svntest.testcase.SkipUnless
 XFail = svntest.testcase.XFail
+Wimp = svntest.testcase.Wimp
 Item = svntest.wc.StateItem
 
 
@@ -2460,16 +2461,18 @@ def move_dir_back_and_forth(sbox):
 
   # Move the moved dir: D_moved back to its starting
   # location at A/D.
-  exit_code, out, err = svntest.actions.run_and_verify_svn(
-    None, None, svntest.verify.AnyOutput,
-    'mv', D_move_path, D_path)
 
-  for line in err:
-    if re.match('.*Cannot copy to .*as it is scheduled for deletion',
-                line, ):
-      return
-  raise svntest.Failure("mv failed but not in the expected way")
+  if svntest.main.wc_is_singledb(wc_dir):
+    # In single-db target is gone on-disk after it was moved away, so this
+    # move works ok
+    expected_err = []
+  else:
+    # In !SINGLE_DB the target of the copy exists on-dir, so svn tries
+    # to move the file below the deleted directory
+    expected_err = '.*Cannot copy to .*as it is scheduled for deletion'
 
+  svntest.actions.run_and_verify_svn(None, None, expected_err,
+                                     'mv', D_move_path, D_path)
 
 def copy_move_added_paths(sbox):
   "copy and move added paths without commits"
@@ -4249,8 +4252,6 @@ def copy_below_copy(sbox):
 def move_below_move(sbox):
   "move a dir below a moved dir"
   sbox.build()
-  "copy a dir below a copied dir"
-  sbox.build()
 
   A = os.path.join(sbox.wc_dir, 'A')
   new_A = os.path.join(sbox.wc_dir, 'new_A')
@@ -4260,16 +4261,17 @@ def move_below_move(sbox):
   new_A_new_mu = os.path.join(new_A, 'new_mu')
 
   svntest.actions.run_and_verify_svn(None, None, [],
-                                     'cp', A, new_A)
+                                     'mv', A, new_A)
 
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'mv', new_A_D, new_A_new_D)
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'mv', new_A_mu, new_A_new_mu)
 
-  # ### It could be that we miss a Deleting here.
   expected_output = svntest.wc.State(sbox.wc_dir, {
       'A'                 : Item(verb='Deleting'),
+      'new_A/D'           : Item(verb='Deleting'),
+      'new_A/mu'          : Item(verb='Deleting'),
       'new_A'             : Item(verb='Adding'),
       'new_A/new_D'       : Item(verb='Adding'),
       'new_A/new_mu'      : Item(verb='Adding'),
@@ -4298,8 +4300,6 @@ def move_below_move(sbox):
       'new_A/C'           : Item(status='  ', wc_rev='2'),
     })
 
-  # ### This remove block is untested, because the commit fails with an
-  # ### assertion on trunk (BH: 2009-11-01
   expected_status.remove('A', 'A/D', 'A/D/gamma', 'A/D/G', 'A/D/G/pi',
                          'A/D/G/rho', 'A/D/G/tau', 'A/D/H', 'A/D/H/chi',
                          'A/D/H/omega', 'A/D/H/psi', 'A/B', 'A/B/E',
@@ -4494,6 +4494,346 @@ def copy_broken_symlink(sbox):
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
 
+def move_dir_containing_move(sbox):
+  """move a directory containing moved node"""
+
+  sbox.build()
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B/E/alpha'),
+                                     sbox.ospath('A/B/E/alpha_moved'))
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B/F'),
+                                     sbox.ospath('A/B/F_moved'))
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B'),
+                                     sbox.ospath('A/B_tmp'))
+
+  expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+  expected_status.tweak('A/B',
+                        'A/B/E',
+                        'A/B/E/alpha',
+                        'A/B/E/beta',
+                        'A/B/F',
+                        'A/B/lambda',
+                        status='D ')
+  expected_status.add({
+      'A/B_tmp'               : Item(status='A ', copied='+', wc_rev='-'),
+      # alpha has a revision that isn't reported by status.
+      'A/B_tmp/E'             : Item(status='  ', copied='+', wc_rev='-'),
+      'A/B_tmp/E/alpha'       : Item(status='D ', wc_rev='?', entry_rev='1'),
+      'A/B_tmp/E/alpha_moved' : Item(status='A ', copied='+', wc_rev='-'),
+      'A/B_tmp/E/beta'        : Item(status='  ', copied='+', wc_rev='-'),
+      'A/B_tmp/F'             : Item(status='D ', wc_rev='?'),
+      'A/B_tmp/F_moved'       : Item(status='A ', copied='+', wc_rev='-'),
+      'A/B_tmp/lambda'        : Item(status='  ', copied='+', wc_rev='-'),
+    })
+
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B_tmp'),
+                                     sbox.ospath('A/B_moved'))
+  expected_status.remove('A/B_tmp',
+                         'A/B_tmp/E',
+                         'A/B_tmp/E/alpha',
+                         'A/B_tmp/E/alpha_moved',
+                         'A/B_tmp/E/beta',
+                         'A/B_tmp/F',
+                         'A/B_tmp/F_moved',
+                         'A/B_tmp/lambda')
+  expected_status.add({
+      'A/B_moved'               : Item(status='A ', copied='+', wc_rev='-'),
+      # alpha has a revision that isn't reported by status.
+      'A/B_moved/E'             : Item(status='  ', copied='+', wc_rev='-'),
+      'A/B_moved/E/alpha'       : Item(status='D ', wc_rev='?', entry_rev='1'),
+      'A/B_moved/E/alpha_moved' : Item(status='A ', copied='+', wc_rev='-'),
+      'A/B_moved/E/beta'        : Item(status='  ', copied='+', wc_rev='-'),
+      'A/B_moved/F'             : Item(status='D ', wc_rev='?'),
+      'A/B_moved/F_moved'       : Item(status='A ', copied='+', wc_rev='-'),
+      'A/B_moved/lambda'        : Item(status='  ', copied='+', wc_rev='-'),
+    })
+
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+  expected_output = svntest.wc.State(sbox.wc_dir, {
+    'A/B'                    : Item(verb='Deleting'),
+    'A/B_moved'              : Item(verb='Adding'),
+    'A/B_moved/E/alpha'      : Item(verb='Deleting'),
+    'A/B_moved/E/alpha_moved': Item(verb='Adding'),
+    'A/B_moved/F'            : Item(verb='Deleting'),
+    'A/B_moved/F_moved'      : Item(verb='Adding'),
+    })
+
+  expected_status.tweak('A/B_moved',
+                        'A/B_moved/E',
+                        'A/B_moved/E/alpha_moved',
+                        'A/B_moved/E/beta',
+                        'A/B_moved/F_moved',
+                        'A/B_moved/lambda',
+                        status='  ', copied=None, wc_rev='2')
+  expected_status.remove('A/B',
+                         'A/B/E',
+                         'A/B/E/alpha',
+                         'A/B/E/beta',
+                         'A/B/F',
+                         'A/B/lambda',
+                         'A/B_moved/E/alpha',
+                         'A/B_moved/F')
+  svntest.actions.run_and_verify_commit(sbox.wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None, sbox.wc_dir)
+
+def copy_dir_with_space(sbox):
+  """copy a directory with whitespace to one without"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+                                     os.path.join(wc_dir, 'A', 'B', 'E'),
+                                     os.path.join(wc_dir, 'E with spaces'))
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+                                     os.path.join(wc_dir, 'A', 'B', 'E', 'alpha'),
+                                     os.path.join(wc_dir, 'E with spaces', 'al pha'))
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_output = svntest.wc.State(wc_dir, {
+    'E with spaces'        : Item(verb='Adding'),
+    'E with spaces/al pha' : Item(verb='Adding'),
+    })
+  expected_status.add({
+    'E with spaces'        : Item(status='  ', wc_rev='2'),
+    'E with spaces/alpha'  : Item(status='  ', wc_rev='2'),
+    'E with spaces/beta'   : Item(status='  ', wc_rev='2'),
+    'E with spaces/al pha' : Item(status='  ', wc_rev='2'),
+    })
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None, wc_dir)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+                                     os.path.join(wc_dir, 'E with spaces'),
+                                     os.path.join(wc_dir, 'E also spaces')
+                                     )
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+                                     os.path.join(wc_dir, 'E with spaces/al pha'),
+                                     os.path.join(wc_dir, 'E also spaces/al b')
+                                     )
+
+  expected_output = svntest.wc.State(wc_dir, {
+      'E also spaces'     : Item(verb='Adding'),
+      'E also spaces/al b': Item(verb='Adding'),
+    })
+  expected_status.add({
+      'E also spaces'     : Item(status='  ', wc_rev='3'),
+      'E also spaces/beta': Item(status='  ', wc_rev='3'),
+      'E also spaces/al b': Item(status='  ', wc_rev='3'),
+      'E also spaces/alpha': Item(status='  ', wc_rev='3'),
+      'E also spaces/al pha': Item(status='  ', wc_rev='3'),
+    })
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None, wc_dir)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     os.path.join(wc_dir, 'E with spaces'),
+                                     os.path.join(wc_dir, 'E new spaces')
+                                     )
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     os.path.join(wc_dir, 'E new spaces/al pha'),
+                                     os.path.join(wc_dir, 'E also spaces/al c')
+                                     )
+
+  expected_output = svntest.wc.State(wc_dir, {
+      'E with spaces'     : Item(verb='Deleting'),
+      'E also spaces/al c': Item(verb='Adding'),
+      'E new spaces'      : Item(verb='Adding'),
+      'E new spaces/al pha': Item(verb='Deleting'),
+  })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+      'E also spaces'     : Item(status='  ', wc_rev='3'),
+      'E also spaces/beta': Item(status='  ', wc_rev='3'),
+      'E also spaces/al b': Item(status='  ', wc_rev='3'),
+      'E also spaces/al c': Item(status='  ', wc_rev='4'),
+      'E also spaces/alpha': Item(status='  ', wc_rev='3'),
+      'E also spaces/al pha': Item(status='  ', wc_rev='3'),
+      'E new spaces'      : Item(status='  ', wc_rev='4'),
+      'E new spaces/alpha': Item(status='  ', wc_rev='4'),
+      'E new spaces/beta' : Item(status='  ', wc_rev='4'),
+  })
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None, wc_dir)
+
+# Regression test for issue #3676
+def changed_data_should_match_checkout(sbox):
+  """changed data after commit should match checkout"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  A_B_E = os.path.join(wc_dir, 'A', 'B', 'E')
+  E_new = os.path.join(wc_dir, 'E_new')
+
+  verify_dir = sbox.add_wc_path('verify')
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B_E, E_new)
+
+  sbox.simple_commit(wc_dir)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'co', sbox.repo_url, verify_dir)
+
+  was_cwd = os.getcwd()
+  os.chdir(verify_dir)
+
+  rv, verify_out, err = main.run_svn(None, 'status', '-v')
+
+  os.chdir(was_cwd)
+  os.chdir(wc_dir)
+  svntest.actions.run_and_verify_svn(None, verify_out, [], 'status', '-v')
+  os.chdir(was_cwd)
+
+# Regression test for issue #3676 for copies including directories
+def changed_dir_data_should_match_checkout(sbox):
+  """changed dir after commit should match checkout"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  A_B = os.path.join(wc_dir, 'A', 'B')
+  B_new = os.path.join(wc_dir, 'B_new')
+
+  verify_dir = sbox.add_wc_path('verify')
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B, B_new)
+
+  sbox.simple_commit(wc_dir)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'co', sbox.repo_url, verify_dir)
+
+  was_cwd = os.getcwd()
+  os.chdir(verify_dir)
+
+  rv, verify_out, err = main.run_svn(None, 'status', '-v')
+
+  os.chdir(was_cwd)
+  os.chdir(wc_dir)
+  svntest.actions.run_and_verify_svn(None, verify_out, [], 'status', '-v')
+  os.chdir(was_cwd)
+
+def move_added_nodes(sbox):
+  """move added nodes"""
+
+  sbox.build()
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir',
+                                     sbox.ospath('X'),
+                                     sbox.ospath('X/Y'))
+
+  expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+  expected_status.add({
+      'X'   : Item(status='A ', wc_rev='0'),
+      'X/Y' : Item(status='A ', wc_rev='0'),
+      })
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('X/Y'),
+                                     sbox.ospath('X/Z'))
+  expected_status.remove('X/Y')
+  expected_status.add({'X/Z' : Item(status='A ', wc_rev='0')})
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('X/Z'),
+                                     sbox.ospath('Z'))
+  expected_status.remove('X/Z')
+  expected_status.add({'Z' : Item(status='A ', wc_rev='0')})
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('Z'),
+                                     sbox.ospath('X/Z'))
+  expected_status.remove('Z')
+  expected_status.add({'X/Z' : Item(status='A ', wc_rev='0')})
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+def locate_wrong_origin(sbox):
+  "update editor locates invalid file source"
+
+  sbox.build()
+
+  iota = os.path.join(sbox.wc_dir, 'iota')
+  gamma = os.path.join(sbox.wc_dir, 'A/D/gamma')
+
+  D1 = os.path.join(sbox.wc_dir, 'D1')
+  D2 = os.path.join(sbox.wc_dir, 'D2')
+
+  main.run_svn(None, 'mkdir', D1, D2)
+  main.run_svn(None, 'cp', iota, os.path.join(D1, 'iota'))
+  main.run_svn(None, 'cp', gamma, os.path.join(D2, 'iota'))
+
+  main.run_svn(None, 'ci', sbox.wc_dir, '-m', 'Add 2*iotas in r2')
+  main.run_svn(None, 'rm', D1)
+
+  main.run_svn(None, 'ci', sbox.wc_dir, '-m', 'Why?')
+
+  main.run_svn(None, 'cp', D2, D1)
+  main.run_svn(None, 'ci', sbox.wc_dir, '-m', 'Replace one iota')
+
+  # <= 1.6 needs a new checkout here to reproduce, but not since r961831.
+  # so we just perform an update
+  main.run_svn(None, 'up', sbox.wc_dir)
+
+  main.run_svn(None, 'cp', sbox.repo_url + '/D1/iota@2',
+               sbox.repo_url + '/iobeta', '-m', 'Copy iota')
+
+
+  expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 4)
+  expected_status.add({
+    'D1'                : Item(status='  ', wc_rev='4'),
+    'D1/iota'           : Item(status='  ', wc_rev='4'),
+    'D2'                : Item(status='  ', wc_rev='4'),
+    'D2/iota'           : Item(status='  ', wc_rev='4'),
+  })
+  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+  # The next update receives an add_file('/D1/iota', 2), which it then tries
+  # to locate in the local working copy. It finds a '/D1/iota' in the expected
+  # place, with a last-changed revision of 2 and a local revision of HEAD-1
+  #
+  # locate_copyfrom identifies this file as correct because 
+  #     * last-mod <= 2 and
+  #     * 2 <= REV
+  #
+  # Luckily close_file() receives an expected_checksum which makes us fail, or
+  # we would have a completely broken working copy
+
+  # So this gives a Checksum mismatch error.
+  main.run_svn(None, 'up', sbox.wc_dir)
+
+# This test currently fails, but should work ok once we move to single DB
+def copy_over_deleted_dir(sbox):
+  "copy a directory over a deleted directory"
+  sbox.build(read_only = True)
+
+  main.run_svn(None, 'rm', os.path.join(sbox.wc_dir, 'A/B'))
+  main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/D'),
+               os.path.join(sbox.wc_dir, 'A/B'))
+
+
 ########################################################################
 # Run the tests
 
@@ -4568,7 +4908,7 @@ test_list = [ None,
               copy_make_parents_wc_repo,
               copy_make_parents_repo_repo,
               URI_encoded_repos_to_wc,
-              XFail(allow_unversioned_parent_for_copy_src),
+              Wimp('Needs single db', allow_unversioned_parent_for_copy_src),
               replaced_local_source_for_incoming_copy,
               unneeded_parents,
               double_parents_with_url,
@@ -4578,11 +4918,20 @@ test_list = [ None,
               path_copy_in_repo_2475,
               commit_copy_depth_empty,
               copy_below_copy,
-              XFail(move_below_move),
+              move_below_move,
               reverse_merge_move,
               XFail(nonrecursive_commit_of_copy),
               copy_added_dir_with_copy,
               SkipUnless(copy_broken_symlink, svntest.main.is_posix_os),
+              move_dir_containing_move,
+              copy_dir_with_space,
+              changed_data_should_match_checkout,
+              XFail(changed_dir_data_should_match_checkout),
+              Wimp('Needs single db', move_added_nodes),
+              # Serf needs a different testcase for this issue
+              XFail(Skip(locate_wrong_origin,
+                         svntest.main.is_ra_type_dav_serf)),
+              Wimp('Needs single db', copy_over_deleted_dir),
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/davautocheck.sh?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/davautocheck.sh Wed Aug 11 16:43:22 2010
@@ -210,6 +210,9 @@ LOAD_MOD_LOG_CONFIG=$(get_loadmodule_con
 LOAD_MOD_MIME=$(get_loadmodule_config mod_mime) \
   || fail "MIME module not found"
 
+LOAD_MOD_ALIAS=$(get_loadmodule_config mod_alias) \
+  || fail "ALIAS module not found"
+
 # needed for Auth*, Require, etc. directives
 LOAD_MOD_AUTH=$(get_loadmodule_config mod_auth) \
   || {
@@ -258,6 +261,7 @@ touch $HTTPD_MIME_TYPES
 cat > "$HTTPD_CFG" <<__EOF__
 $LOAD_MOD_LOG_CONFIG
 $LOAD_MOD_MIME
+$LOAD_MOD_ALIAS
 $LOAD_MOD_UNIXD
 $LOAD_MOD_DAV
 LoadModule          dav_svn_module "$MOD_DAV_SVN"
@@ -321,6 +325,8 @@ CustomLog           "$HTTPD_ROOT/ops" "%
   AuthUserFile      $HTTPD_USERS
   Require           valid-user
 </Location>
+RedirectMatch permanent ^/svn-test-work/repositories/REDIRECT-PERM-(.*)\$ /svn-test-work/repositories/\$1
+RedirectMatch           ^/svn-test-work/repositories/REDIRECT-TEMP-(.*)\$ /svn-test-work/repositories/\$1
 __EOF__
 
 START="$HTTPD -f $HTTPD_CFG"

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/depth_tests.py?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/depth_tests.py Wed Aug 11 16:43:22 2010
@@ -1045,6 +1045,10 @@ def diff_in_depthy_wc(sbox):
     "@@ -1 +1 @@\n",
     "-new text\n",
     "+This is the file 'mu'.\n",
+    "Index: A\n",
+    "===================================================================\n",
+    "--- A\t(revision 2)\n",
+    "+++ A\t(working copy)\n",
     "\n",
     "Property changes on: A\n",
     "___________________________________________________________________\n",
@@ -1058,6 +1062,10 @@ def diff_in_depthy_wc(sbox):
     "@@ -1 +1 @@\n",
     "-new text\n",
     "+This is the file 'iota'.\n",
+    "Index: .\n",
+    "===================================================================\n",
+    "--- .\t(revision 2)\n",
+    "+++ .\t(working copy)\n",
     "\n",
     "Property changes on: .\n",
     "___________________________________________________________________\n",
@@ -1067,7 +1075,7 @@ def diff_in_depthy_wc(sbox):
 
   os.chdir(wc_empty)
 
-  expected_output = svntest.verify.UnorderedOutput(diff[20:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[24:])
   # The diff should contain only the propchange on '.'
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '-rHEAD')
@@ -1077,11 +1085,11 @@ def diff_in_depthy_wc(sbox):
                                      '--set-depth', 'files', '-r1')
   # The diff should contain only the propchange on '.' and the
   # contents change on iota.
-  expected_output = svntest.verify.UnorderedOutput(diff[13:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[17:])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '-rHEAD')
   # Do a diff at --depth empty.
-  expected_output = svntest.verify.UnorderedOutput(diff[20:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[24:])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '--depth', 'empty', '-rHEAD')
 
@@ -1090,11 +1098,11 @@ def diff_in_depthy_wc(sbox):
                                      '--set-depth', 'immediates', '-r1')
   # The diff should contain the propchanges on '.' and 'A' and the
   # contents change on iota.
-  expected_output = svntest.verify.UnorderedOutput(diff[7:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[7:])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                     'diff', '-rHEAD')
   # Do a diff at --depth files.
-  expected_output = svntest.verify.UnorderedOutput(diff[13:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[17:])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '--depth', 'files', '-rHEAD')
 
@@ -2434,6 +2442,8 @@ def make_depth_tree_conflicts(sbox):
   expected_disk.remove('A/mu',
                        'A/B', 'A/B/lambda', 'A/B/E/alpha', 'A/B/E/beta',
                        'A/D/gamma');
+  if svntest.main.wc_is_singledb(sbox.wc_dir):
+    expected_disk.remove('A/B/E', 'A/B/F')
 
   # This test is set XFail because this (correct) status cannot be
   # verified due to an "svn update" bug. The tree-conflict on A/B
@@ -2669,6 +2679,45 @@ def update_excluded_path_sticky_depths(s
   }
   svntest.actions.run_and_verify_info([expected_info], B_path)
 
+
+def update_depth_empty_root_of_infinite_children(sbox):
+  """update depth=empty root of depth=infinite children"""
+
+  wc_dir, ign_a, ign_b, wc_other = set_up_depthy_working_copies(sbox,
+                                                                empty=True,
+                                                                infinity=True)
+  A_path = os.path.join(wc_dir, 'A')
+
+  # Update A to depth 'infinity'
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'up', '--set-depth', 'infinity', A_path)
+
+  # Tweak some files in the full working copy and commit.
+  svntest.main.file_append(os.path.join(wc_other, 'A', 'B', 'E', 'alpha'),
+                           "Modified alpha.\n")
+  svntest.main.file_append(os.path.join(wc_other, 'A', 'D', 'G', 'rho'),
+                           "Modified rho.\n")
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'ci', '-m', '', wc_other)
+
+  # Now update the original working copy and make sure we get those changes.
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B/E/alpha'      : Item(status='U '),
+    'A/D/G/rho'        : Item(status='U '),
+    })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+  expected_status.remove('iota')
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('iota')
+  expected_disk.tweak('A/B/E/alpha', contents="This is the file 'alpha'.\nModified alpha.\n")
+  expected_disk.tweak('A/D/G/rho', contents="This is the file 'rho'.\nModified rho.\n")
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None,
+                                        None, None, None, None, wc_dir)
+
 #----------------------------------------------------------------------
 # list all tests here, starting with None:
 test_list = [ None,
@@ -2713,7 +2762,8 @@ test_list = [ None,
               tree_conflicts_resolved_depth_immediates,
               tree_conflicts_resolved_depth_infinity,
               update_excluded_path_sticky_depths,
-            ]
+              update_depth_empty_root_of_infinite_children,
+              ]
 
 if __name__ == "__main__":
   svntest.main.run_tests(test_list)

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/diff_tests.py?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/diff_tests.py Wed Aug 11 16:43:22 2010
@@ -53,8 +53,8 @@ def make_diff_header(path, old_tag, new_
     ]
 
 def make_git_diff_header(path, old_tag, new_tag, add=False, src_label=None,
-                         dst_label=None, delete=False, cp=False, mv=False, 
-                         copyfrom=None):
+                         dst_label=None, delete=False, text_changes=True,
+                         cp=False, mv=False, copyfrom=None):
   """ Generate the expected 'git diff' header for file PATH, with its old
   and new versions described in parentheses by OLD_TAG and NEW_TAG.
   SRC_LABEL and DST_LABEL are paths or urls that are added to the diff
@@ -78,31 +78,42 @@ def make_git_diff_header(path, old_tag, 
     dst_label = ''
 
   if add:
-    return [
+    output = [
       "Index: " + path_as_shown + "\n",
       "===================================================================\n",
       "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
       "new file mode 10644\n",
-      "--- /dev/null\t(" + old_tag + ")\n",
-      "+++ b/" + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
     ]
+    if text_changes:
+      output.extend([
+        "--- /dev/null\t(" + old_tag + ")\n",
+        "+++ b/" + path_as_shown + dst_label + "\t(" + new_tag + ")\n"
+      ])
   elif delete:
-    return [
+    output = [
       "Index: " + path_as_shown + "\n",
       "===================================================================\n",
       "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
       "deleted file mode 10644\n",
-      "--- a/" + path_as_shown + src_label + "\t(" + old_tag + ")\n",
-      "+++ /dev/null\t(" + new_tag + ")\n",
     ]
+    if text_changes:
+      output.extend([
+        "--- a/" + path_as_shown + src_label + "\t(" + old_tag + ")\n",
+        "+++ /dev/null\t(" + new_tag + ")\n"
+      ])
   elif cp:
-    return [
+    output = [
       "Index: " + path_as_shown + "\n",
       "===================================================================\n",
       "diff --git a/" + copyfrom_as_shown + " b/" + path_as_shown + "\n",
       "copy from " + copyfrom_as_shown + "\n",
       "copy to " + path_as_shown + "\n",
     ]
+    if text_changes:
+      output.extend([
+        "--- a/" + copyfrom_as_shown + src_label + "\t(" + old_tag + ")\n",
+        "+++ b/" + path_as_shown + "\t(" + new_tag + ")\n"
+      ])
   elif mv:
     return [
       "Index: " + path_as_shown + "\n",
@@ -111,14 +122,20 @@ def make_git_diff_header(path, old_tag, 
       "rename from " + copyfrom_as_shown + "\n",
       "rename to " + path_as_shown + "\n",
     ]
+    if text_changes:
+      output.extend([
+        "--- a/" + copyfrom_as_shown + src_label + "\t(" + old_tag + ")\n",
+        "+++ b/" + path_as_shown + "\t(" + new_tag + ")\n"
+      ])
   else:
-    return [
+    output = [
       "Index: " + path_as_shown + "\n",
       "===================================================================\n",
       "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
       "--- a/" + path_as_shown + src_label + "\t(" + old_tag + ")\n",
       "+++ b/" + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
     ]
+  return output
 
 
 ######################################################################
@@ -548,8 +565,7 @@ def diff_multiple_reverse(sbox):
   repo_diff(wc_dir, 4, 1, check_add_a_file_in_a_subdir)
   repo_diff(wc_dir, 4, 1, check_add_a_file)
   repo_diff(wc_dir, 1, 4, check_update_a_file)
-### TODO: directory delete doesn't work yet
-#  repo_diff(wc_dir, 1, 4, check_add_a_file_in_a_subdir_reverse)
+  repo_diff(wc_dir, 1, 4, check_add_a_file_in_a_subdir_reverse)
   repo_diff(wc_dir, 1, 4, check_add_a_file_reverse)
 
 # test 6
@@ -713,6 +729,10 @@ def diff_only_property_change(sbox):
   wc_dir = sbox.wc_dir
 
   expected_output = [
+    "Index: iota\n",
+    "===================================================================\n",
+    "--- iota\t(revision 1)\n",
+    "+++ iota\t(revision 2)\n",
     "\n",
     "Property changes on: iota\n",
     "___________________________________________________________________\n",
@@ -721,11 +741,16 @@ def diff_only_property_change(sbox):
     "+native\n" ]
 
   expected_reverse_output = list(expected_output)
-  expected_reverse_output[3] = expected_reverse_output[3].replace("Added",
+  expected_reverse_output[2] = expected_reverse_output[2].replace("1", "2")
+  expected_reverse_output[3] = expected_reverse_output[3].replace("2", "1")
+  expected_reverse_output[7] = expected_reverse_output[7].replace("Added",
                                                                   "Deleted")
-  expected_reverse_output[4] = "## -1 +0,0 ##\n"
-  expected_reverse_output[5] = "-native\n"
+  expected_reverse_output[8] = "## -1 +0,0 ##\n"
+  expected_reverse_output[9] = "-native\n"
 
+  expected_rev1_output = list(expected_output)
+  expected_rev1_output[3] = expected_rev1_output[3].replace("revision 2",
+                                                            "working copy")
 
   os.chdir(sbox.wc_dir)
   svntest.actions.run_and_verify_svn(None, None, [],
@@ -747,10 +772,10 @@ def diff_only_property_change(sbox):
   svntest.actions.run_and_verify_svn(None, expected_reverse_output, [],
                                      'diff', '-c', '-2')
 
-  svntest.actions.run_and_verify_svn(None, expected_output, [],
+  svntest.actions.run_and_verify_svn(None, expected_rev1_output, [],
                                      'diff', '-r', '1')
 
-  svntest.actions.run_and_verify_svn(None, expected_output, [],
+  svntest.actions.run_and_verify_svn(None, expected_rev1_output, [],
                                      'diff', '-r', 'PREV', 'iota')
 
 
@@ -1895,6 +1920,7 @@ def diff_renamed_dir(sbox):
                        'A') :
     raise svntest.Failure
 
+  # Commit
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'ci', '-m', 'log msg')
 
@@ -1923,20 +1949,62 @@ def diff_renamed_dir(sbox):
                        'A') :
     raise svntest.Failure
 
-  # Test the diff while within the moved directory
-  os.chdir(os.path.join('A','D','I'))
+  # repos->repos with explicit URL arg
+  exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
+                                                            '-r', '1:2',
+                                                            '^/A')
+  if check_diff_output(diff_output,
+                       os.path.join('D', 'G', 'pi'),
+                       'D') :
+    raise svntest.Failure
+  if check_diff_output(diff_output,
+                       os.path.join('D', 'I', 'pi'),
+                       'A') :
+    raise svntest.Failure
 
+  # Go to the parent of the moved directory
+  os.chdir(os.path.join('A','D'))
+
+  # repos->wc diff in the parent
   exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
                                                             '-r', '1')
 
-  if check_diff_output(diff_output, 'pi', 'A') :
+  if check_diff_output(diff_output, 
+                       os.path.join('G', 'pi'),
+                       'D') :
+    raise svntest.Failure
+  if check_diff_output(diff_output, 
+                       os.path.join('I', 'pi'),
+                       'A') :
     raise svntest.Failure
 
-  # Test a repos->repos diff while within the moved directory
+  # repos->repos diff in the parent
+  exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
+                                                            '-r', '1:2')
+
+  if check_diff_output(diff_output, 
+                       os.path.join('G', 'pi'),
+                       'D') :
+    raise svntest.Failure
+  if check_diff_output(diff_output, 
+                       os.path.join('I', 'pi'),
+                       'A') :
+    raise svntest.Failure
+
+  # Go to the move target directory
+  os.chdir('I')
+
+  # repos->wc diff while within the moved directory (should be empty)
+  exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
+                                                            '-r', '1')
+  if diff_output:
+    raise svntest.Failure
+
+  # repos->repos diff while within the moved directory (should be empty)
   exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
                                                             '-r', '1:2')
 
-  if check_diff_output(diff_output, 'pi', 'A') :
+  if diff_output:
     raise svntest.Failure
 
 
@@ -1947,7 +2015,8 @@ def diff_property_changes_to_base(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  expected_output_r1_r2 = [
+
+  add_diff = [
     "\n",
     "Property changes on: A\n",
     "___________________________________________________________________\n",
@@ -1961,17 +2030,46 @@ def diff_property_changes_to_base(sbox):
     "## -0,0 +1 ##\n",
     "+r2value\n"]
 
-
-  expected_output_r2_r1 = list(expected_output_r1_r2)
-  expected_output_r2_r1[3] = expected_output_r2_r1[3].replace("Added",
-                                                              "Deleted")
-  expected_output_r2_r1[4] = "## -1 +0,0 ##\n"
-  expected_output_r2_r1[5] = "-r2value\n"
-  expected_output_r2_r1[9] = expected_output_r2_r1[9].replace("Added",
-                                                              "Deleted")
-  expected_output_r2_r1[10] = "## -1 +0,0 ##\n"
-  expected_output_r2_r1[11] = "-r2value\n"
-
+  del_diff = [
+    "\n",
+    "Property changes on: A\n",
+    "___________________________________________________________________\n",
+    "Deleted: dirprop\n",
+    "## -1 +0,0 ##\n",
+    "-r2value\n",
+    "\n",
+    "Property changes on: iota\n",
+    "___________________________________________________________________\n",
+    "Deleted: fileprop\n",
+    "## -1 +0,0 ##\n",
+    "-r2value\n"]
+
+
+  expected_output_r1_r2 = list(make_diff_header('A', 'revision 1', 'revision 2') 
+                               + add_diff[:6]
+                               + make_diff_header('iota', 'revision 1', 
+                                                   'revision 2')
+                               + add_diff[7:])
+
+  expected_output_r2_r1 = list(make_diff_header('A', 'revision 2', 
+                                                'revision 1')
+                               + del_diff[:6]
+                               + make_diff_header('iota', 'revision 2', 
+                                                  'revision 1')
+                               + del_diff[7:])
+
+  expected_output_r1 = list(make_diff_header('A', 'revision 1', 
+                                             'working copy')
+                            + add_diff[:6]
+                            + make_diff_header('iota', 'revision 1',
+                                               'working copy')
+                            + add_diff[7:])
+  expected_output_base_r1 = list(make_diff_header('A', 'working copy',
+                                                  'revision 1')
+                                 + del_diff[:6]
+                                 + make_diff_header('iota', 'working copy',
+                                                    'revision 1')
+                                 + del_diff[7:])
 
   os.chdir(sbox.wc_dir)
 
@@ -1998,14 +2096,14 @@ def diff_property_changes_to_base(sbox):
   # Now check repos->WORKING, repos->BASE, and BASE->repos.
   # (BASE is r1, and WORKING has no local mods, so this should produce
   # the same output as above).
-  expected = svntest.verify.UnorderedOutput(expected_output_r1_r2)
+  expected = svntest.verify.UnorderedOutput(expected_output_r1)
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', '1')
 
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', '1:BASE')
 
-  expected = svntest.verify.UnorderedOutput(expected_output_r2_r1)
+  expected = svntest.verify.UnorderedOutput(expected_output_base_r1)
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', 'BASE:1')
 
@@ -2023,12 +2121,12 @@ def diff_property_changes_to_base(sbox):
                                      'fileprop', 'workingvalue', 'A/mu')
 
   # Check that the earlier diffs against BASE are unaffected by the
-  # presence of local mods.
-  expected = svntest.verify.UnorderedOutput(expected_output_r1_r2)
+  # presence of local mods (with the exception of diff header changes).
+  expected = svntest.verify.UnorderedOutput(expected_output_r1)
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', '1:BASE')
 
-  expected = svntest.verify.UnorderedOutput(expected_output_r2_r1)
+  expected = svntest.verify.UnorderedOutput(expected_output_base_r1)
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', 'BASE:1')
 
@@ -2181,6 +2279,10 @@ def diff_prop_change_local_propmod(sbox)
   sbox.build()
 
   expected_output_r2_wc = [
+    "Index: A\n",
+    "===================================================================\n",
+    "--- A\t(revision 2)\n",
+    "+++ A\t(working copy)\n",
     "\n",
     "Property changes on: A\n",
     "___________________________________________________________________\n",
@@ -2191,6 +2293,10 @@ def diff_prop_change_local_propmod(sbox)
     "Added: newdirprop\n",
     "## -0,0 +1 ##\n",
     "+newworkingvalue\n",
+    "Index: iota\n",
+    "===================================================================\n",
+    "--- iota\t(revision 2)\n",
+    "+++ iota\t(working copy)\n",
     "\n",
     "Property changes on: iota\n",
     "___________________________________________________________________\n",
@@ -2282,15 +2388,19 @@ def diff_repos_wc_add_with_props(sbox):
     "@@ -0,0 +1 @@\n",
     "+content\n",
     "\n",
-    "Property changes on: " + os.path.join('X', 'bar') + "\n",
+    "Property changes on: X/bar\n",
     "___________________________________________________________________\n",
     "Added: propname\n",
     "## -0,0 +1 ##\n",
     "+propvalue\n",
     ]
 
+  diff_X_r1_base = make_diff_header("X", "revision 1",
+                                         "working copy") + diff_X
+  diff_X_base_r3 = make_diff_header("X", "working copy",
+                                         "revision 3") + diff_X
   diff_foo_r1_base = make_diff_header("foo", "revision 0",
-                                              "revision 3") + diff_foo
+                                             "revision 3") + diff_foo
   diff_foo_base_r3 = make_diff_header("foo", "revision 0",
                                              "revision 3") + diff_foo
   diff_X_bar_r1_base = make_diff_header("X/bar", "revision 0",
@@ -2298,8 +2408,8 @@ def diff_repos_wc_add_with_props(sbox):
   diff_X_bar_base_r3 = make_diff_header("X/bar", "revision 0",
                                                  "revision 3") + diff_X_bar
 
-  expected_output_r1_base = diff_X + diff_X_bar_r1_base + diff_foo_r1_base
-  expected_output_base_r3 = diff_foo_base_r3 + diff_X_bar_base_r3 + diff_X
+  expected_output_r1_base = diff_X_r1_base + diff_X_bar_r1_base + diff_foo_r1_base
+  expected_output_base_r3 = diff_foo_base_r3 + diff_X_bar_base_r3 + diff_X_base_r3
 
   os.chdir(sbox.wc_dir)
 
@@ -2703,6 +2813,7 @@ def diff_with_depth(sbox):
   "test diffs at various depths"
 
   sbox.build()
+  B_path = os.path.join('A', 'B')
 
   diff = [
     "\n",
@@ -2724,17 +2835,29 @@ def diff_with_depth(sbox):
     "## -0,0 +1 ##\n",
     "+bar3\n",
     "\n",
-    "Property changes on: " + os.path.join('A', 'B') + "\n",
+    "Property changes on: A/B\n", 
     "___________________________________________________________________\n",
     "Added: foo4\n",
     "## -0,0 +1 ##\n",
     "+bar4\n"]
 
-  expected_empty = svntest.verify.UnorderedOutput(diff[:6])
-  expected_files = svntest.verify.UnorderedOutput(diff[:12])
-  expected_immediates = svntest.verify.UnorderedOutput(diff[:18])
-  expected_infinity = svntest.verify.UnorderedOutput(diff[:6]
-                                                     + diff[12:] + diff[6:12])
+  dot_header = make_diff_header(".", "revision 1", "working copy")
+  iota_header = make_diff_header('iota', "revision 1", "working copy")
+  A_header = make_diff_header('A', "revision 1", "working copy")
+  B_header = make_diff_header(B_path, "revision 1", "working copy")
+
+  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
+  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                  + iota_header + diff[7:12])
+  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + iota_header 
+                                                       + diff[7:12]
+                                                       +  A_header + diff[8:18])
+  expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + iota_header 
+                                                       + diff[7:12]
+                                                       +  A_header + diff[8:18]
+                                                       + B_header + diff[12:])
 
   os.chdir(sbox.wc_dir)
 
@@ -2765,7 +2888,25 @@ def diff_with_depth(sbox):
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'ci', '-m', '')
 
-  # Test repos-repos diff.  Reuse the expected outputs from above.
+  dot_header = make_diff_header(".", "revision 1", "revision 2")
+  iota_header = make_diff_header('iota', "revision 1", "revision 2")
+  A_header = make_diff_header('A', "revision 1", "revision 2")
+  B_header = make_diff_header(B_path, "revision 1", "revision 2")
+
+  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
+  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                  + iota_header + diff[7:12])
+  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + iota_header 
+                                                       + diff[7:12]
+                                                       +  A_header + diff[8:18])
+  expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + iota_header 
+                                                       + diff[7:12]
+                                                       +  A_header + diff[8:18]
+                                                       + B_header + diff[12:])
+
+  # Test repos-repos diff.
   svntest.actions.run_and_verify_svn(None, expected_empty, [],
                                      'diff', '-c2', '--depth', 'empty')
   svntest.actions.run_and_verify_svn(None, expected_files, [],
@@ -2776,13 +2917,21 @@ def diff_with_depth(sbox):
                                      'diff', '-c2', '--depth', 'infinity')
 
   diff_wc_repos = [
+    "Index: A/B\n",
+    "===================================================================\n",
+    "--- A/B\t(revision 2)\n",
+    "+++ A/B\t(working copy)\n",
     "\n",
-    "Property changes on: " + os.path.join('A', 'B') + "\n",
+    "Property changes on: A/B\n",
     "___________________________________________________________________\n",
     "Modified: foo4\n",
     "## -1 +1 ##\n",
     "-bar4\n",
     "+baz4\n",
+    "Index: A\n",
+    "===================================================================\n",
+    "--- A\t(revision 2)\n",
+    "+++ A\t(working copy)\n",
     "\n",
     "Property changes on: A\n",
     "___________________________________________________________________\n",
@@ -2811,6 +2960,10 @@ def diff_with_depth(sbox):
     "## -1 +1 ##\n",
     "-bar2\n",
     "+baz2\n",
+    "Index: .\n",
+    "===================================================================\n",
+    "--- .\t(revision 2)\n",
+    "+++ .\t(working copy)\n",
     "\n",
     "Property changes on: .\n",
     "___________________________________________________________________\n",
@@ -2819,10 +2972,10 @@ def diff_with_depth(sbox):
     "-bar1\n",
     "+baz1\n" ]
 
-  expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[35:])
-  expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[21:])
-  expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[7:14]
-                                                       +diff_wc_repos[21:])
+  expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[43:])
+  expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[29:])
+  expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[11:22]
+                                                       +diff_wc_repos[29:])
   expected_infinity = svntest.verify.UnorderedOutput(diff_wc_repos[:])
 
   svntest.actions.run_and_verify_svn(None, None, [],
@@ -3133,11 +3286,11 @@ def diff_url_against_local_mods(sbox):
 
 
 #----------------------------------------------------------------------
-# Diff rev against working copy of a removed and locally re-added file.
-# This is issue #1675 ("svn diff -rN added-file" has odd behavior).
+# Diff against old revision of the parent directory of a removed and
+# locally re-added file.
 
 def diff_preexisting_rev_against_local_add(sbox):
-  "diff -r1 of removed file to its local addition"
+  "diff -r1 of dir with removed-then-readded file"
   sbox.build()
   os.chdir(sbox.wc_dir)
 
@@ -3272,6 +3425,171 @@ def diff_git_format_url_url(sbox):
                                      '--git-diff', 
                                      '--old', repo_url + '@1', '--new',
                                      repo_url + '@2')
+# Regression test for an off-by-one error when printing intermediate context
+# lines.
+def diff_prop_missing_context(sbox):
+  "diff for property has missing context"
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  iota_path = os.path.join(wc_dir, 'iota')
+  prop_val = "".join([
+       "line 1\n",
+       "line 2\n",
+       "line 3\n",
+       "line 4\n",
+       "line 5\n",
+       "line 6\n",
+       "line 7\n",
+     ])
+  svntest.main.run_svn(None,
+                       "propset", "prop", prop_val, iota_path)
+
+  expected_output = svntest.wc.State(wc_dir, {
+      'iota'    : Item(verb='Sending'),
+      })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('iota', wc_rev=2)
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+                                        expected_status, None, wc_dir)
+
+  prop_val = "".join([
+               "line 3\n",
+               "line 4\n",
+               "line 5\n",
+               "line 6\n",
+             ])
+  svntest.main.run_svn(None,
+                       "propset", "prop", prop_val, iota_path)
+  expected_output = make_diff_header(iota_path, 'revision 2', 
+                                     'working copy') + [
+    "\n",
+    "Property changes on: %s\n" % iota_path.replace('\\', '/'),
+    "___________________________________________________________________\n",
+    "Modified: prop\n",
+    "## -1,7 +1,4 ##\n",
+    "-line 1\n",
+    "-line 2\n",
+    " line 3\n",
+    " line 4\n",
+    " line 5\n",
+    " line 6\n",
+    "-line 7\n",
+  ]
+
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', iota_path)
+
+def diff_prop_multiple_hunks(sbox):
+  "diff for property with multiple hunks"
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  iota_path = os.path.join(wc_dir, 'iota')
+  prop_val = "".join([
+       "line 1\n",
+       "line 2\n",
+       "line 3\n",
+       "line 4\n",
+       "line 5\n",
+       "line 6\n",
+       "line 7\n",
+       "line 8\n",
+       "line 9\n",
+       "line 10\n",
+       "line 11\n",
+       "line 12\n",
+       "line 13\n",
+     ])
+  svntest.main.run_svn(None,
+                       "propset", "prop", prop_val, iota_path)
+
+  expected_output = svntest.wc.State(wc_dir, {
+      'iota'    : Item(verb='Sending'),
+      })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('iota', wc_rev=2)
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+                                        expected_status, None, wc_dir)
+
+  prop_val = "".join([
+               "line 1\n",
+               "line 2\n",
+               "line 3\n",
+               "Add a line here\n",
+               "line 4\n",
+               "line 5\n",
+               "line 6\n",
+               "line 7\n",
+               "line 8\n",
+               "line 9\n",
+               "line 10\n",
+               "And add a line here\n",
+               "line 11\n",
+               "line 12\n",
+               "line 13\n",
+             ])
+  svntest.main.run_svn(None,
+                       "propset", "prop", prop_val, iota_path)
+  expected_output = make_diff_header(iota_path, 'revision 2', 
+                                     'working copy') + [
+    "\n",
+    "Property changes on: %s\n" % iota_path.replace('\\', '/'),
+    "___________________________________________________________________\n",
+    "Modified: prop\n",
+    "## -1,6 +1,7 ##\n",
+    " line 1\n",
+    " line 2\n",
+    " line 3\n",
+    "+Add a line here\n",
+    " line 4\n",
+    " line 5\n",
+    " line 6\n",
+    "## -8,6 +9,7 ##\n",
+    " line 8\n",
+    " line 9\n",
+    " line 10\n",
+    "+And add a line here\n",
+    " line 11\n",
+    " line 12\n",
+    " line 13\n",
+  ]
+
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', iota_path)
+def diff_git_empty_files(sbox):
+  "create a diff in git format for empty files"
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  iota_path = os.path.join(wc_dir, 'iota')
+  new_path = os.path.join(wc_dir, 'new')
+  svntest.main.file_write(iota_path, "")
+
+  # Now commit the local mod, creating rev 2.
+  expected_output = svntest.wc.State(wc_dir, {
+    'iota' : Item(verb='Sending'),
+    })
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'iota' : Item(status='  ', wc_rev=2),
+    })
+
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+                                        expected_status, None, wc_dir)
+
+  svntest.main.file_write(new_path, "")
+  svntest.main.run_svn(None, 'add', new_path)
+  svntest.main.run_svn(None, 'rm', iota_path)
+
+  expected_output = make_git_diff_header(new_path, "revision 0", 
+                                         "working copy", 
+                                         add=True, text_changes=False) + [
+  ] + make_git_diff_header(new_path, "revision 2", "working copy", 
+                           delete=True, text_changes=False)
+
+  svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', 
+                                     '--git-diff', wc_dir)
 
 # Check ignoring mergeinfo in a diff
 def diff_ignore_mergeinfo(sbox):
@@ -3368,6 +3686,8 @@ def diff_ignore_mergeinfo(sbox):
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
                                      '--ignore-mergeinfo')
 
+
+
 ########################################################################
 #Run the tests
 
@@ -3401,7 +3721,7 @@ test_list = [ None,
               diff_keywords,
               diff_force,
               diff_schedule_delete,
-              XFail(diff_renamed_dir),
+              diff_renamed_dir,
               diff_property_changes_to_base,
               diff_mime_type_changes,
               diff_prop_change_local_propmod,
@@ -3427,6 +3747,9 @@ test_list = [ None,
               diff_git_format_wc_wc,
               diff_git_format_url_wc,
               diff_git_format_url_url,
+              diff_prop_missing_context,
+              diff_prop_multiple_hunks,
+              XFail(diff_git_empty_files),
               diff_ignore_mergeinfo,
               ]
 

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/entries-dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/entries-dump.c?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/entries-dump.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/entries-dump.c Wed Aug 11 16:43:22 2010
@@ -1,5 +1,5 @@
 /*
- * db-test.c :  test the wc_db subsystem
+ * entries-dump.c :  dump pre-1.6 svn_wc_* output for python
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one
@@ -32,6 +32,7 @@
 #include "svn_wc.h"
 #include "svn_dirent_uri.h"
 
+#include "private/svn_wc_private.h"
 
 static void
 str_value(const char *name, const char *value)
@@ -131,6 +132,59 @@ entries_dump(const char *dir_path, apr_p
 }
 
 
+/* baton for print_dir */
+struct directory_walk_baton
+{
+  svn_wc_context_t *wc_ctx;
+  const char *root_abspath;
+  const char *prefix_path;
+};
+
+/* svn_wc__node_found_func_t implementation for directory_dump */
+static svn_error_t *
+print_dir(const char *local_abspath,
+          void *walk_baton,
+          apr_pool_t *scratch_pool)
+{
+  struct directory_walk_baton *bt = walk_baton;
+  svn_node_kind_t kind;
+
+  SVN_ERR(svn_wc_read_kind(&kind, bt->wc_ctx, local_abspath, FALSE,
+                           scratch_pool));
+
+  if (kind != svn_node_dir)
+    return SVN_NO_ERROR;
+
+  printf("%s\n",
+         svn_dirent_local_style(
+                   svn_dirent_join(bt->prefix_path,
+                                   svn_dirent_skip_ancestor(bt->root_abspath,
+                                                            local_abspath),
+                                   scratch_pool),
+                   scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+/* Print all not-hidden subdirectories in the working copy, starting by path */
+static svn_error_t *
+directory_dump(const char *path,
+               apr_pool_t *scratch_pool)
+{
+  struct directory_walk_baton bt;
+
+  SVN_ERR(svn_wc_context_create(&bt.wc_ctx, NULL, scratch_pool, scratch_pool));
+  SVN_ERR(svn_dirent_get_absolute(&bt.root_abspath, path, scratch_pool));
+
+  bt.prefix_path = path;
+
+  SVN_ERR(svn_wc__node_walk_children(bt.wc_ctx, bt.root_abspath, FALSE,
+                                     print_dir, &bt, svn_depth_infinity,
+                                     NULL, NULL, scratch_pool));
+
+  return svn_error_return(svn_wc_context_destroy(bt.wc_ctx));
+}
+
 int
 main(int argc, const char *argv[])
 {
@@ -138,24 +192,38 @@ main(int argc, const char *argv[])
   int exit_code = EXIT_SUCCESS;
   svn_error_t *err;
   const char *path;
+  const char *cmd;
 
-  if (argc != 2)
+  if (argc < 2 || argc > 4)
     {
-      printf("USAGE: entries-dump DIR_PATH\n");
+      fprintf(stderr, "USAGE: entries-dump [--entries|--subdirs] DIR_PATH\n");
       exit(1);
     }
 
   if (apr_initialize() != APR_SUCCESS)
     {
-      printf("apr_initialize() failed.\n");
+      fprintf(stderr, "apr_initialize() failed.\n");
       exit(1);
     }
 
   /* set up the global pool */
   pool = svn_pool_create(NULL);
 
-  path = svn_dirent_internal_style(argv[1], pool);
-  err = entries_dump(path, pool);
+  path = svn_dirent_internal_style(argv[argc-1], pool);
+
+  if (argc > 2)
+    cmd = argv[1];
+  else
+    cmd = NULL;
+
+  if (!cmd || !strcmp(cmd, "--entries"))
+    err = entries_dump(path, pool);
+  else if (!strcmp(cmd, "--subdirs"))
+    err = directory_dump(path, pool);
+  else
+    err = svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
+                            "Invalid command '%s'",
+                            cmd);
   if (err)
     {
       svn_handle_error2(err, stderr, FALSE, "entries-dump: ");
@@ -167,6 +235,5 @@ main(int argc, const char *argv[])
   svn_pool_destroy(pool);
   apr_terminate();
 
-  exit(exit_code);
   return exit_code;
 }

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/entries_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/entries_tests.py?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/entries_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/entries_tests.py Wed Aug 11 16:43:22 2010
@@ -182,7 +182,12 @@ def obstructed_entries(sbox):
 
   entries = svntest.main.run_entriesdump(D_path)
   check_names(entries, 'H')
-  validate(entries['H'], revision=-1)
+
+  if svntest.main.wc_is_singledb(wc_dir):
+    # Data is not missing in single-db
+    validate(entries['H'], revision=1)
+  else:
+    validate(entries['H'], revision=-1)
 
   ### need to get svn_wc__db_read_info() to generate obstructed_add
 

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/export_tests.py?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/export_tests.py Wed Aug 11 16:43:22 2010
@@ -26,6 +26,7 @@
 
 # General modules
 import os
+import tempfile
 
 # Our testing module
 import svntest
@@ -268,20 +269,28 @@ def export_working_copy_at_base_revision
   wc_dir = sbox.wc_dir
 
   mu_path = os.path.join(wc_dir, 'A', 'mu')
+  C_path = os.path.join(wc_dir, 'A', 'C')
   kappa_path = os.path.join(wc_dir, 'kappa')
+  K_path = os.path.join(wc_dir, 'K')
   gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
   E_path = os.path.join(wc_dir, 'A', 'B', 'E')
+  rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
 
-  # Appends some text to A/mu, and add a new file
-  # called kappa.  These modifications should *not*
-  # get exported at the base revision.
+  # Make some local modifications: modify mu and C, add kappa and K, delete
+  # gamma and E, and replace rho.  (Directories can't yet be replaced.)
+  # These modifications should *not* get exported at the base revision.
   svntest.main.file_append(mu_path, 'Appended text')
+  svntest.main.run_svn(None, 'propset', 'p', 'v', mu_path, C_path)
   svntest.main.file_append(kappa_path, "This is the file 'kappa'.")
   svntest.main.run_svn(None, 'add', kappa_path)
+  svntest.main.run_svn(None, 'mkdir', K_path)
   svntest.main.run_svn(None, 'rm', E_path, gamma_path)
+  svntest.main.run_svn(None, 'rm', rho_path)
+  svntest.main.file_append(rho_path, "Replacement file 'rho'.")
+  svntest.main.run_svn(None, 'add', rho_path)
 
   # Note that we don't tweak the expected disk tree at all,
-  # since the appended text and kappa should not be present.
+  # since the modifications should not be present.
   expected_disk = svntest.main.greek_state.copy()
 
   export_target = sbox.add_wc_path('export')
@@ -483,6 +492,135 @@ def export_working_copy_ignoring_keyword
                                         expected_disk,
                                         "--ignore-keywords")
 
+# This is test for issue #3683 - 'Escape unsafe charaters in a URL during
+# export'
+def export_with_url_unsafe_characters(sbox):
+  "export file with URL unsafe characters"
+
+  ## See http://subversion.tigris.org/issues/show_bug.cgi?id=3683 ##
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Define the paths
+  url_unsafe_path = os.path.join(wc_dir, 'A', 'test- @#$&.txt')
+  url_unsafe_path_url = sbox.repo_url + '/A/test- @#$&.txt@'
+  export_target = os.path.join(wc_dir, 'test- @#$&.txt')
+
+  # Create the file with special name and commit it.
+  svntest.main.file_write(url_unsafe_path, 'This is URL unsafe path file.')
+  svntest.main.run_svn(None, 'add', url_unsafe_path + '@')
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', 'log msg',
+                                     '--quiet', wc_dir)
+
+  # Export the file and verify it.
+  svntest.actions.run_and_verify_svn(None, None, [], 'export',
+                                     url_unsafe_path_url, export_target + '@')
+
+  if not os.path.exists(export_target):
+    raise svntest.Failure("export did not fetch file with URL unsafe path")
+
+def export_working_copy_with_depths(sbox):
+  "export working copy with different depths"
+  sbox.build(read_only = True)
+
+  expected_disk = svntest.wc.State('', {
+      'A': Item(),
+      'iota': Item(contents="This is the file 'iota'.\n"),
+      })
+  export_target = sbox.add_wc_path('immediates')
+  svntest.actions.run_and_verify_export(sbox.wc_dir,
+                                        export_target,
+                                        svntest.wc.State(sbox.wc_dir, {}),
+                                        expected_disk,
+                                        '--depth=immediates')
+
+  expected_disk.remove('A')
+  export_target = sbox.add_wc_path('files')
+  svntest.actions.run_and_verify_export(sbox.wc_dir,
+                                        export_target,
+                                        svntest.wc.State(sbox.wc_dir, {}),
+                                        expected_disk,
+                                        '--depth=files')
+
+  expected_disk.remove('iota')
+  export_target = sbox.add_wc_path('empty')
+  svntest.actions.run_and_verify_export(sbox.wc_dir,
+                                        export_target,
+                                        svntest.wc.State(sbox.wc_dir, {}),
+                                        expected_disk,
+                                        '--depth=empty')
+
+def export_externals_with_native_eol(sbox):
+  "export externals with eol translation"
+  sbox.build()
+  
+  wc_dir = sbox.wc_dir
+  
+  # Set svn:eol-style to 'native' to see if it's applied correctly to
+  # externals in the export operation
+  alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
+  svntest.main.run_svn(None, 'ps', 'svn:eol-style', 'native', alpha_path)
+  svntest.main.run_svn(None, 'ci',
+                       '-m', 'Added eol-style prop to alpha', alpha_path)
+  
+  # Set 'svn:externals' property in 'A/C' to 'A/B/E/alpha'(file external),
+  # 'A/B/E'(directory external) & commit the property
+  C_path = os.path.join(wc_dir, 'A', 'C')
+  externals_prop = """^/A/B/E/alpha exfile_alpha 
+  ^/A/B/E exdir_E"""
+  
+  tmp_f = sbox.get_tempname('props')
+  svntest.main.file_append(tmp_f, externals_prop)
+  svntest.main.run_svn(None, 'ps', '-F', tmp_f, 'svn:externals', C_path)
+  svntest.main.run_svn(None,'ci', '-m', 'log msg', '--quiet', C_path)
+
+  
+  # Update the working copy to receive all changes(file external and
+  # directroy external changes) from repository 
+  svntest.main.run_svn(None, 'up', wc_dir)
+  
+  # After export, expected_disk will have all those present in standard
+  # greek tree and new externals we added above. 
+  # Update the expected disk tree to include all those externals.
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+      'A/C/exfile_alpha'  : Item("This is the file 'alpha'.\n"),
+      'A/C/exdir_E'       : Item(),
+      'A/C/exdir_E/alpha' : Item("This is the file 'alpha'.\n"),
+      'A/C/exdir_E/beta'  : Item("This is the file 'beta'.\n")
+      })
+  
+  # We are exporting with '--native-eol CR' option. 
+  # So change the contents of files under *expected_disk* tree 
+  # which have svn:eol-style property set to 'native' to verify
+  # with the exported tree.
+  # Here A/B/E/alpha and its external manifestations A/C/exfile_alpha
+  # and A/C/exdir_E/alpha needs a tweak.
+  new_contents = expected_disk.desc['A/C/exfile_alpha'].contents.replace("\n",
+                                                                         "\r")
+  expected_disk.tweak('A/C/exfile_alpha', 'A/B/E/alpha','A/C/exdir_E/alpha', 
+                      contents=new_contents)
+  
+  expected_output = svntest.main.greek_state.copy()
+  expected_output.add({
+      'A/C/exfile_alpha'  : Item("This is the file 'alpha'.\r"),
+      'A/C/exdir_E'       : Item(),
+      'A/C/exdir_E/alpha' : Item("This is the file 'alpha'.\r"),
+      'A/C/exdir_E/beta'  : Item("This is the file 'beta'.\n")
+      })
+  
+  # Export the repository with '--native-eol CR' option
+  export_target = sbox.add_wc_path('export')
+  expected_output.wc_dir = export_target
+  expected_output.desc[''] = Item()
+  expected_output.tweak(contents=None, status='A ')
+  svntest.actions.run_and_verify_export(sbox.repo_url,
+                                        export_target,
+                                        expected_output,
+                                        expected_disk,
+                                        '--native-eol', 'CR')
+
 ########################################################################
 # Run the tests
 
@@ -499,7 +637,7 @@ test_list = [ None,
               export_eol_translation,
               export_working_copy_with_keyword_translation,
               export_working_copy_with_property_mods,
-              export_working_copy_at_base_revision,
+              XFail(export_working_copy_at_base_revision),
               export_native_eol_option,
               export_nonexistent_file,
               export_unversioned_file,
@@ -509,6 +647,9 @@ test_list = [ None,
               export_to_explicit_cwd,
               export_ignoring_keyword_translation,
               export_working_copy_ignoring_keyword_translation,
+              export_with_url_unsafe_characters,
+              XFail(export_working_copy_with_depths),
+              export_externals_with_native_eol,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Wed Aug 11 16:43:22 2010
@@ -1,12 +1,15 @@
-log: Show the log messages for a set of revision(s) and/or file(s).
-usage: 1. log [PATH]
+log: Show the log messages for a set of revision(s) and/or path(s).
+usage: 1. log [PATH][@REV]
        2. log URL[@REV] [PATH...]
 
-  1. Print the log messages for a local PATH (default: '.').
-     The default revision range is BASE:1.
+  1. Print the log messages for the URL corresponding to PATH
+     (default: '.'). If specified, REV is the revision in which the
+     URL is first looked up, and the default revision range is REV:1.
+     If REV is not specified, the default revision range is BASE:1,
+     since the URL might not exist in the HEAD revision.
 
   2. Print the log messages for the PATHs (default: '.') under URL.
-     If specified, REV determines in which revision the URL is first
+     If specified, REV is the revision in which the URL is first
      looked up, and the default revision range is REV:1; otherwise,
      the URL is looked up in HEAD, and the default revision range is
      HEAD:1.
@@ -27,8 +30,10 @@ usage: 1. log [PATH]
   Examples:
     svn log
     svn log foo.c
+    svn log bar.c@42
     svn log http://www.example.com/repo/project/foo.c
     svn log http://www.example.com/repo/project foo.c bar.c
+    svn log http://www.example.com/repo/project@50 foo.c bar.c
 
 Valid options:
   -r [--revision] ARG      : ARG (some commands also take ARG1:ARG2 range)

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/lock_tests.py?rev=984468&r1=984467&r2=984468&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/lock_tests.py Wed Aug 11 16:43:22 2010
@@ -858,7 +858,15 @@ def lock_switched_files(sbox):
                                      gamma_path, lambda_path)
 
   expected_status.tweak('A/D/gamma', 'A/B/lambda', writelocked='K')
-  expected_status.tweak('A/B/E/alpha', 'iota', writelocked='O')
+
+  # In WC-NG locks are kept per working copy, not per file
+  if svntest.main.wc_is_singledb(wc_dir):
+    # In single-db you see these files are locked locally
+    expected_status.tweak('A/B/E/alpha', 'iota', writelocked='K')
+  else:
+    # In multi-db you see these files are not locked in the right dir
+    expected_status.tweak('A/B/E/alpha', 'iota', writelocked='O')
+
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
   svntest.actions.run_and_verify_svn(None, ".*unlocked", [], 'unlock',
@@ -1428,9 +1436,15 @@ def lock_twice_in_one_wc(sbox):
   os.chmod(mu2_path, 0700)
   svntest.main.file_append(mu2_path, "Updated text")
 
-  # Commit should fail because it is locked in the other location
-  svntest.actions.run_and_verify_svn(None, None,
-                                     '.*(([Nn]o)|(Server)).*[lL]ock.*',
+  if svntest.main.wc_is_singledb(wc_dir):
+    # Commit will just succeed as the DB owns the lock. It's a user decision
+    # to commit the other target instead of the one originally locked
+    expected_err = []
+  else:
+    # Commit should fail because it is locked in the other location
+    expected_err = '.*(([Nn]o)|(Server)).*[lL]ock.*'
+
+  svntest.actions.run_and_verify_svn(None, None, expected_err,
                                      'commit', mu2_path, '-m', '')
 
 #----------------------------------------------------------------------
@@ -1472,6 +1486,7 @@ def lock_path_not_in_head(sbox):
   svntest.actions.run_and_verify_svn2(None, None, expected_lock_fail_err_re,
                                       0, 'lock', lambda_path)
 
+#----------------------------------------------------------------------
 def verify_path_escaping(sbox):
   "verify escaping of lock paths"
 
@@ -1509,6 +1524,55 @@ def verify_path_escaping(sbox):
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
 
+#----------------------------------------------------------------------
+# Issue #3674: Replace + propset of locked file fails over DAV
+def replace_and_propset_locked_path(sbox):
+  "test replace + propset of locked file"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  mu_path = os.path.join(wc_dir, 'A', 'mu')
+  G_path = os.path.join(wc_dir, 'A', 'D', 'G')
+  rho_path = os.path.join(G_path, 'rho')
+
+  # Lock mu and A/D/G/rho.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'lock', mu_path, rho_path,
+                                     '-m', 'Locked')
+
+  # Now replace and propset on mu.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'rm', '--keep-local', mu_path)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'add', mu_path)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'propset', 'foo', 'bar', mu_path)
+
+  # Commit mu.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'commit', '-m', '', mu_path)
+
+  # Let's try this again where directories are involved, shall we?
+  # Replace A/D/G and A/D/G/rho, propset on A/D/G/rho.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'rm', G_path)
+  # Recreate path for single-db
+  if not os.path.exists(G_path):
+    os.mkdir(G_path)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'add', G_path)
+  svntest.main.file_append(rho_path, "This is the new file 'rho'.\n")
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'add', rho_path)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'propset', 'foo', 'bar', rho_path)
+
+  # And commit G.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'commit', '-m', '', G_path)
+
+
 ########################################################################
 # Run the tests
 
@@ -1553,6 +1617,8 @@ test_list = [ None,
               lock_twice_in_one_wc,
               lock_path_not_in_head,
               verify_path_escaping,
+              XFail(replace_and_propset_locked_path,
+                    svntest.main.is_ra_type_dav),
             ]
 
 if __name__ == '__main__':