You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/12/02 08:55:55 UTC

svn commit: r1717580 [2/2] - in /subversion/branches/ra-git: ./ build/ build/generator/ subversion/ subversion/include/ subversion/libsvn_fs/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_x/ subversion/libsvn_ra/ subversion/libsvn_ra_local/ subversion/...

Modified: subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py?rev=1717580&r1=1717579&r2=1717580&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py (original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py Wed Dec  2 07:55:55 2015
@@ -161,21 +161,8 @@ def test_svnmover2(sbox, relpath, expect
     outlines = [l.strip() for l in outlines]
     svntest.verify.verify_outputs(None, outlines, None, expected_changes, None)
 
-
-def test_svnmover(repo_url, expected_path_changes, *varargs):
-  """Run svnmover with the list of SVNMOVER_ARGS arguments.  Verify that
-  its run results in a new commit with 'svn log -rHEAD' changed paths
-  that match the list of EXPECTED_PATH_CHANGES."""
-
-  # Split arguments at spaces
-  varargs = ' '.join(varargs).split()
-  # First, run svnmover.
-  exit_code, outlines, errlines = svntest.main.run_svnmover('-U', repo_url,
-                                                            *varargs)
-  if exit_code or errlines:
-    raise svntest.main.SVNCommitFailure(str(errlines))
-  if not any(map(_commit_re.match, outlines)):
-    raise svntest.main.SVNLineUnequal(str(outlines))
+def test_svnmover_verify_log(repo_url, expected_path_changes):
+  """Run 'svn log' and verify the output"""
 
   if expected_path_changes is not None:
     # Now, run 'svn log -vq -rHEAD'
@@ -198,6 +185,23 @@ def test_svnmover(repo_url, expected_pat
                             "     actual: %s" % (str(expected_path_changes),
                                                  str(changed_paths)))
 
+def test_svnmover(repo_url, expected_path_changes, *varargs):
+  """Run svnmover with the list of SVNMOVER_ARGS arguments.  Verify that
+  its run results in a new commit with 'svn log -rHEAD' changed paths
+  that match the list of EXPECTED_PATH_CHANGES."""
+
+  # Split arguments at spaces
+  varargs = ' '.join(varargs).split()
+  # First, run svnmover.
+  exit_code, outlines, errlines = svntest.main.run_svnmover('-U', repo_url,
+                                                            *varargs)
+  if exit_code or errlines:
+    raise svntest.main.SVNCommitFailure(str(errlines))
+  if not any(map(_commit_re.match, outlines)):
+    raise svntest.main.SVNLineUnequal(str(outlines))
+
+  test_svnmover_verify_log(repo_url, expected_path_changes)
+
 def xtest_svnmover(repo_url, error_re_string, *varargs):
   """Run svnmover with the list of VARARGS arguments.  Verify that
      its run produces an error, and that the error matches ERROR_RE_STRING
@@ -1536,6 +1540,90 @@ def tree_conflict_orphan_1(sbox):
                        'mkdir orphan-parent/orphan',
                        'rm orphan-parent')
 
+@XFail()
+def replace_via_rm_cp(sbox):
+  """replace by deleting and copying"""
+
+  sbox_build_svnmover(sbox)
+                 
+  expected_eids = svntest.wc.State('', {
+    'B0'     : Item(eid=0),
+    'B0/X'   : Item(eid=1),
+    'B0.1'   : Item(eid=2),
+    'B0.1/A' : Item(eid=3),
+  })
+  test_svnmover3(sbox, '',
+                 reported_br_diff('') +
+                 reported_br_add('X'),
+                 expected_eids,
+                 'mkbranch X ' +
+                 'mkdir X/A')
+
+  expected_eids.tweak('B0.1/A', eid=4)
+  test_svnmover3(sbox, '',
+                 reported_br_diff('') +
+                 reported_del('A') +
+                 reported_add('A'),
+                 expected_eids,
+                 'rm X/A ' +
+                 'cp 1 X/A X/A')
+
+  # The compatibility layer doesn't record the replace.
+  test_svnmover_verify_log(sbox.repo_url,
+                           ['D /top0/X/A',
+                            'A /top0/X/A (from /top0/X/A:1)'])
+                 
+@XFail()
+# After making a commit, svnmover currently can't (within the same execution)
+# look up paths in the revision it just committed.
+def see_the_revision_just_committed(sbox):
+  """see the revision just committed"""
+
+  sbox_build_svnmover(sbox)
+  # Make a commit, and then check we can copy something from that committed
+  # revision.
+  test_svnmover2(sbox, '', None,
+                 'mkdir A '
+                 'commit '  # r1
+                 'cp 1 A A2 '
+                 'commit')  # r2
+  # Conversely, check we cannot copy something from a revision after a newly
+  # committed revision.
+  xtest_svnmover(sbox.repo_url, 'No such revision 4',
+                 'mkdir B '
+                 'commit '  # r3
+                 'cp 4 B B2 '
+                 'commit')  # r4
+
+
+@XFail()
+def simple_branch(sbox):
+  """simple branch"""
+  sbox_build_svnmover(sbox)
+
+  expected_eids = svntest.wc.State('', {
+    'B0'     : Item(eid=0),
+    'B0/X'   : Item(eid=1),
+    'B0.1'   : Item(eid=2),
+    'B0.1/A' : Item(eid=3),
+    'B0/Y'   : Item(eid=4),
+    'B0.4'   : Item(eid=2),
+    'B0.4/A' : Item(eid=3),
+  })
+  test_svnmover3(sbox, '',
+                 reported_br_diff('') +
+                 reported_br_add('X'),
+                 expected_eids,
+                 'mkbranch X ' +
+                 'commit ' +
+                 'mkdir X/A ' +
+                 'commit ' +
+                 'branch X Y')
+
+  # The compatibility layer doesn't record the copy properly
+  test_svnmover_verify_log(sbox.repo_url,
+                           ['A /top0/Y (from /top0/X:2)'])
+
 ######################################################################
 
 test_list = [ None,
@@ -1563,6 +1651,9 @@ test_list = [ None,
               tree_conflict_clash_2,
               tree_conflict_cycle_1,
               tree_conflict_orphan_1,
+              replace_via_rm_cp,
+              see_the_revision_just_committed,
+              simple_branch,
             ]
 
 if __name__ == '__main__':