You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/12/02 21:55:18 UTC
svn commit: r1041580 [30/35] - in
/subversion/branches/gpg-agent-password-store: ./ build/ build/ac-macros/
build/generator/ build/generator/templates/ build/win32/
contrib/hook-scripts/ contrib/server-side/ notes/http-and-webdav/
notes/wc-ng/ subversi...
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/copy_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/copy_tests.py Thu Dec 2 20:55:08 2010
@@ -38,7 +38,7 @@ SkipUnless = svntest.testcase.SkipUnless
XFail = svntest.testcase.XFail
Wimp = svntest.testcase.Wimp
Item = svntest.wc.StateItem
-
+exp_noop_up_out = svntest.actions.expected_noop_update_output
#
#----------------------------------------------------------------------
@@ -4228,7 +4228,7 @@ def reverse_merge_move(sbox):
rav_svn(None, None, [], 'co', sbox.repo_url, wc2_dir)
# Update working directory and ensure that we are at revision 1.
- rav_svn(None, ["At revision 1.\n"], [], 'up', wc_dir)
+ rav_svn(None, exp_noop_up_out(1), [], 'up', wc_dir)
# Add new folder and file, later commit
new_path = os.path.join(a_dir, 'New')
@@ -4237,12 +4237,12 @@ def reverse_merge_move(sbox):
svntest.main.file_append(first_path, 'appended first text')
svntest.main.run_svn(None, "add", new_path)
rav_svn(None, None, [], 'ci', wc_dir, '-m', 'Add new folder %s' % new_path)
- rav_svn(None, ["At revision 2.\n"], [], 'up', wc_dir)
+ rav_svn(None, exp_noop_up_out(2), [], 'up', wc_dir)
# Reverse merge to revert previous changes and commit
rav_svn(None, None, [], 'merge', '-c', '-2', a_repo_url, a_dir)
rav_svn(None, None, [], 'ci', '-m', 'Reverting svn merge -c -2.', a_dir)
- rav_svn(None, ["At revision 3.\n"], [], 'up', wc_dir)
+ rav_svn(None, exp_noop_up_out(3), [], 'up', wc_dir)
# Reverse merge again to undo last revert.
rav_svn(None, None, [], 'merge', '-c', '-3', a_repo_url, a_dir)
@@ -4332,6 +4332,8 @@ def nonrecursive_commit_of_copy(sbox):
None,
wc_dir, '--depth', 'immediates')
+# Regression test for issue #3474 - making a new subdir, moving files into it
+# and then renaming the subdir, breaks history of the moved files.
def copy_added_dir_with_copy(sbox):
"""copy of new dir with copied file keeps history"""
@@ -4358,8 +4360,6 @@ def copy_added_dir_with_copy(sbox):
'NewDir2/mu' : Item(status='A ', copied='+', wc_rev='-'),
})
- # Currently this fails because NewDir2/mu loses its history in the copy
- # from NewDir to NewDir2
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@@ -4588,7 +4588,7 @@ def changed_data_should_match_checkout(s
svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B_E, E_new)
- sbox.simple_commit(wc_dir)
+ sbox.simple_commit()
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
@@ -4618,7 +4618,7 @@ def changed_dir_data_should_match_checko
svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B, B_new)
- sbox.simple_commit(wc_dir)
+ sbox.simple_commit()
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
@@ -4679,146 +4679,6 @@ def copy_over_deleted_dir(sbox):
main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/D'),
os.path.join(sbox.wc_dir, 'A/B'))
-#----------------------------------------------------------------------
-
-def check_op_depth(path, expected_result):
- """Examine the WC DB for paths PATH and below, and check that their rows
- in the 'NODES' table match EXPECTED_RESULT. EXPECTED_RESULT is a
- dictionary of {(op_depth, relpath) -> has_repo_noderev}, where 'relpath'
- is relative to PATH, and 'has_repo_noderev' is true iff the repository
- id, revision and relpath columns are expected to be non-null.
-
- If the result does not match, raise a Failure.
- """
-
- errors = []
-
- db, _, base_relpath = svntest.wc.open_wc_db(path)
- c = db.cursor()
-
- c.execute("""SELECT op_depth, presence, local_relpath, repos_id, revision,
- repos_path FROM nodes
- WHERE local_relpath = '""" + base_relpath + """'
- OR local_relpath LIKE '""" + base_relpath + """/%'""")
- for row in c:
- op_depth = row[0]
- wc_relpath = row[2]
- repo_id = row[3]
- repo_rev = row[4]
- repo_relpath = row[5]
- relpath = wc_relpath[len(base_relpath):]
-
- try:
- has_repo = expected_result.pop((op_depth, relpath))
- except KeyError:
- errors.append("Row not expected: op_depth=%s, relpath=%s"
- % (op_depth, relpath))
- continue
-
- try:
- if has_repo:
- assert repo_id and repo_rev and repo_relpath
- else:
- assert not repo_id and not repo_rev and not repo_relpath
- except AssertionError:
- print " EXPECTED:", op_depth, relpath, has_repo
- print " ACTUAL: ", op_depth, relpath, repo_relpath
- errors.append("Row op_depth=%s, relpath=%s has repo_relpath=%s"
- % (op_depth, relpath, repo_relpath))
- continue
-
- for (op_depth, relpath) in expected_result:
- errors.append("Row not found: op_depth=%s, relpath=%s"
- % (op_depth, relpath))
-
- db.close()
-
- if errors:
- raise svntest.Failure(errors)
-
-def nodes_table_wc_wc_copies(sbox):
- """test wc-to-wc copies"""
- sbox.build()
-
- def wc_path(*components):
- return os.path.join(sbox.wc_dir, *components)
-
- # Prepare various things to copy
-
- source_base_file = wc_path('A', 'B', 'lambda')
- source_base_dir = wc_path('A', 'B', 'E')
-
- source_added_file = wc_path('A', 'B', 'file-added')
- source_added_dir = wc_path('A', 'B', 'D-added')
- source_added_dir2 = wc_path('A', 'B', 'D-added', 'D2')
-
- svntest.main.file_write(source_added_file, 'New file')
- sbox.simple_add(source_added_file)
- sbox.simple_mkdir(source_added_dir)
- sbox.simple_mkdir(source_added_dir2)
-
- source_copied_file = wc_path('A', 'B', 'lambda-copied')
- source_copied_dir = wc_path('A', 'B', 'E-copied')
-
- svntest.main.run_svn(None, 'copy', source_base_file, source_copied_file)
- svntest.main.run_svn(None, 'copy', source_base_dir, source_copied_dir)
-
- # Test copying various things
-
- # base file
- target = wc_path('A', 'C', 'copy1')
- svntest.main.run_svn(None, 'copy', source_base_file, target)
- check_op_depth(target, { (3, ''): True })
-
- # base dir
- target = wc_path('A', 'C', 'copy2')
- svntest.main.run_svn(None, 'copy', source_base_dir, target)
- check_op_depth(target, { (3, ''): True,
- (3, '/alpha'): False,
- (3, '/beta'): False })
-
- # added file
- target = wc_path('A', 'C', 'copy3')
- svntest.main.run_svn(None, 'copy', source_added_file, target)
- check_op_depth(target, { (3, ''): False })
-
- # added dir
- target = wc_path('A', 'C', 'copy4')
- svntest.main.run_svn(None, 'copy', source_added_dir, target)
- check_op_depth(target, { (3, ''): False,
- (4, '/D2'): False })
-
- # copied file
- target = wc_path('A', 'C', 'copy5')
- svntest.main.run_svn(None, 'copy', source_copied_file, target)
- check_op_depth(target, { (3, ''): True })
-
- # copied dir
- target = wc_path('A', 'C', 'copy6')
- svntest.main.run_svn(None, 'copy', source_copied_dir, target)
- check_op_depth(target, { (3, ''): True,
- (3, '/alpha'): False,
- (3, '/beta'): False })
-
- # copied tree with everything in it
- target = wc_path('A', 'C', 'copy7')
- svntest.main.run_svn(None, 'copy', wc_path('A', 'B'), target)
- check_op_depth(target, { (3, ''): True,
- (3, '/lambda'): False,
- (3, '/E'): False,
- (3, '/E/alpha'): False,
- (3, '/E/beta'): False,
- (3, '/F'): False,
- # Each add is an op_root
- (4, '/file-added'): False,
- (4, '/D-added'): False,
- (5, '/D-added/D2'): False,
- # Each copied-copy subtree is an op_root
- (4, '/lambda-copied'): True,
- (4, '/E-copied'): True,
- (4, '/E-copied/alpha'):False,
- (4, '/E-copied/beta'): False, })
-
def mixed_rev_copy_del(sbox):
"""copy mixed-rev and delete children"""
@@ -4890,6 +4750,177 @@ def mixed_rev_copy_del(sbox):
expected_status,
None,
wc_dir)
+def copy_delete_undo(sbox, use_revert):
+ "copy, delete child, undo"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Copy directory with children
+ svntest.main.run_svn(wc_dir, 'copy',
+ sbox.ospath('A/B/E'), sbox.ospath('A/B/E-copied'))
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'A/B/E-copied' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A/B/E-copied/alpha' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/E-copied/beta' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Delete a child
+ svntest.main.run_svn(wc_dir, 'rm', sbox.ospath('A/B/E-copied/alpha'))
+ expected_status.tweak('A/B/E-copied/alpha', status='D ', copied=None,
+ wc_rev='?', entry_rev='1')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Undo the whole copy
+ if (use_revert):
+ svntest.main.run_svn(wc_dir, 'revert', '--recursive',
+ sbox.ospath('A/B/E-copied'))
+ svntest.main.safe_rmtree(os.path.join(wc_dir, 'A/B/E-copied'))
+ else:
+ svntest.main.run_svn(wc_dir, 'rm', '--force', sbox.ospath('A/B/E-copied'))
+ expected_status.remove('A/B/E-copied',
+ 'A/B/E-copied/alpha',
+ 'A/B/E-copied/beta')
+
+ # Undo via revert FAILs here because a wq item remains
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Copy a directory without children.
+ svntest.main.run_svn(wc_dir, 'copy',
+ sbox.ospath('A/B/F'), sbox.ospath('A/B/E-copied'))
+ expected_status.add({
+ 'A/B/E-copied' : Item(status='A ', copied='+', wc_rev='-'),
+ })
+
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+def copy_delete_delete(sbox):
+ "copy, delete child, delete copy"
+ copy_delete_undo(sbox, False)
+
+def copy_delete_revert(sbox):
+ "copy, delete child, revert copy"
+ copy_delete_undo(sbox, True)
+
+def delete_replace_delete(sbox):
+ "delete, replace, delete"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Delete directory with children
+ svntest.main.run_svn(wc_dir, 'rm', sbox.ospath('A/B/E'))
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/B/E', 'A/B/E/alpha', 'A/B/E/beta', status='D ')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Replace with directory with different children
+ svntest.main.run_svn(wc_dir, 'copy',
+ sbox.ospath('A/D/G'), sbox.ospath('A/B/E'))
+ expected_status.tweak('A/B/E', status='R ', copied='+', wc_rev='-')
+ expected_status.add({
+ 'A/B/E/pi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/E/rho' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/E/tau' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+ # A/B/E/alpha and A/B/E/beta show up as deleted, is that right?
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Delete replacement
+ svntest.main.run_svn(wc_dir, 'rm', '--force', sbox.ospath('A/B/E'))
+ expected_status.tweak('A/B/E', status='D ', copied=None, wc_rev='1')
+ expected_status.remove('A/B/E/pi', 'A/B/E/rho', 'A/B/E/tau')
+ # Currently fails because pi, rho, tau get left behind
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+A_B_children = ['A/B/lambda', 'A/B/F', 'A/B/E/alpha', 'A/B/E/beta', 'A/B/E']
+A_D_children = ['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/psi', 'A/D/H/omega']
+
+def copy_repos_over_deleted_same_kind(sbox):
+ "copy repos node over deleted node, same kind"
+ sbox.build(read_only = True)
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+
+ # Set up some deleted paths
+ sbox.simple_rm('iota', 'A/B')
+ for path in ['iota', 'A/B'] + A_B_children:
+ expected_status.tweak(path, status='D ')
+
+ # Test copying
+ main.run_svn(None, 'cp', sbox.repo_url + '/A/mu', sbox.ospath('iota'))
+ expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
+ main.run_svn(None, 'cp', sbox.repo_url + '/A/D', sbox.ospath('A/B'))
+ expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
+ for child in A_D_children:
+ expected_status.add({ child.replace('A/D', 'A/B'):
+ Item(status=' ', wc_rev='-', copied='+')})
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+def copy_repos_over_deleted_other_kind(sbox):
+ "copy repos node over deleted node, other kind"
+ sbox.build(read_only = True)
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+
+ # Set up some deleted paths
+ sbox.simple_rm('iota', 'A/B')
+ for path in ['iota', 'A/B'] + A_B_children:
+ expected_status.tweak(path, status='D ')
+
+ # Test copying
+ main.run_svn(None, 'cp', sbox.repo_url + '/iota', sbox.ospath('A/B'))
+ expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
+ expected_status.remove(*A_B_children)
+ main.run_svn(None, 'cp', sbox.repo_url + '/A/B', sbox.ospath('iota'))
+ expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
+ for child in A_B_children:
+ expected_status.add({ child.replace('A/B', 'iota'):
+ Item(status=' ', wc_rev='-', copied='+')})
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+def copy_wc_over_deleted_same_kind(sbox):
+ "copy WC node over a deleted node, same kind"
+ sbox.build(read_only = True)
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+
+ # Set up some deleted paths
+ sbox.simple_rm('iota', 'A/B')
+ for path in ['iota', 'A/B'] + A_B_children:
+ expected_status.tweak(path, status='D ')
+
+ # Test copying
+ main.run_svn(None, 'cp', sbox.ospath('A/mu'), sbox.ospath('iota'))
+ expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
+ main.run_svn(None, 'cp', sbox.ospath('A/D'), sbox.ospath('A/B'))
+ expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
+ for child in A_D_children:
+ expected_status.add({ child.replace('A/D', 'A/B'):
+ Item(status=' ', wc_rev='-', copied='+')})
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+def copy_wc_over_deleted_other_kind(sbox):
+ "copy WC node over deleted node, other kind"
+ sbox.build(read_only = True)
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+
+ # Set up some deleted paths
+ sbox.simple_rm('iota', 'A/B')
+ for path in ['iota', 'A/B'] + A_B_children:
+ expected_status.tweak(path, status='D ')
+
+ # Test copying
+ main.run_svn(None, 'cp', sbox.ospath('A/mu'), sbox.ospath('A/B'))
+ expected_status.tweak('A/B', status='R ', wc_rev='-', copied='+')
+ expected_status.remove(*A_B_children)
+ main.run_svn(None, 'cp', sbox.ospath('A/D'), sbox.ospath('iota'))
+ expected_status.tweak('iota', status='R ', wc_rev='-', copied='+')
+ for child in A_D_children:
+ expected_status.add({ child.replace('A/D', 'iota'):
+ Item(status=' ', wc_rev='-', copied='+')})
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
########################################################################
# Run the tests
@@ -4985,8 +5016,14 @@ test_list = [ None,
XFail(changed_dir_data_should_match_checkout),
move_added_nodes,
copy_over_deleted_dir,
- Wimp("Needs NODES table & op-depth", nodes_table_wc_wc_copies),
XFail(mixed_rev_copy_del),
+ copy_delete_delete,
+ XFail(copy_delete_revert),
+ delete_replace_delete,
+ copy_repos_over_deleted_same_kind,
+ copy_repos_over_deleted_other_kind,
+ copy_wc_over_deleted_same_kind,
+ copy_wc_over_deleted_other_kind,
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/depth_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/depth_tests.py Thu Dec 2 20:55:08 2010
@@ -1062,12 +1062,12 @@ def diff_in_depthy_wc(sbox):
"@@ -1 +1 @@\n",
"-new text\n",
"+This is the file 'iota'.\n",
- "Index: .\n",
+ "Index: \n",
"===================================================================\n",
- "--- .\t(revision 2)\n",
- "+++ .\t(working copy)\n",
+ "--- \t(revision 2)\n",
+ "+++ \t(working copy)\n",
"\n",
- "Property changes on: .\n",
+ "Property changes on: \n",
"___________________________________________________________________\n",
"Deleted: foo\n",
"## -1 +0,0 ##\n",
@@ -2718,6 +2718,90 @@ def update_depth_empty_root_of_infinite_
None, None,
None, None, None, None, wc_dir)
+def sparse_update_with_dash_dash_parents(sbox):
+ """update --parents"""
+
+ sbox.build(create_wc = False)
+ sbox.add_test_path(sbox.wc_dir, True)
+ alpha_path = os.path.join(sbox.wc_dir, 'A', 'B', 'E', 'alpha')
+ pi_path = os.path.join(sbox.wc_dir, 'A', 'D', 'G', 'pi')
+ omega_path = os.path.join(sbox.wc_dir, 'A', 'D', 'H', 'omega')
+
+ # Start with a depth=empty root checkout.
+ svntest.actions.run_and_verify_svn(
+ "Unexpected error from co --depth=empty",
+ svntest.verify.AnyOutput, [],
+ "co", "--depth", "empty", sbox.repo_url, sbox.wc_dir)
+
+ # Now, let's use --parents to pull in some scattered file children.
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'A' : Item(status='A '),
+ 'A/B' : Item(status='A '),
+ 'A/B/E' : Item(status='A '),
+ 'A/B/E/alpha' : Item(status='A '),
+ })
+ expected_disk = svntest.wc.State('', {
+ 'A' : Item(contents=None),
+ 'A/B' : Item(contents=None),
+ 'A/B/E' : Item(contents=None),
+ 'A/B/E/alpha' : Item(contents="This is the file 'alpha'.\n"),
+ })
+ expected_status = svntest.wc.State(sbox.wc_dir, {
+ '' : Item(status=' ', wc_rev=1),
+ 'A' : Item(status=' ', wc_rev=1),
+ 'A/B' : Item(status=' ', wc_rev=1),
+ 'A/B/E' : Item(status=' ', wc_rev=1),
+ 'A/B/E/alpha' : Item(status=' ', wc_rev=1),
+ })
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None, False,
+ '--parents', alpha_path)
+
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'A/D' : Item(status='A '),
+ 'A/D/G' : Item(status='A '),
+ 'A/D/G/pi' : Item(status='A '),
+ })
+ expected_disk.add({
+ 'A/D' : Item(contents=None),
+ 'A/D/G' : Item(contents=None),
+ 'A/D/G/pi' : Item(contents="This is the file 'pi'.\n"),
+ })
+ expected_status.add({
+ 'A/D' : Item(status=' ', wc_rev=1),
+ 'A/D/G' : Item(status=' ', wc_rev=1),
+ 'A/D/G/pi' : Item(status=' ', wc_rev=1),
+ })
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None, False,
+ '--parents', pi_path)
+
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'A/D/H' : Item(status='A '),
+ 'A/D/H/omega' : Item(status='A '),
+ })
+ expected_disk.add({
+ 'A/D/H' : Item(contents=None),
+ 'A/D/H/omega' : Item(contents="This is the file 'omega'.\n"),
+ })
+ expected_status.add({
+ 'A/D/H' : Item(status=' ', wc_rev=1),
+ 'A/D/H/omega' : Item(status=' ', wc_rev=1),
+ })
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None, False,
+ '--parents', omega_path)
+
+
#----------------------------------------------------------------------
# list all tests here, starting with None:
test_list = [ None,
@@ -2763,6 +2847,7 @@ test_list = [ None,
tree_conflicts_resolved_depth_infinity,
update_excluded_path_sticky_depths,
update_depth_empty_root_of_infinite_children,
+ sparse_update_with_dash_dash_parents,
]
if __name__ == "__main__":
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/diff_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/diff_tests.py Thu Dec 2 20:55:08 2010
@@ -2585,9 +2585,9 @@ def basic_diff_summarize(sbox):
# Add props to some items that will be deleted, and commit.
sbox.simple_propset('prop', 'val',
- p('A/C'),
- p('A/D/gamma'),
- p('A/D/H/chi'))
+ 'A/C',
+ 'A/D/gamma',
+ 'A/D/H/chi')
sbox.simple_commit() # r2
sbox.simple_update()
@@ -2595,37 +2595,37 @@ def basic_diff_summarize(sbox):
svntest.main.file_append(p('A/mu'), 'new text\n')
# Prop modification.
- sbox.simple_propset('prop', 'val', p('iota'))
+ sbox.simple_propset('prop', 'val', 'iota')
# Both content and prop mods.
svntest.main.file_append(p('A/D/G/tau'), 'new text\n')
- sbox.simple_propset('prop', 'val', p('A/D/G/tau'))
+ sbox.simple_propset('prop', 'val', 'A/D/G/tau')
# File addition.
svntest.main.file_append(p('newfile'), 'new text\n')
svntest.main.file_append(p('newfile2'), 'new text\n')
- sbox.simple_add(p('newfile'),
- p('newfile2'))
- sbox.simple_propset('prop', 'val', p('newfile'))
+ sbox.simple_add('newfile',
+ 'newfile2')
+ sbox.simple_propset('prop', 'val', 'newfile')
# File deletion.
- sbox.simple_rm(p('A/B/lambda'),
- p('A/D/gamma'))
-
+ sbox.simple_rm('A/B/lambda',
+ 'A/D/gamma')
+
# Directory addition.
os.makedirs(p('P'))
os.makedirs(p('Q/R'))
svntest.main.file_append(p('Q/newfile'), 'new text\n')
svntest.main.file_append(p('Q/R/newfile'), 'new text\n')
- sbox.simple_add(p('P'),
- p('Q'))
+ sbox.simple_add('P',
+ 'Q')
sbox.simple_propset('prop', 'val',
- p('P'),
- p('Q/newfile'))
+ 'P',
+ 'Q/newfile')
# Directory deletion.
- sbox.simple_rm(p('A/D/H'),
- p('A/C'))
+ sbox.simple_rm('A/D/H',
+ 'A/C')
# Commit, because diff-summarize handles repos-repos only.
#svntest.main.run_svn(False, 'st', wc_dir)
@@ -2868,7 +2868,7 @@ def diff_with_depth(sbox):
diff = [
"\n",
- "Property changes on: .\n",
+ "Property changes on: \n",
"___________________________________________________________________\n",
"Added: foo1\n",
"## -0,0 +1 ##\n",
@@ -2892,7 +2892,7 @@ def diff_with_depth(sbox):
"## -0,0 +1 ##\n",
"+bar4\n"]
- dot_header = make_diff_header(".", "revision 1", "working copy")
+ 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")
@@ -2939,7 +2939,7 @@ def diff_with_depth(sbox):
svntest.actions.run_and_verify_svn(None, None, [],
'ci', '-m', '')
- dot_header = make_diff_header(".", "revision 1", "revision 2")
+ 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")
@@ -3011,12 +3011,12 @@ def diff_with_depth(sbox):
"## -1 +1 ##\n",
"-bar2\n",
"+baz2\n",
- "Index: .\n",
+ "Index: \n",
"===================================================================\n",
- "--- .\t(revision 2)\n",
- "+++ .\t(working copy)\n",
+ "--- \t(revision 2)\n",
+ "+++ \t(working copy)\n",
"\n",
- "Property changes on: .\n",
+ "Property changes on: \n",
"___________________________________________________________________\n",
"Modified: foo1\n",
"## -1 +1 ##\n",
@@ -3713,6 +3713,42 @@ def diff_git_with_props(sbox):
svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
'--git', wc_dir)
+
+def diff_git_with_props_on_dir(sbox):
+ "diff in git format showing prop changes on dir"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Now commit the local mod, creating rev 2.
+ expected_output = svntest.wc.State(wc_dir, {
+ '.' : Item(verb='Sending'),
+ })
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ '' : Item(status=' ', wc_rev=2),
+ })
+
+ svntest.main.run_svn(None, 'ps', 'a','b', wc_dir)
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ was_cwd = os.getcwd()
+ os.chdir(wc_dir)
+ expected_output = make_git_diff_header("", "", "revision 1",
+ "revision 2",
+ add=False, text_changes=False) + [
+ "\n",
+ "Property changes on: \n",
+ "___________________________________________________________________\n",
+ "Added: a\n",
+ "## -0,0 +1 ##\n",
+ "+b\n",
+ ]
+
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
+ '-c2', '--git')
+ os.chdir(was_cwd)
########################################################################
#Run the tests
@@ -3775,7 +3811,8 @@ test_list = [ None,
diff_prop_missing_context,
diff_prop_multiple_hunks,
diff_git_empty_files,
- diff_git_with_props,
+ diff_git_with_props,
+ diff_git_with_props_on_dir,
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/export_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/export_tests.py Thu Dec 2 20:55:08 2010
@@ -413,8 +413,8 @@ def export_HEADplus1_fails(sbox):
'export', sbox.repo_url, sbox.wc_dir,
'-r', 38956)
-def export_to_explicit_cwd(sbox):
- "export a single file to '.'"
+def export_url_to_explicit_cwd(sbox):
+ "export a single file to '.', via url"
sbox.build(create_wc = False, read_only = True)
svntest.main.safe_rmtree(sbox.wc_dir)
@@ -431,6 +431,47 @@ def export_to_explicit_cwd(sbox):
'.', expected_output,
expected_disk)
+def export_file_to_explicit_cwd(sbox):
+ "export a single file to '.', via wc"
+ sbox.build(create_wc = True, read_only = True)
+
+ iota_path = os.path.abspath(os.path.join(sbox.wc_dir, 'iota'))
+
+ tmpdir = sbox.get_tempname('file-exports')
+ expected_output = svntest.wc.State('', {
+ 'iota': Item(status='A '),
+ })
+ expected_disk = svntest.wc.State('', {
+ 'iota': Item(contents="This is the file 'iota'.\n"),
+ })
+
+ os.mkdir(tmpdir)
+ os.chdir(tmpdir)
+ svntest.actions.run_and_verify_export(iota_path,
+ '.', expected_output,
+ expected_disk)
+
+def export_file_overwrite_fails(sbox):
+ "exporting a file refuses to silently overwrite"
+ sbox.build(create_wc = True, read_only = True)
+
+ iota_path = os.path.abspath(os.path.join(sbox.wc_dir, 'iota'))
+ not_iota_contents = "This obstructs 'iota'.\n"
+
+ tmpdir = sbox.get_tempname('file-overwrites')
+ os.mkdir(tmpdir)
+
+ # Run it
+ open(os.path.join(tmpdir, 'iota'), 'w').write(not_iota_contents)
+ svntest.actions.run_and_verify_svn(None, [], '.*exist.*',
+ 'export', iota_path, tmpdir)
+
+ # Verify it failed
+ expected_disk = svntest.wc.State('', {
+ 'iota': Item(contents=not_iota_contents),
+ })
+ svntest.actions.verify_disk(tmpdir, expected_disk)
+
def export_ignoring_keyword_translation(sbox):
"export ignoring keyword translation"
sbox.build()
@@ -621,6 +662,36 @@ def export_externals_with_native_eol(sbo
expected_disk,
'--native-eol', 'CR')
+def export_to_current_dir(sbox):
+ "export to current dir"
+ # Issue 3727: Forced export in current dir creates unexpected subdir.
+ sbox.build(create_wc = False, read_only = True)
+
+ svntest.main.safe_rmtree(sbox.wc_dir)
+ os.mkdir(sbox.wc_dir)
+
+ orig_dir = os.getcwd()
+ os.chdir(sbox.wc_dir)
+
+ export_url = sbox.repo_url + '/A/B/E'
+ export_target = '.'
+ expected_output = svntest.wc.State('', {
+ '.' : Item(status='A '),
+ 'alpha' : Item(status='A '),
+ 'beta' : Item(status='A '),
+ })
+ expected_disk = svntest.wc.State('', {
+ 'alpha' : Item("This is the file 'alpha'.\n"),
+ 'beta' : Item("This is the file 'beta'.\n"),
+ })
+ svntest.actions.run_and_verify_export(export_url,
+ export_target,
+ expected_output,
+ expected_disk,
+ '--force')
+
+ os.chdir(orig_dir)
+
########################################################################
# Run the tests
@@ -644,12 +715,15 @@ test_list = [ None,
export_with_state_deleted,
export_creates_intermediate_folders,
export_HEADplus1_fails,
- export_to_explicit_cwd,
+ export_url_to_explicit_cwd,
+ export_file_to_explicit_cwd,
+ XFail(export_file_overwrite_fails),
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,
+ export_to_current_dir,
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/externals_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/externals_tests.py Thu Dec 2 20:55:08 2010
@@ -947,7 +947,7 @@ def old_style_externals_ignore_peg_reg(s
svntest.actions.run_and_verify_svn2("External '%s' used pegs" % ext.strip(),
None,
expected_error,
- 0,
+ 1,
'up',
wc_dir)
@@ -1063,7 +1063,7 @@ def can_place_file_external_into_dir_ext
svntest.actions.run_and_verify_svn2("Able to put file external in foreign wc",
None,
expected_error,
- 0,
+ 1,
'up',
repo_url, wc_dir)
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout Thu Dec 2 20:55:08 2010
@@ -36,6 +36,7 @@ Available subcommands:
propget (pget, pg)
proplist (plist, pl)
propset (pset, ps)
+ relocate
resolve
resolved
revert
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Thu Dec 2 20:55:08 2010
@@ -50,19 +50,16 @@ Valid options:
history
-c [--change] ARG : the change made in revision ARG
--targets ARG : pass contents of file ARG as additional args
- --stop-on-copy : do not cross copies while traversing history
- [alias: --soc]
+ --stop-on-copy [--soc] : do not cross copies while traversing history
--incremental : give output suitable for concatenation
--xml : output in XML
-l [--limit] ARG : maximum number of log entries
--with-all-revprops : retrieve all revision properties
--with-no-revprops : retrieve no revision properties
--with-revprop ARG : retrieve revision property ARG
- --show-diff : produce diff output
- [alias: --diff]
+ --diff : produce diff output
--diff-cmd ARG : use ARG as diff command
- --internal-diff : override diff-cmd specified in config file
- [alias: --idiff]
+ --internal-diff [--idiff] : override diff-cmd specified in config file
-x [--extensions] ARG : Default: '-u'. When Subversion is invoking an
external diff program, ARG is simply passed along
to the program. But when Subversion is using its
@@ -83,21 +80,19 @@ Valid options:
Global options:
--username ARG : specify a username ARG
--password ARG : specify a password ARG
- --no-auth-cache : do not cache authentication tokens
- [alias: --nac]
+ --no-auth-cache [--nac] : do not cache authentication tokens
--non-interactive : do no interactive prompting
--trust-server-cert : accept unknown SSL server certificates without
prompting (but only with '--non-interactive')
- --config-dir ARG : read user configuration files from directory ARG
- [alias: --cd]
+ --config-dir [--cd] ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
For example:
servers:global:http-library=serf
-switch (sw): Update the working copy to a different URL.
+switch (sw): Update the working copy to a different URL within the same repository.
usage: 1. switch URL[@PEGREV] [PATH]
- 2. switch --relocate FROM TO [PATH...]
+ 2. switch --relocate FROM-PREFIX TO-PREFIX [PATH...]
1. Update the working copy to mirror a new URL within the repository.
This behavior is similar to 'svn update', and is the way to
@@ -119,22 +114,15 @@ usage: 1. switch URL[@PEGREV] [PATH]
Use the --set-depth option to set a new working copy depth on the
targets of this operation.
- 2. Rewrite working copy URL metadata to reflect a syntactic change only.
- This is used when repository's root URL changes (such as a scheme
- or hostname change) but your working copy still reflects the same
- directory within the same repository.
-
- FROM is the root URL which will be relocated from.
- You can use 'svn info' to determine the root URL of the current
- working copy directory (look for 'URL:' in its output).
-
- TO is the root URL which will be relocated to.
+ 2. The '--relocate' option is deprecated. This syntax is equivalent to
+ 'svn relocate FROM-PREFIX TO-PREFIX [PATH]'.
See also 'svn help update' for a list of possible characters
reporting the action taken.
Examples:
svn switch ^/branches/1.x-release
+ svn switch --relocate http:// svn://
svn switch --relocate http://www.example.com/repo/project \
svn://svn.example.com/repo/project
@@ -149,31 +137,27 @@ Valid options:
'PREV' revision just before COMMITTED
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
- 'immediates', or 'infinity')
- --set-depth ARG : set new working copy depth to ARG ('exclude',
- 'empty', 'files', 'immediates', or 'infinity')
- [alias: --sd]
+ 'immediates', or 'infinity')
+ --set-depth [--sd] ARG : set new working copy depth to ARG ('exclude',
+ 'empty', 'files', 'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--diff3-cmd ARG : use ARG as merge command
--relocate : relocate via URL-rewriting
- --ignore-externals : ignore externals definitions
- [alias: --ie]
+ --ignore-externals [--ie] : ignore externals definitions
--force : force operation to run
--accept ARG : specify automatic conflict resolution action
- ('postpone', 'base', 'mine-conflict',
+ ('postpone', 'base', 'mine-conflict',
'theirs-conflict', 'mine-full', 'theirs-full',
'edit', 'launch')
Global options:
--username ARG : specify a username ARG
--password ARG : specify a password ARG
- --no-auth-cache : do not cache authentication tokens
- [alias: --nac]
+ --no-auth-cache [--nac] : do not cache authentication tokens
--non-interactive : do no interactive prompting
--trust-server-cert : accept unknown SSL server certificates without
prompting (but only with '--non-interactive')
- --config-dir ARG : read user configuration files from directory ARG
- [alias: --cd]
+ --config-dir [--cd] ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
For example:
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout Thu Dec 2 20:55:08 2010
@@ -36,6 +36,7 @@ Available subcommands:
propget (pget, pg)
proplist (plist, pl)
propset (pset, ps)
+ relocate
resolve
resolved
revert
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/import_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/import_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/import_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/import_tests.py Thu Dec 2 20:55:08 2010
@@ -36,6 +36,7 @@ Skip = svntest.testcase.Skip
SkipUnless = svntest.testcase.SkipUnless
XFail = svntest.testcase.XFail
Item = wc.StateItem
+exp_noop_up_out = svntest.actions.expected_noop_update_output
######################################################################
# Tests
@@ -286,7 +287,8 @@ def import_avoid_empty_revision(sbox):
svntest.main.safe_rmtree(empty_dir)
# Verify that an empty revision has not been created
- svntest.actions.run_and_verify_svn(None, [ "At revision 1.\n"],
+ svntest.actions.run_and_verify_svn(None,
+ exp_noop_up_out(1),
[], "update",
empty_dir)
#----------------------------------------------------------------------
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/info_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/info_tests.py Thu Dec 2 20:55:08 2010
@@ -285,6 +285,55 @@ def info_on_mkdir(sbox):
('depth', {}, 'infinity'),
('schedule', {}, 'add')])
+def info_wcroot_abspaths(sbox):
+ """wc root paths in 'svn info' output"""
+
+ def check_wcroot_paths(lines, wcroot_abspath):
+ "check that paths found on input lines beginning 'Path: ' are as expected"
+ path = None
+ target = None
+ for line in lines:
+ if line.startswith('Path: '):
+ target = line[6:].rstrip()
+ if line.startswith('Working Copy Root Path: '):
+ path = line[24:].rstrip()
+ if target is not None and path is not None:
+ break
+
+ if target is None:
+ target = "(UNKNOWN)"
+
+ if path is None:
+ print "No WC root path for '%s'" % (target)
+ raise svntest.Failure
+
+ if path != wcroot_abspath:
+ print("For target '%s'..." % (target))
+ print(" Reported WC root path: %s" % (path))
+ print(" Expected WC root path: %s" % (wcroot_abspath))
+ raise svntest.Failure
+
+ sbox.build(read_only=True)
+ exit_code, output, errput = svntest.main.run_svn(None, 'info', '-R', sbox.wc_dir)
+ check_wcroot_paths(output, os.path.abspath(sbox.wc_dir))
+
+def info_url_special_characters(sbox):
+ """special characters in svn info URL"""
+ sbox.build(create_wc = False)
+ wc_dir = sbox.wc_dir
+
+ special_urls = [sbox.repo_url + '/A' + '/%2E',
+ sbox.repo_url + '%2F' + 'A']
+
+ expected = {'Path' : 'A',
+ 'Repository Root' : '.*',
+ 'Revision' : '1',
+ 'Node Kind' : 'dir',
+ }
+
+ for url in special_urls:
+ svntest.actions.run_and_verify_info([expected], url)
+
########################################################################
# Run the tests
@@ -293,6 +342,8 @@ test_list = [ None,
info_with_tree_conflicts,
info_on_added_file,
info_on_mkdir,
+ info_wcroot_abspaths,
+ info_url_special_characters,
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/input_validation_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/input_validation_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/input_validation_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/input_validation_tests.py Thu Dec 2 20:55:08 2010
@@ -173,6 +173,66 @@ def invalid_wcpath_upgrade(sbox):
run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'upgrade',
target, target)
+def invalid_resolve_targets(sbox):
+ "non-working copy paths for 'resolve'"
+ sbox.build(read_only=True)
+ for target in _invalid_wc_path_targets:
+ run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'resolve',
+ '--accept', 'base', target)
+
+def invalid_resolved_targets(sbox):
+ "non-working copy paths for 'resolved'"
+ sbox.build(read_only=True)
+ for target in _invalid_wc_path_targets:
+ run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'resolved',
+ target)
+
+def invalid_revert_targets(sbox):
+ "non-working copy paths for 'revert'"
+ sbox.build(read_only=True)
+ for target in _invalid_wc_path_targets:
+ run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'revert',
+ target)
+
+def invalid_lock_targets(sbox):
+ "wc paths and repo URL target mixture for 'lock'"
+ sbox.build(read_only=True)
+ for (target1, target2) in [("iota", "^/"), ("file://", "iota")]:
+ run_and_verify_svn_in_wc(sbox, "svn: Cannot mix repository and working "
+ "copy targets", 'lock', target1, target2)
+
+def invalid_unlock_targets(sbox):
+ "wc paths and repo URL target mixture for 'unlock'"
+ sbox.build(read_only=True)
+ for (target1, target2) in [("iota", "^/"), ("file://", "iota")]:
+ run_and_verify_svn_in_wc(sbox, "svn: Cannot mix repository and working "
+ "copy targets", 'unlock', target1, target2)
+
+def invalid_status_targets(sbox):
+ "non-working copy paths for 'status'"
+ sbox.build(read_only=True)
+ for target in _invalid_wc_path_targets:
+ run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'status',
+ target)
+
+def invalid_patch_targets(sbox):
+ "non-working copy paths for 'patch'"
+ sbox.build(read_only=True)
+ for (target1, target2) in [("foo", "^/"), ("^/", "^/"), ("^/", "foo")]:
+ run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'patch',
+ target1, target2)
+
+def invalid_switch_targets(sbox):
+ "non-working copy paths for 'switch'"
+ sbox.build(read_only=True)
+ run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'switch',
+ "^/", "^/")
+
+def invalid_relocate_targets(sbox):
+ "non-working copy paths for 'relocate'"
+ sbox.build(read_only=True)
+ run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'relocate',
+ "^/", "^/", "^/")
########################################################################
# Run the tests
@@ -192,6 +252,15 @@ test_list = [ None,
invalid_log_targets,
invalid_merge_args,
invalid_wcpath_upgrade,
+ invalid_resolve_targets,
+ invalid_resolved_targets,
+ invalid_revert_targets,
+ invalid_lock_targets,
+ invalid_unlock_targets,
+ invalid_status_targets,
+ invalid_patch_targets,
+ invalid_switch_targets,
+ invalid_relocate_targets,
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/lock_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/lock_tests.py Thu Dec 2 20:55:08 2010
@@ -37,6 +37,24 @@ XFail = svntest.testcase.XFail
Item = svntest.wc.StateItem
######################################################################
+# Helpers
+
+def check_writability(path, writable):
+ bits = stat.S_IWGRP | stat.S_IWOTH | stat.S_IWRITE
+ mode = os.stat(path)[0]
+ if bool(mode & bits) != writable:
+ raise svntest.Failure("path '%s' is unexpectedly %s (mode %o)"
+ % (path, ["writable", "read-only"][writable], mode))
+
+def is_writable(path):
+ "Raise if PATH is not writable."
+ check_writability(path, True)
+
+def is_readonly(path):
+ "Raise if PATH is not readonly."
+ check_writability(path, False)
+
+######################################################################
# Tests
#----------------------------------------------------------------------
@@ -1573,6 +1591,48 @@ def replace_and_propset_locked_path(sbox
'commit', '-m', '', G_path)
+#----------------------------------------------------------------------
+def cp_isnt_ro(sbox):
+ "uncommitted svn:needs-lock add/cp not read-only"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ mu_URL = sbox.repo_url + '/A/mu'
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
+ mu2_path = os.path.join(wc_dir, 'A', 'mu2')
+ mu3_path = os.path.join(wc_dir, 'A', 'mu3')
+ kappa_path = os.path.join(wc_dir, 'kappa')
+ open(kappa_path, 'w').write("This is the file 'kappa'.\n")
+
+ ## added file
+ sbox.simple_add('kappa')
+ svntest.actions.set_prop('svn:needs-lock', 'yes', kappa_path)
+ is_writable(kappa_path)
+ sbox.simple_commit('kappa')
+ is_readonly(kappa_path)
+
+ ## versioned file
+ svntest.actions.set_prop('svn:needs-lock', 'yes', mu_path)
+ is_writable(mu_path)
+ sbox.simple_commit('A/mu')
+ is_readonly(mu_path)
+
+ # At this point, mu has 'svn:needs-lock' set
+
+ ## wc->wc copied file
+ svntest.main.run_svn(None, 'copy', mu_path, mu2_path)
+ is_writable(mu2_path)
+ sbox.simple_commit('A/mu2')
+ is_readonly(mu2_path)
+
+ ## URL->wc copied file
+ svntest.main.run_svn(None, 'copy', mu_URL, mu3_path)
+ is_writable(mu3_path)
+ sbox.simple_commit('A/mu3')
+ is_readonly(mu3_path)
+
+
########################################################################
# Run the tests
@@ -1619,6 +1679,7 @@ test_list = [ None,
verify_path_escaping,
XFail(replace_and_propset_locked_path,
svntest.main.is_ra_type_dav),
+ cp_isnt_ro,
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/log_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/log_tests.py Thu Dec 2 20:55:08 2010
@@ -35,6 +35,9 @@ from svntest.main import server_has_merg
from svntest.main import SVN_PROP_MERGEINFO
from merge_tests import set_up_branch
+# (abbreviation)
+exp_noop_up_out = svntest.actions.expected_noop_update_output
+
######################################################################
#
# The Plan:
@@ -298,7 +301,8 @@ def merge_history_repos(sbox):
# Mergeinfo changes on /trunk:
# Merged /branches/a:r7
os.chdir('trunk')
- svntest.main.run_svn(None, 'merge', '--record-only', '-r6:7',
+ svntest.main.run_svn(None, 'merge', '--allow-mixed-revisions',
+ '--record-only', '-r6:7',
os.path.join('..', branch_a))
svntest.main.run_svn(None, 'ci', '-m',
"Block r7 from merging to trunk.",
@@ -392,7 +396,8 @@ def merge_history_repos(sbox):
# Merged /trunk:r2
# Merged /branches/c:r3-16
os.chdir('trunk')
- svntest.main.run_svn(None, 'merge', os.path.join('..', branch_c) + '@HEAD')
+ svntest.main.run_svn(None, 'merge', '--allow-mixed-revisions',
+ os.path.join('..', branch_c) + '@HEAD')
svntest.main.file_write(os.path.join('A', 'mu'),
"This is the file 'mu'.\n" +
"Don't forget to look at 'upsilon', as well.\n" +
@@ -1562,7 +1567,8 @@ def merge_sensitive_log_added_mergeinfo_
# Reverse merge r3 from 'A/D/H' to 'A_COPY/D/H' and commit as r8.
# First update the wc so mergeinfo inheritance can occur. This is
# necessary so A_COPY/D/H 'knows' that r3 has been merged into it.
- svntest.actions.run_and_verify_svn(None, ["At revision 7.\n"], [],
+ svntest.actions.run_and_verify_svn(None,
+ exp_noop_up_out(7), [],
'up', wc_dir)
wc_status.tweak(wc_rev=7)
expected_output = wc.State(H_COPY_path, {
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/merge_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/merge_authz_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/merge_authz_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/merge_authz_tests.py Thu Dec 2 20:55:08 2010
@@ -689,9 +689,10 @@ test_list = [ None,
svntest.main.is_ra_type_file),
svntest.main.server_has_mergeinfo),
]
+serial_only = True
if __name__ == '__main__':
- svntest.main.run_tests(test_list, serial_only = True)
+ svntest.main.run_tests(test_list, serial_only = serial_only)
# NOTREACHED
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/merge_reintegrate_tests.py Thu Dec 2 20:55:08 2010
@@ -37,6 +37,7 @@ Item = wc.StateItem
XFail = svntest.testcase.XFail
Skip = svntest.testcase.Skip
SkipUnless = svntest.testcase.SkipUnless
+exp_noop_up_out = svntest.actions.expected_noop_update_output
from svntest.main import SVN_PROP_MERGEINFO
from svntest.main import server_has_mergeinfo
@@ -669,7 +670,7 @@ def reintegrate_fail_on_modified_wc(sbox
svntest.actions.run_and_verify_merge(
A_path, None, None, sbox.repo_url + '/A_COPY', None, None, None, None,
None, None, None,
- ".*Cannot reintegrate into a working copy that has local modifications.*",
+ ".*Cannot merge into a working copy that has local modifications.*",
None, None, None, None, True, False, '--reintegrate', A_path)
#----------------------------------------------------------------------
@@ -692,7 +693,7 @@ def reintegrate_fail_on_mixed_rev_wc(sbo
svntest.actions.run_and_verify_merge(
A_path, None, None, sbox.repo_url + '/A_COPY', None, None, None, None,
None, None, None,
- ".*Cannot reintegrate into mixed-revision working copy.*",
+ ".*Cannot merge into mixed-revision working copy.*",
None, None, None, None, True, False, '--reintegrate', A_path)
#----------------------------------------------------------------------
@@ -737,7 +738,7 @@ def reintegrate_fail_on_switched_wc(sbox
svntest.actions.run_and_verify_merge(
A_path, None, None, sbox.repo_url + '/A_COPY', None, None, None, None,
None, None, None,
- ".*Cannot reintegrate into a working copy with a switched subtree.*",
+ ".*Cannot merge into a working copy with a switched subtree.*",
None, None, None, None, True, False, '--reintegrate', A_path)
#----------------------------------------------------------------------
@@ -1005,7 +1006,7 @@ def reintegrate_with_subtree_mergeinfo(s
# r10 - Merge r9 from A_COPY_3/D to A/D, creating explicit subtree
# mergeinfo under A. For this and every subsequent merge we update the WC
# first to allow full inheritance and elision.
- svntest.actions.run_and_verify_svn(None, ["At revision 9.\n"], [], 'up',
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
wc_dir)
expected_status.tweak(wc_rev=9)
svntest.actions.run_and_verify_svn(
@@ -1032,7 +1033,7 @@ def reintegrate_with_subtree_mergeinfo(s
expected_disk.tweak('A_COPY_2/mu', contents="New content")
# r12 - Merge r11 from A_COPY_2/mu to A_COPY/mu
- svntest.actions.run_and_verify_svn(None, ["At revision 11.\n"], [], 'up',
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(11), [], 'up',
wc_dir)
expected_status.tweak(wc_rev=11)
svntest.actions.run_and_verify_svn(
@@ -1050,7 +1051,7 @@ def reintegrate_with_subtree_mergeinfo(s
# r13 - Do a 'synch' cherry harvest merge of all available revisions
# from A to A_COPY
- svntest.actions.run_and_verify_svn(None, ["At revision 12.\n"], [], 'up',
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(12), [], 'up',
wc_dir)
expected_status.tweak(wc_rev=12)
svntest.actions.run_and_verify_svn(
@@ -1105,7 +1106,7 @@ def reintegrate_with_subtree_mergeinfo(s
expected_disk.tweak('A_COPY/B/E/alpha', contents="New content")
# Now, reintegrate A_COPY to A. This should succeed.
- svntest.actions.run_and_verify_svn(None, ["At revision 14.\n"], [], 'up',
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(14), [], 'up',
wc_dir)
expected_status.tweak(wc_rev=14)
expected_output = wc.State(A_path, {
@@ -1319,7 +1320,7 @@ def reintegrate_with_subtree_mergeinfo(s
' U ' + A_COPY_path + '\n',
' U ' + D_COPY_path + '\n',
' U ' + gamma_moved_COPY_path + '\n']),
- [], 'merge', sbox.repo_url + '/A', A_COPY_path)
+ [], 'merge', '--allow-mixed-revisions', sbox.repo_url + '/A', A_COPY_path)
expected_output = wc.State(
wc_dir,
{'A_COPY' : Item(verb='Sending'), # Mergeinfo update
@@ -1341,7 +1342,7 @@ def reintegrate_with_subtree_mergeinfo(s
# /A_COPY/D/gamma_moved:17-19
#
# shows that it is fully synched up with trunk.
- svntest.actions.run_and_verify_svn(None, ["At revision 19.\n"], [], 'up',
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(19), [], 'up',
wc_dir)
expected_output = wc.State(A_path, {
'B/E/alpha' : Item(status='U '),
@@ -1611,7 +1612,7 @@ def multiple_reintegrates_from_the_same_
expected_merge_output([[2,3],[2,16]],
['U ' + psi_COPY_path + '\n',
' U ' + A_COPY_path + '\n',]),
- [], 'merge', sbox.repo_url + '/A', A_COPY_path)
+ [], 'merge', '--allow-mixed-revisions', sbox.repo_url + '/A', A_COPY_path)
#----------------------------------------------------------------------
# Test for a reintegrate bug which can occur when the merge source
@@ -1638,7 +1639,7 @@ def reintegrate_with_self_referential_me
# r6 Copy A to A2 and then manually set some self-referential mergeinfo on
# A2/B and A2.
- svntest.actions.run_and_verify_svn(None, ["At revision 5.\n"], [],
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(5), [],
'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [],
'copy', A_path, A2_path)
@@ -1669,7 +1670,7 @@ def reintegrate_with_self_referential_me
# Update to uniform revision and reintegrate A2.1 back to A2.
# Note that the mergeinfo on A2/B is not changed by the reintegration
# and so is not expected to by updated to describe the merge.
- svntest.actions.run_and_verify_svn(None, ["At revision 8.\n"], [],
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
'up', wc_dir)
expected_output = wc.State(A2_path, {
'mu' : Item(status='U '),
@@ -1997,7 +1998,7 @@ def added_subtrees_with_mergeinfo_break_
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
- 'C/nu' : Item(status=' G'),
+ 'C/nu' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})