You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by jc...@apache.org on 2010/11/21 01:48:26 UTC
svn commit: r1037363 [21/22] - in
/subversion/branches/diff-optimizations-bytes: ./ build/ build/generator/
build/generator/templates/ build/win32/ subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversi...
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/depth_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/depth_tests.py Sun Nov 21 00:48:20 2010
@@ -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/diff-optimizations-bytes/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/diff_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/diff_tests.py Sun Nov 21 00:48:20 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)
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/externals_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/externals_tests.py Sun Nov 21 00:48:20 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/diff-optimizations-bytes/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/info_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/info_tests.py Sun Nov 21 00:48:20 2010
@@ -317,7 +317,23 @@ def info_wcroot_abspaths(sbox):
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
@@ -327,6 +343,7 @@ test_list = [ None,
info_on_added_file,
info_on_mkdir,
info_wcroot_abspaths,
+ info_url_special_characters,
]
if __name__ == '__main__':
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/input_validation_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/input_validation_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/input_validation_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/input_validation_tests.py Sun Nov 21 00:48:20 2010
@@ -201,6 +201,13 @@ def invalid_lock_targets(sbox):
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)
@@ -208,6 +215,25 @@ def invalid_status_targets(sbox):
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
@@ -230,7 +256,11 @@ test_list = [ None,
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/diff-optimizations-bytes/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/lock_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/lock_tests.py Sun Nov 21 00:48:20 2010
@@ -1606,16 +1606,16 @@ def cp_isnt_ro(sbox):
open(kappa_path, 'w').write("This is the file 'kappa'.\n")
## added file
- sbox.simple_add(kappa_path)
+ sbox.simple_add('kappa')
svntest.actions.set_prop('svn:needs-lock', 'yes', kappa_path)
is_writable(kappa_path)
- sbox.simple_commit(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(mu_path)
+ sbox.simple_commit('A/mu')
is_readonly(mu_path)
# At this point, mu has 'svn:needs-lock' set
@@ -1623,13 +1623,13 @@ def cp_isnt_ro(sbox):
## wc->wc copied file
svntest.main.run_svn(None, 'copy', mu_path, mu2_path)
is_writable(mu2_path)
- sbox.simple_commit(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(mu3_path)
+ sbox.simple_commit('A/mu3')
is_readonly(mu3_path)
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_authz_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_authz_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_authz_tests.py Sun Nov 21 00:48:20 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/diff-optimizations-bytes/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_reintegrate_tests.py Sun Nov 21 00:48:20 2010
@@ -1997,7 +1997,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, {
})
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py Sun Nov 21 00:48:20 2010
@@ -9586,7 +9586,7 @@ def new_subtrees_should_not_break_merge(
'D/H/psi' : Item("This is the file 'psi'.\n"),
'D/H/omega' : Item("New content"),
'D/H/nu' : Item("New content",
- props={SVN_PROP_MERGEINFO : '/A/D/H/nu:7-8'}),
+ props={SVN_PROP_MERGEINFO : '/A/D/H/nu:8'}),
})
expected_skip = wc.State(A_COPY_path, { })
svntest.actions.run_and_verify_merge(A_COPY_path, '4', '6',
@@ -9632,7 +9632,7 @@ def new_subtrees_should_not_break_merge(
'H/psi' : Item("This is the file 'psi'.\n"),
'H/omega' : Item("This is the file 'omega'.\n"),
'H/nu' : Item("New content",
- props={SVN_PROP_MERGEINFO : '/A/D/H/nu:7-8'}),
+ props={SVN_PROP_MERGEINFO : '/A/D/H/nu:8'}),
})
expected_skip = wc.State(D_COPY_path, { })
svntest.actions.run_and_verify_merge(D_COPY_path, '6', '5',
@@ -9704,7 +9704,7 @@ def new_subtrees_should_not_break_merge(
'D/H/psi' : Item("This is the file 'psi'.\n"),
'D/H/omega' : Item("New content"),
'D/H/nu' : Item("New content",
- props={SVN_PROP_MERGEINFO : '/A/D/H/nu:7-8'}),
+ props={SVN_PROP_MERGEINFO : '/A/D/H/nu:8'}),
})
expected_skip = wc.State(A_COPY_path, { })
svntest.actions.run_and_verify_merge(A_COPY_path, '5', '6',
@@ -12804,6 +12804,13 @@ def merge_target_and_subtrees_need_nonin
None, expected_merge_output([[8]], ['U ' + nu_COPY_path + '\n',
' G ' + nu_COPY_path + '\n']),
[], 'merge', '-c8', sbox.repo_url + '/A/D/G/nu', nu_COPY_path)
+ # Replicate pre 1.7 merge behavior where self-referential mergeinfo
+ # could be inherited, this keeps the original intent of this test intact,
+ # see http://subversion.tigris.org/issues/show_bug.cgi?id=3669#desc8
+ svntest.actions.run_and_verify_svn(None, None, [], 'ps',
+ SVN_PROP_MERGEINFO, '/A/D/G/nu:2-8',
+ nu_COPY_path)
+
svntest.actions.run_and_verify_svn(
None, expected_merge_output([[-6]], ['G ' + omega_COPY_path + '\n',
' G ' + omega_COPY_path + '\n']),
@@ -15921,7 +15928,7 @@ def merge_into_locally_added_file(sbox):
svntest.main.file_append(pi_path, "foo\n")
sbox.simple_commit(); # r2
- sbox.simple_add(new_path)
+ sbox.simple_add('A/D/G/new')
expected_output = wc.State(wc_dir, {
'A/D/G/new' : Item(status='G '),
@@ -15973,7 +15980,7 @@ def merge_into_locally_added_directory(s
"This is the file 'rho'.\n")
svntest.main.file_append_binary(os.path.join(new_dir_path, 'tau'),
"This is the file 'tau'.\n")
- sbox.simple_add(new_dir_path)
+ sbox.simple_add('A/D/new_dir')
expected_output = wc.State(wc_dir, {
'A/D/new_dir/pi' : Item(status='G '),
@@ -16157,10 +16164,6 @@ def no_self_referential_or_nonexistent_i
# Update the WC in preparation for merges.
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
- # This test is marked as XFail because the following two merges
- # create mergeinfo with both non-existent path-revs and self-referential
- # mergeinfo.c
- #
# Merge all available revisions from A/C/nu to A_COPY/C/nu.
# The target has no explicit mergeinfo of its own but inherits mergeinfo
# from A_COPY. A_COPY has the mergeinfo '/A:2-9' so the naive mergeinfo
@@ -16225,6 +16228,69 @@ def no_self_referential_or_nonexistent_i
None, None, None, None,
None, 1)
+#----------------------------------------------------------------------
+# Test for issue #3756 'subtree merge can inherit invalid working mergeinfo'.
+def subtree_merges_inherit_invalid_working_mergeinfo(sbox):
+ "don't inherit bogus working mergeinfo"
+
+ # r1: Create a greek tree.
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # r2 - r6: Copy A to A_COPY and then make some text changes under A.
+ set_up_branch(sbox, nbr_of_branches=1)
+
+ # Some paths we'll care about
+ nu_path = os.path.join(wc_dir, "A", "C", "nu")
+ nu_COPY_path = os.path.join(wc_dir, "A_COPY", "C", "nu")
+ A_COPY_path = os.path.join(wc_dir, "A_COPY")
+
+ # r7 - Add the file A/C/nu
+ svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
+ svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'commit',
+ '-m', 'Add file', wc_dir)
+
+ # r8 Merge c7 from A to A_COPY.
+ svntest.actions.run_and_verify_svn(
+ "Merge failed unexpectedly",
+ svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
+ A_COPY_path, '-c7')
+ svntest.actions.run_and_verify_svn(None, None, [], 'commit',
+ '-m', 'Merge subtree file addition',
+ wc_dir)
+
+ # r9 - A text change to A/C/nu.
+ svntest.main.file_write(nu_path, "This is the EDITED file 'nu'.\n")
+ svntest.actions.run_and_verify_svn(None, None, [], 'commit',
+ '-m', 'Edit added file', wc_dir)
+
+ # Update the WC in preparation for merges.
+ svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+ # Now do two merges. The first, r3 to the root of the branch A_COPY.
+ # This creates working mergeinfo '/A:3,7' on A_COPY. Then do a subtree
+ # file merge of r9 from A/C/nu to A_COPY/C/nu. Since the target has no
+ # explicit mergeinfo, the mergeinfo set to record the merge of r9 should
+ # include the mergeinfo inherited from A_COPY. *But* that raw inherited
+ # mergeinfo, '/A/C/nu:3,7' is wholly invalid: '/A/C/nu:3' simply doesn't
+ # exist in the repository and '/A/C/nu:7' is self-referential. So the
+ # resulting mergeinfo on 'A_COPY/C/nu' should be only '/A/C/nu:9'.
+ #
+ # Currently this test is marked as XFail because the resulting mergeinfo is
+ # '/A/C/nu:3,9' and thus includes a non-existent path-rev.
+ svntest.actions.run_and_verify_svn(
+ "Merge failed unexpectedly",
+ svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
+ A_COPY_path, '-c3')
+ svntest.actions.run_and_verify_svn(
+ "Merge failed unexpectedly",
+ svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A/C/nu',
+ nu_COPY_path, '-c9')
+ svntest.actions.run_and_verify_svn(
+ "Subtree merge under working merge produced the wrong mergeinfo",
+ '/A/C/nu:9', [], 'pg', SVN_PROP_MERGEINFO, nu_COPY_path)
+
########################################################################
# Run the tests
@@ -16414,7 +16480,8 @@ test_list = [ None,
merge_into_locally_added_file,
merge_into_locally_added_directory,
merge_with_os_deleted_subtrees,
- XFail(no_self_referential_or_nonexistent_inherited_mergeinfo),
+ no_self_referential_or_nonexistent_inherited_mergeinfo,
+ XFail(subtree_merges_inherit_invalid_working_mergeinfo),
]
if __name__ == '__main__':
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/patch_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/patch_tests.py Sun Nov 21 00:48:20 2010
@@ -3356,6 +3356,128 @@ def patch_reverse_revert(sbox):
1, # dry-run
'--reverse-diff')
+def patch_one_property(sbox, trailing_eol):
+ """Helper. Apply a patch that sets the property 'k' to 'v\n' or to 'v',
+ and check the results."""
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ patch_file_path = make_patch_path(sbox)
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
+
+ # Apply patch
+
+ unidiff_patch = [
+ "Index: .\n",
+ "===================================================================\n",
+ "diff --git a/subversion/branches/1.6.x b/subversion/branches/1.6.x\n",
+ "--- a/subversion/branches/1.6.x\t(revision 1033278)\n",
+ "+++ b/subversion/branches/1.6.x\t(working copy)\n",
+ "\n",
+ "Property changes on: subversion/branches/1.6.x\n",
+ "___________________________________________________________________\n",
+ "Modified: svn:mergeinfo\n",
+ " Merged /subversion/trunk:r964349\n",
+ "Added: k\n",
+ "## -0,0 +1 ##\n",
+ "+v\n",
+ ]
+
+ if trailing_eol:
+ value = "v\n"
+ else:
+ value = "v"
+ unidiff_patch += ['\ No newline at end of property']
+
+ svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+ expected_output = [
+ ' U %s\n' % os.path.join(wc_dir),
+ ]
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({'': Item(props={'k' : value})})
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('', status=' M')
+
+ expected_skip = wc.State('.', { })
+
+ svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+ expected_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None, # expected err
+ 1, # check-props
+ 1, # dry-run
+ '--strip', '3')
+
+ if is_os_windows():
+ # On Windows 'svn pg' uses \r\n as EOL.
+ value = value.replace('\n', '\r\n')
+
+ svntest.actions.check_prop('k', wc_dir, [value])
+
+def patch_strip_cwd(sbox):
+ "patch --strip propchanges cwd"
+ return patch_one_property(sbox, True)
+
+def patch_set_prop_no_eol(sbox):
+ "patch doesn't append newline to properties"
+ return patch_one_property(sbox, False)
+
+# Regression test for issue #3697
+def patch_add_symlink(sbox):
+ "patch that adds a symlink"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ patch_file_path = make_patch_path(sbox)
+
+ # Apply patch
+
+ unidiff_patch = [
+ "Index: iota_symlink\n",
+ "===================================================================\n",
+ "--- iota_symlink\t(revision 0)\n",
+ "+++ iota_symlink\t(working copy)\n",
+ "@@ -0,0 +1 @@\n",
+ "+link iota\n",
+ "\n",
+ "Property changes on: iota_symlink\n",
+ "-------------------------------------------------------------------\n",
+ "Added: svn:special\n",
+ "## -0,0 +1 ##\n",
+ "+*\n",
+ ]
+
+ svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+ expected_output = [
+ 'A %s\n' % os.path.join(wc_dir, 'iota_symlink'),
+ ]
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({'iota_symlink': Item(contents="This is the file 'iota'.\n",
+ props={'svn:special' : '*'})})
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({'iota_symlink': Item(status='A ', wc_rev='0')})
+
+ expected_skip = wc.State('', { })
+
+ svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+ expected_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None, # expected err
+ 1, # check-props
+ 1) # dry-run
+
+
########################################################################
#Run the tests
@@ -3388,6 +3510,9 @@ test_list = [ None,
patch_git_empty_files,
patch_old_target_names,
patch_reverse_revert,
+ patch_strip_cwd,
+ XFail(patch_set_prop_no_eol),
+ SkipUnless(patch_add_symlink, svntest.main.is_posix_os),
]
if __name__ == '__main__':
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/prop_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/prop_tests.py Sun Nov 21 00:48:20 2010
@@ -55,11 +55,11 @@ def make_local_props(sbox):
wc_dir = sbox.wc_dir
# Add properties to one file and one directory
- sbox.simple_propset('blue', 'azul', sbox.ospath('A/mu'))
- sbox.simple_propset('green', 'verde', sbox.ospath('A/mu'))
- sbox.simple_propset('editme', 'the foo fighters', sbox.ospath('A/mu'))
- sbox.simple_propset('red', 'rojo', sbox.ospath('A/D/G'))
- sbox.simple_propset('yellow', 'amarillo', sbox.ospath('A/D/G'))
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('green', 'verde', 'A/mu')
+ sbox.simple_propset('editme', 'the foo fighters', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/G')
+ sbox.simple_propset('yellow', 'amarillo', 'A/D/G')
# Make sure they show up as local mods in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -69,7 +69,7 @@ def make_local_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Remove one property
- sbox.simple_propdel('yellow', sbox.ospath('A/D/G'))
+ sbox.simple_propdel('yellow', 'A/D/G')
svntest.main.use_editor('foo_to_bar')
# Edit one property
@@ -111,10 +111,8 @@ def commit_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file and a directory
- mu_path = sbox.ospath('A/mu')
- H_path = sbox.ospath('A/D/H')
- sbox.simple_propset('blue', 'azul', mu_path)
- sbox.simple_propset('red', 'rojo', H_path)
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/H')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -149,10 +147,8 @@ def update_props(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Add a property to a file and a directory
- mu_path = sbox.ospath('A/mu')
- H_path = sbox.ospath('A/D/H')
- sbox.simple_propset('blue', 'azul', mu_path)
- sbox.simple_propset('red', 'rojo', H_path)
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/H')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -170,18 +166,13 @@ def update_props(sbox):
None, wc_dir)
# Add more properties
- sbox.simple_propset('blue2', 'azul2', mu_path)
- sbox.simple_propset('red2', 'rojo2', H_path)
+ sbox.simple_propset('blue2', 'azul2', 'A/mu')
+ sbox.simple_propset('red2', 'rojo2', 'A/D/H')
expected_status.tweak('A/mu', 'A/D/H', wc_rev=3, status=' ')
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status,
None, wc_dir)
- # Overwrite mu_path and H_path to refer to the backup copies from
- # here on out.
- mu_path = sbox.ospath('A/mu', wc_dir=wc_backup)
- H_path = sbox.ospath('A/D/H', wc_dir=wc_backup)
-
# Create expected output tree for an update of the wc_backup.
expected_output = svntest.wc.State(wc_backup, {
'A/mu' : Item(status=' U'),
@@ -229,11 +220,10 @@ def downdate_props(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = sbox.ospath('iota')
mu_path = sbox.ospath('A/mu')
# Add a property to a file
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -297,14 +287,13 @@ def remove_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file
- iota_path = sbox.ospath('iota')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
# Commit the file
- sbox.simple_commit(iota_path)
+ sbox.simple_commit('iota')
# Now, remove the property
- sbox.simple_propdel('cash-sound', iota_path)
+ sbox.simple_propdel('cash-sound', 'iota')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -331,9 +320,9 @@ def update_conflict_props(sbox):
# Add a property to a file and a directory
mu_path = sbox.ospath('A/mu')
- sbox.simple_propset('cash-sound', 'cha-ching!', mu_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'A/mu')
A_path = sbox.ospath('A')
- sbox.simple_propset('foo', 'bar', A_path)
+ sbox.simple_propset('foo', 'bar', 'A')
# Commit the file and directory
sbox.simple_commit()
@@ -342,8 +331,8 @@ def update_conflict_props(sbox):
svntest.main.run_svn(None, 'up', '-r', '1', wc_dir)
# Add conflicting properties
- sbox.simple_propset('cash-sound', 'beep!', mu_path)
- sbox.simple_propset('foo', 'baz', A_path)
+ sbox.simple_propset('cash-sound', 'beep!', 'A/mu')
+ sbox.simple_propset('foo', 'baz', 'A')
# Create expected output tree for an update of the wc_backup.
expected_output = svntest.wc.State(wc_dir, {
@@ -394,7 +383,7 @@ def commit_conflict_dirprops(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- sbox.simple_propset('foo', 'bar', wc_dir)
+ sbox.simple_propset('foo', 'bar', '')
# Commit the file and directory
sbox.simple_commit()
@@ -404,7 +393,7 @@ def commit_conflict_dirprops(sbox):
'up', '-r', '1', wc_dir)
# Add conflicting properties
- sbox.simple_propset('foo', 'eek', wc_dir)
+ sbox.simple_propset('foo', 'eek', '')
svntest.actions.run_and_verify_commit(wc_dir, None, None,
"[oO]ut[- ]of[- ]date",
@@ -428,20 +417,20 @@ def commit_replacement_props(sbox):
# Add a property to two files
iota_path = sbox.ospath('iota')
lambda_path = sbox.ospath('A/B/lambda')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
- sbox.simple_propset('boson', 'W', lambda_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
+ sbox.simple_propset('boson', 'W', 'A/B/lambda')
# Commit (### someday use run_and_verify_commit for better coverage)
sbox.simple_commit()
# Schedule both files for deletion
- sbox.simple_rm(iota_path, lambda_path)
+ sbox.simple_rm('iota', 'A/B/lambda')
# Now recreate the files, and schedule them for addition.
# Poof, the 'new' files don't have any properties at birth.
svntest.main.file_append(iota_path, 'iota TNG')
svntest.main.file_append(lambda_path, 'lambda TNG')
- sbox.simple_add(iota_path, lambda_path)
+ sbox.simple_add('iota', 'A/B/lambda')
# Sanity check: the two files should be scheduled for (R)eplacement.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -451,7 +440,7 @@ def commit_replacement_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Now add a property to lambda. Iota still doesn't have any.
- sbox.simple_propset('capacitor', 'flux', lambda_path)
+ sbox.simple_propset('capacitor', 'flux', 'A/B/lambda')
# Commit, with careful output checking. We're actually going to
# scan the working copy for props after the commit.
@@ -482,20 +471,20 @@ def revert_replacement_props(sbox):
# Add a property to two files
iota_path = sbox.ospath('iota')
lambda_path = sbox.ospath('A/B/lambda')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
- sbox.simple_propset('boson', 'W', lambda_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
+ sbox.simple_propset('boson', 'W', 'A/B/lambda')
# Commit rev 2. (### someday use run_and_verify_commit for better coverage)
sbox.simple_commit()
# Schedule both files for deletion
- sbox.simple_rm(iota_path, lambda_path)
+ sbox.simple_rm('iota', 'A/B/lambda')
# Now recreate the files, and schedule them for addition.
# Poof, the 'new' files don't have any properties at birth.
svntest.main.file_append(iota_path, 'iota TNG')
svntest.main.file_append(lambda_path, 'lambda TNG')
- sbox.simple_add(iota_path, lambda_path)
+ sbox.simple_add('iota', 'A/B/lambda')
# Sanity check: the two files should be scheduled for (R)eplacement.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -505,10 +494,10 @@ def revert_replacement_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Now add a property to lambda. Iota still doesn't have any.
- sbox.simple_propset('capacitor', 'flux', lambda_path)
+ sbox.simple_propset('capacitor', 'flux', 'A/B/lambda')
# Now revert both files.
- sbox.simple_revert(iota_path, lambda_path)
+ sbox.simple_revert('iota', 'A/B/lambda')
# Do an update; even though the update is really a no-op,
# run_and_verify_update has the nice feature of scanning disk as
@@ -616,9 +605,9 @@ def inappropriate_props(sbox):
path = sbox.ospath('binary')
svntest.main.file_append(path, "binary")
- sbox.simple_add(path)
+ sbox.simple_add('binary')
- sbox.simple_propset('svn:mime-type', 'application/octet-stream', path)
+ sbox.simple_propset('svn:mime-type', 'application/octet-stream', 'binary')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -627,7 +616,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('multi-eol')
svntest.main.file_append(path, "line1\rline2\n")
- sbox.simple_add(path)
+ sbox.simple_add('multi-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -636,7 +625,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('backwards-eol')
svntest.main.file_append(path, "line1\n\r")
- sbox.simple_add(path)
+ sbox.simple_add('backwards-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -645,7 +634,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('incomplete-eol')
svntest.main.file_append(path, "line1\r\n\r")
- sbox.simple_add(path)
+ sbox.simple_add('incomplete-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -756,10 +745,10 @@ def copy_inherits_special_props(sbox):
# Create the first path as a binary file. To have svn treat the
# file as binary, have a 0x00 in the file.
svntest.main.file_append(new_path1, "binary file\000")
- sbox.simple_add(new_path1)
+ sbox.simple_add('new_file1.bin')
# Add initial svn:mime-type to the file
- sbox.simple_propset('svn:mime-type', orig_mime_type, new_path1)
+ sbox.simple_propset('svn:mime-type', orig_mime_type, 'new_file1.bin')
# Set the svn:executable property on the file if this is a system
# that can handle chmod, in which case svn will turn on the
@@ -767,7 +756,7 @@ def copy_inherits_special_props(sbox):
# manually on the file and see the value of svn:executable in the
# copied file.
if os.name == 'posix':
- sbox.simple_propset('svn:executable', 'on', new_path1)
+ sbox.simple_propset('svn:executable', 'on', 'new_file1.bin')
os.chmod(new_path1, 0644)
# Commit the file
@@ -1063,18 +1052,18 @@ def recursive_base_wc_ops(sbox):
# Files with which to test, in alphabetical order
fp_add = sbox.ospath('A/added')
fp_del = sbox.ospath('A/mu')
- fp_keep= sbox.ospath('iota')
+ #fp_keep= sbox.ospath('iota')
# Set up properties
- sbox.simple_propset('p', 'old-del', fp_del)
- sbox.simple_propset('p', 'old-keep', fp_keep)
+ sbox.simple_propset('p', 'old-del', 'A/mu')
+ sbox.simple_propset('p', 'old-keep', 'iota')
sbox.simple_commit()
svntest.main.file_append(fp_add, 'blah')
- sbox.simple_add(fp_add)
- sbox.simple_propset('p', 'new-add', fp_add)
- sbox.simple_propset('p', 'new-del', fp_del)
- sbox.simple_propset('p', 'new-keep', fp_keep)
+ sbox.simple_add('A/added')
+ sbox.simple_propset('p', 'new-add', 'A/added')
+ sbox.simple_propset('p', 'new-del', 'A/mu')
+ sbox.simple_propset('p', 'new-keep', 'iota')
svntest.main.run_svn(None, 'del', '--force', fp_del)
# Test recursive proplist
@@ -1132,21 +1121,19 @@ def url_props_ops(sbox):
prop2 = 'prop2'
propval2 = 'propval2'
- iota_path = sbox.ospath('iota')
iota_url = sbox.repo_url + '/iota'
- A_path = sbox.ospath('A')
A_url = sbox.repo_url + '/A'
# Add a couple of properties
- sbox.simple_propset(prop1, propval1, iota_path)
- sbox.simple_propset(prop1, propval1, A_path)
+ sbox.simple_propset(prop1, propval1, 'iota')
+ sbox.simple_propset(prop1, propval1, 'A')
# Commit
sbox.simple_commit()
# Add a few more properties
- sbox.simple_propset(prop2, propval2, iota_path)
- sbox.simple_propset(prop2, propval2, A_path)
+ sbox.simple_propset(prop2, propval2, 'iota')
+ sbox.simple_propset(prop2, propval2, 'A')
# Commit again
sbox.simple_commit()
@@ -1256,7 +1243,7 @@ def update_props_on_wc_root(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Add a property to the root folder
- sbox.simple_propset('red', 'rojo', wc_dir)
+ sbox.simple_propset('red', 'rojo', '')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -1301,14 +1288,14 @@ def props_on_replaced_file(sbox):
# Add some properties to iota
iota_path = sbox.ospath("iota")
- sbox.simple_propset('red', 'rojo', iota_path)
- sbox.simple_propset('blue', 'lagoon', iota_path)
+ sbox.simple_propset('red', 'rojo', 'iota')
+ sbox.simple_propset('blue', 'lagoon', 'iota')
sbox.simple_commit()
# replace iota_path
- sbox.simple_rm(iota_path)
+ sbox.simple_rm('iota')
svntest.main.file_append(iota_path, "some mod")
- sbox.simple_add(iota_path)
+ sbox.simple_add('iota')
# check that the replaced file has no properties
expected_disk = svntest.main.greek_state.copy()
@@ -1318,8 +1305,8 @@ def props_on_replaced_file(sbox):
expected_disk.old_tree())
# now add a new property to iota
- sbox.simple_propset('red', 'mojo', iota_path)
- sbox.simple_propset('groovy', 'baby', iota_path)
+ sbox.simple_propset('red', 'mojo', 'iota')
+ sbox.simple_propset('groovy', 'baby', 'iota')
# What we expect the disk tree to look like:
expected_disk.tweak('iota', props={'red' : 'mojo', 'groovy' : 'baby'})
@@ -1335,15 +1322,11 @@ def depthy_wc_proplist(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- A_path = sbox.ospath('A')
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
-
# Set up properties.
- sbox.simple_propset('p', 'prop1', wc_dir)
- sbox.simple_propset('p', 'prop2', iota_path)
- sbox.simple_propset('p', 'prop3', A_path)
- sbox.simple_propset('p', 'prop4', mu_path)
+ sbox.simple_propset('p', 'prop1', '')
+ sbox.simple_propset('p', 'prop2', 'iota')
+ sbox.simple_propset('p', 'prop3', 'A')
+ sbox.simple_propset('p', 'prop4', 'A/mu')
# Commit.
sbox.simple_commit()
@@ -1390,15 +1373,11 @@ def depthy_url_proplist(sbox):
repo_url = sbox.repo_url
wc_dir = sbox.wc_dir
- A_path = sbox.ospath('A')
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
-
# Set up properties.
- sbox.simple_propset('p', 'prop1', wc_dir)
- sbox.simple_propset('p', 'prop2', iota_path)
- sbox.simple_propset('p', 'prop3', A_path)
- sbox.simple_propset('p', 'prop4', mu_path)
+ sbox.simple_propset('p', 'prop1', '')
+ sbox.simple_propset('p', 'prop2', 'iota')
+ sbox.simple_propset('p', 'prop3', 'A')
+ sbox.simple_propset('p', 'prop4', 'A/mu')
# Test depth-empty proplist.
exit_code, output, errput = svntest.main.run_svn(None, 'proplist',
@@ -1512,18 +1491,17 @@ def remove_custom_ns_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file
- iota_path = sbox.ospath('iota')
- sbox.simple_propset('ns:cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('ns:cash-sound', 'cha-ching!', 'iota')
# Commit the file
- sbox.simple_commit(iota_path)
+ sbox.simple_commit('iota')
# Now, make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Remove the property
- sbox.simple_propdel('ns:cash-sound', iota_path)
+ sbox.simple_propdel('ns:cash-sound', 'iota')
# Create expected trees.
expected_output = svntest.wc.State(wc_dir, {
@@ -1566,8 +1544,8 @@ def props_over_time(sbox):
# Add/tweak a property 'revision' with value revision-committed to a
# file, commit, and then repeat this a few times.
for rev in range(2, 4):
- sbox.simple_propset('revision', str(rev), iota_path)
- sbox.simple_commit(iota_path)
+ sbox.simple_propset('revision', str(rev), 'iota')
+ sbox.simple_commit('iota')
# Backdate to r2 so the defaults for URL- vs. WC-style queries are
# different.
@@ -1653,18 +1631,18 @@ def same_replacement_props(sbox):
foo_path = sbox.ospath('foo')
open(foo_path, 'w').close()
- sbox.simple_add(foo_path)
- sbox.simple_propset('someprop', 'someval', foo_path)
- sbox.simple_commit(foo_path)
- sbox.simple_rm(foo_path)
+ sbox.simple_add('foo')
+ sbox.simple_propset('someprop', 'someval', 'foo')
+ sbox.simple_commit('foo')
+ sbox.simple_rm('foo')
# Now replace 'foo'.
open(foo_path, 'w').close()
- sbox.simple_add(foo_path)
+ sbox.simple_add('foo')
# Set the same property again, with the same value.
- sbox.simple_propset('someprop', 'someval', foo_path)
- sbox.simple_commit(foo_path)
+ sbox.simple_propset('someprop', 'someval', 'foo')
+ sbox.simple_commit('foo')
# Check if the property made it into the repository.
foo_url = sbox.repo_url + '/foo'
@@ -1688,8 +1666,8 @@ def added_moved_file(sbox):
open(foo_path, 'w').close()
# add it
- sbox.simple_add(foo_path)
- sbox.simple_propset('someprop', 'someval', foo_path)
+ sbox.simple_add('foo')
+ sbox.simple_propset('someprop', 'someval', 'foo')
# move it
svntest.main.run_svn(None, 'mv', foo_path, foo2_path)
@@ -1755,17 +1733,17 @@ def rm_of_replaced_file(sbox):
# Add some properties to iota and mu
iota_path = sbox.ospath('iota')
- sbox.simple_propset('red', 'rojo', iota_path)
- sbox.simple_propset('blue', 'lagoon', iota_path)
+ sbox.simple_propset('red', 'rojo', 'iota')
+ sbox.simple_propset('blue', 'lagoon', 'iota')
mu_path = sbox.ospath('A/mu')
- sbox.simple_propset('yellow', 'submarine', mu_path)
- sbox.simple_propset('orange', 'toothpick', mu_path)
+ sbox.simple_propset('yellow', 'submarine', 'A/mu')
+ sbox.simple_propset('orange', 'toothpick', 'A/mu')
sbox.simple_commit()
# Copy iota over the top of mu
- sbox.simple_rm(mu_path)
+ sbox.simple_rm('A/mu')
svntest.main.run_svn(None, 'cp', iota_path, mu_path)
expected_disk = svntest.main.greek_state.copy()
@@ -1809,7 +1787,6 @@ def prop_reject_grind(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = sbox.ospath('iota')
mu_path = sbox.ospath('A/mu')
mu_prej_path = sbox.ospath('A/mu.prej')
@@ -1817,60 +1794,60 @@ def prop_reject_grind(sbox):
# and as incoming-delete. Also set up our local-edit and local-delete
# properties. We also need some properties that are simply different
# from the incoming properties
- sbox.simple_propset('edit.diff', 'repos', iota_path)
- sbox.simple_propset('edit.edit', 'repos', iota_path)
- sbox.simple_propset('edit.del', 'repos', iota_path)
- sbox.simple_propset('edit.add', 'repos', iota_path)
- sbox.simple_propset('edit.none', 'repos', iota_path)
- sbox.simple_propset('del.edit', 'repos', iota_path)
- sbox.simple_propset('del.edit2', 'repos', iota_path)
- sbox.simple_propset('del.diff', 'repos', iota_path)
- sbox.simple_propset('del.del', 'repos', iota_path)
- sbox.simple_propset('del.add', 'repos', iota_path)
-
- sbox.simple_propset('edit.edit', 'local', mu_path)
- sbox.simple_propset('add.edit', 'local', mu_path)
- sbox.simple_propset('del.edit', 'local', mu_path)
- sbox.simple_propset('del.edit2', 'repos', mu_path)
- sbox.simple_propset('add.del', 'local', mu_path)
- sbox.simple_propset('edit.del', 'local', mu_path)
- sbox.simple_propset('del.del', 'local', mu_path)
- sbox.simple_propset('edit.diff', 'local', mu_path)
- sbox.simple_propset('add.diff', 'local', mu_path)
- sbox.simple_propset('del.diff', 'local', mu_path)
+ sbox.simple_propset('edit.diff', 'repos', 'iota')
+ sbox.simple_propset('edit.edit', 'repos', 'iota')
+ sbox.simple_propset('edit.del', 'repos', 'iota')
+ sbox.simple_propset('edit.add', 'repos', 'iota')
+ sbox.simple_propset('edit.none', 'repos', 'iota')
+ sbox.simple_propset('del.edit', 'repos', 'iota')
+ sbox.simple_propset('del.edit2', 'repos', 'iota')
+ sbox.simple_propset('del.diff', 'repos', 'iota')
+ sbox.simple_propset('del.del', 'repos', 'iota')
+ sbox.simple_propset('del.add', 'repos', 'iota')
+
+ sbox.simple_propset('edit.edit', 'local', 'A/mu')
+ sbox.simple_propset('add.edit', 'local', 'A/mu')
+ sbox.simple_propset('del.edit', 'local', 'A/mu')
+ sbox.simple_propset('del.edit2', 'repos', 'A/mu')
+ sbox.simple_propset('add.del', 'local', 'A/mu')
+ sbox.simple_propset('edit.del', 'local', 'A/mu')
+ sbox.simple_propset('del.del', 'local', 'A/mu')
+ sbox.simple_propset('edit.diff', 'local', 'A/mu')
+ sbox.simple_propset('add.diff', 'local', 'A/mu')
+ sbox.simple_propset('del.diff', 'local', 'A/mu')
sbox.simple_commit()
# Create r3 with all the properties that we intend to use as incoming-add,
# and then perform the incoming-edits and incoming-deletes.
- sbox.simple_propset('add.add', 'repos', iota_path)
- sbox.simple_propset('add.edit', 'repos', iota_path)
- sbox.simple_propset('add.del', 'repos', iota_path)
- sbox.simple_propset('add.diff', 'repos', iota_path)
- sbox.simple_propset('edit.diff', 'repos.changed', iota_path)
- sbox.simple_propset('edit.edit', 'repos.changed', iota_path)
- sbox.simple_propset('edit.del', 'repos.changed', iota_path)
- sbox.simple_propset('edit.add', 'repos.changed', iota_path)
- sbox.simple_propset('edit.none', 'repos.changed', iota_path)
- sbox.simple_propdel('del.edit', iota_path)
- sbox.simple_propdel('del.edit2', iota_path)
- sbox.simple_propdel('del.diff', iota_path)
- sbox.simple_propdel('del.del', iota_path)
- sbox.simple_propdel('del.add', iota_path)
+ sbox.simple_propset('add.add', 'repos', 'iota')
+ sbox.simple_propset('add.edit', 'repos', 'iota')
+ sbox.simple_propset('add.del', 'repos', 'iota')
+ sbox.simple_propset('add.diff', 'repos', 'iota')
+ sbox.simple_propset('edit.diff', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.edit', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.del', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.add', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.none', 'repos.changed', 'iota')
+ sbox.simple_propdel('del.edit', 'iota')
+ sbox.simple_propdel('del.edit2', 'iota')
+ sbox.simple_propdel('del.diff', 'iota')
+ sbox.simple_propdel('del.del', 'iota')
+ sbox.simple_propdel('del.add', 'iota')
sbox.simple_commit()
# Set up our victim for all the right rejects: local-adds, local-edits,
# and local-deletes.
- sbox.simple_propset('edit.add', 'local', mu_path)
- sbox.simple_propset('add.add', 'local', mu_path)
- sbox.simple_propset('del.add', 'local', mu_path)
- sbox.simple_propset('edit.edit', 'local.changed', mu_path)
- sbox.simple_propset('add.edit', 'local.changed', mu_path)
- sbox.simple_propset('del.edit', 'local.changed', mu_path)
- sbox.simple_propset('del.edit2', 'repos.changed', mu_path)
- sbox.simple_propdel('add.del', mu_path)
- sbox.simple_propdel('edit.del', mu_path)
- sbox.simple_propdel('del.del', mu_path)
+ sbox.simple_propset('edit.add', 'local', 'A/mu')
+ sbox.simple_propset('add.add', 'local', 'A/mu')
+ sbox.simple_propset('del.add', 'local', 'A/mu')
+ sbox.simple_propset('edit.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('add.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('del.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('del.edit2', 'repos.changed', 'A/mu')
+ sbox.simple_propdel('add.del', 'A/mu')
+ sbox.simple_propdel('edit.del', 'A/mu')
+ sbox.simple_propdel('del.del', 'A/mu')
# Now merge r2:3 into the victim to create all variants
svntest.main.run_svn(False, 'merge', '-r2:3', sbox.repo_url + '/iota',
@@ -1951,7 +1928,7 @@ def obstructed_subdirs(sbox):
# this test ensures we won't run into that problem again.
C_path = sbox.ospath('A/C')
- sbox.simple_propset('red', 'blue', C_path)
+ sbox.simple_propset('red', 'blue', 'A/C')
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/C', props={'red': 'blue'})
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/schedule_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/schedule_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/schedule_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/schedule_tests.py Sun Nov 21 00:48:20 2010
@@ -71,7 +71,7 @@ def add_files(sbox):
svntest.main.file_append(zeta_path, "This is the file 'zeta'.")
svntest.main.file_append(epsilon_path, "This is the file 'epsilon'.")
- sbox.simple_add(delta_path, zeta_path, epsilon_path)
+ sbox.simple_add('delta', 'A/B/zeta', 'A/D/G/epsilon')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -100,7 +100,7 @@ def add_directories(sbox):
os.mkdir(Y_path)
os.mkdir(Z_path)
- sbox.simple_add(X_path, Y_path, Z_path)
+ sbox.simple_add('X', 'A/C/Y', 'A/D/H/Z')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -150,7 +150,7 @@ def nested_adds(sbox):
svntest.main.file_append(zeta_path, "This is the file 'zeta'.")
# Finally, let's try adding our new files and directories
- sbox.simple_add(X_path, Y_path, Z_path)
+ sbox.simple_add('X', 'A/C/Y', 'A/D/H/Z')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -177,19 +177,19 @@ def add_executable(sbox):
sbox.build(read_only = True)
def runTest(wc_dir, fileName, perm, executable):
- fileName = sbox.ospath(fileName)
+ file_ospath = sbox.ospath(fileName)
if executable:
expected_out = ["*\n"]
else:
expected_out = []
# create an empty file
- open(fileName, "w")
+ open(file_ospath, "w")
- os.chmod(fileName, perm)
+ os.chmod(file_ospath, perm)
sbox.simple_add(fileName)
svntest.actions.run_and_verify_svn(None, expected_out, [],
- 'propget', "svn:executable", fileName)
+ 'propget', "svn:executable", file_ospath)
test_cases = [
("all_exe", 0777, 1),
@@ -210,12 +210,7 @@ def delete_files(sbox):
wc_dir = sbox.wc_dir
# Schedule some files for deletion
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
- rho_path = sbox.ospath('A/D/G/rho')
- omega_path = sbox.ospath('A/D/H/omega')
-
- sbox.simple_rm(iota_path, mu_path, rho_path, omega_path)
+ sbox.simple_rm('iota', 'A/mu', 'A/D/G/rho', 'A/D/H/omega')
# Make sure the deletes show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -233,17 +228,7 @@ def delete_dirs(sbox):
wc_dir = sbox.wc_dir
# Schedule some directories for deletion (this is recursive!)
- E_path = sbox.ospath('A/B/E')
- F_path = sbox.ospath('A/B/F')
- H_path = sbox.ospath('A/D/H')
- alpha_path = sbox.ospath('A/B/E/alpha')
- beta_path = sbox.ospath('A/B/E/beta')
- chi_path = sbox.ospath('A/D/H/chi')
- omega_path = sbox.ospath('A/D/H/omega')
- psi_path = sbox.ospath('A/D/H/psi')
-
- # Now, delete (recursively) the directories.
- sbox.simple_rm(E_path, F_path, H_path)
+ sbox.simple_rm('A/B/E', 'A/B/F', 'A/D/H')
# Make sure the deletes show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -430,8 +415,8 @@ def unschedule_missing_added(sbox):
svntest.main.file_append(file1_path, "This is the file 'file1'.")
svntest.main.file_append(file2_path, "This is the file 'file2'.")
- sbox.simple_add(file1_path, file2_path)
- sbox.simple_mkdir(dir1_path, dir2_path)
+ sbox.simple_add('file1', 'file2')
+ sbox.simple_mkdir('dir1', 'dir2')
# Make sure the 4 adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -456,8 +441,8 @@ def unschedule_missing_added(sbox):
svntest.main.run_svn(svntest.verify.AnyOutput, 'rm', file1_path)
### actually, the stub does not provide enough information to revert
### the addition, so this command will fail. marking as XFail
- sbox.simple_rm(dir1_path)
- sbox.simple_revert(file2_path, dir2_path)
+ sbox.simple_rm('dir1')
+ sbox.simple_revert('file2', 'dir2')
# 'svn st' should now show absolutely zero local mods.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -483,7 +468,7 @@ def delete_missing(sbox):
svntest.main.safe_rmtree(H_path)
# Now schedule them for deletion anyway, and make sure no error is output.
- sbox.simple_rm(mu_path, H_path)
+ sbox.simple_rm('A/mu', 'A/D/H')
# Commit the deletions.
expected_output = svntest.wc.State(wc_dir, {
@@ -511,18 +496,14 @@ def revert_inside_newly_added_dir(sbox):
"revert inside a newly added dir"
sbox.build(read_only = True)
- wc_dir = sbox.wc_dir
-
- os.chdir(wc_dir)
# Schedule a new directory for addition
- os.mkdir('foo')
- sbox.simple_add('foo')
+ sbox.simple_mkdir('foo')
# Now change into the newly added directory, revert and make sure
# no error is output.
- os.chdir('foo')
- sbox.simple_revert('.')
+ os.chdir(sbox.ospath('foo'))
+ svntest.main.run_svn(None, 'revert', '.')
#----------------------------------------------------------------------
# Regression test for issue #1609:
@@ -546,11 +527,11 @@ def status_add_deleted_directory(sbox):
A_path = sbox.ospath('A')
- sbox.simple_rm(A_path)
+ sbox.simple_rm('A')
svntest.main.safe_rmtree(A_path)
sbox.simple_commit()
- sbox.simple_mkdir(A_path)
+ sbox.simple_mkdir('A')
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
expected_status = svntest.wc.State(wc_dir,
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py Sun Nov 21 00:48:20 2010
@@ -340,7 +340,7 @@ test_list = [ None,
tag_trunk_with_file2_dump,
tag_trunk_with_file2_load,
dir_prop_change_dump,
- Wimp("TODO", dir_prop_change_load, svntest.main.is_ra_type_dav),
+ dir_prop_change_load,
copy_parent_modify_prop_dump,
copy_parent_modify_prop_load,
url_encoding_dump,
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py Sun Nov 21 00:48:20 2010
@@ -791,7 +791,44 @@ def commit_a_copy_of_root(sbox):
#Testcase for issue 3438.
run_test(sbox, "repo_with_copy_of_root_dir.dump")
-# issue #3641
+# issue #3641 'svnsync fails to partially copy a repository'.
+# This currently fails because while replacements with history
+# within copies are handled, replacements without history inside
+# copies cause the sync to fail:
+#
+# >svnsync synchronize %TEST_REPOS_ROOT_URL%/svnsync_tests-29-1
+# %TEST_REPOS_ROOT_URL%/svnsync_tests-29/trunk/H
+# Transmitting file data ...\..\..\subversion\svnsync\main.c:1444: (apr_err=160013)
+# ..\..\..\subversion\svnsync\main.c:1391: (apr_err=160013)
+# ..\..\..\subversion\libsvn_ra\ra_loader.c:1168: (apr_err=160013)
+# ..\..\..\subversion\libsvn_delta\path_driver.c:254: (apr_err=160013)
+# ..\..\..\subversion\libsvn_repos\replay.c:480: (apr_err=160013)
+# ..\..\..\subversion\libsvn_repos\replay.c:276: (apr_err=160013)
+# ..\..\..\subversion\libsvn_repos\replay.c:290: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:1258: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:1258: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:1236: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:931: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:742: (apr_err=160013)
+# svnsync: File not found: revision 4, path '/trunk/H/Z/B/lambda'
+#
+# See also http://svn.haxx.se/dev/archive-2010-11/0411.shtml and
+#
+### TODO: Once the above failure is fixed, delete-revprops.expected.dump
+### needs to be updated for this test to PASS!
+#
+# Note: For those who may poke around this test in the future, r3 of
+# delete-revprops.dump was created with the following svnmucc command:
+#
+# svnmucc.exe -mm cp head %ROOT_URL%-1/trunk/A %ROOT_URL%-1/trunk/H
+# rm %ROOT_URL%-1/trunk/H/B
+# cp head %ROOT_URL%-1/trunk/X %ROOT_URL%-1/trunk/B
+#
+# r4 was created with this svnmucc command:
+#
+# svnmucc.exe -mm cp head %ROOT_URL%-1/trunk/A %ROOT_URL%-1/trunk/H/Z
+# rm %ROOT_URL%-1/trunk/H/Z/B
+# mkdir %ROOT_URL%-1/trunk/H/Z/B
def descend_into_replace(sbox):
"descending into replaced dir looks in src"
run_test(sbox, "descend_into_replace.dump", subdir='/trunk/H',
@@ -867,12 +904,13 @@ test_list = [ None,
copy_bad_line_endings,
delete_svn_props,
commit_a_copy_of_root,
- descend_into_replace,
- XFail(delete_revprops),
+ XFail(descend_into_replace),
+ delete_revprops,
]
+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/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump Sun Nov 21 00:48:20 2010
@@ -350,3 +350,37 @@ Node-copyfrom-path: trunk/X
+Revision-number: 4
+Prop-content-length: 101
+Content-length: 101
+
+K 10
+svn:author
+V 6
+pburba
+K 8
+svn:date
+V 27
+2010-11-19T17:10:31.620281Z
+K 7
+svn:log
+V 1
+m
+PROPS-END
+
+Node-path: trunk/H/Z
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 3
+Node-copyfrom-path: trunk/A
+
+
+Node-path: trunk/H/Z/B
+Node-kind: dir
+Node-action: replace
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py Sun Nov 21 00:48:20 2010
@@ -74,6 +74,8 @@ from svntest import Skip
#####################################################################
# Global stuff
+default_num_threads = 5
+
class SVNProcessTerminatedBySignal(Failure):
"Exception raised if a spawned process segfaulted, aborted, etc."
pass
@@ -343,23 +345,22 @@ _safe_arg_re = re.compile(r'^[A-Za-z\d\.
def _quote_arg(arg):
"""Quote ARG for a command line.
- Simply surround every argument in double-quotes unless it contains
+ Return a quoted version of the string ARG, or just ARG if it contains
only universally harmless characters.
WARNING: This function cannot handle arbitrary command-line
- arguments. It can easily be confused by shell metacharacters. A
- perfect job would be difficult and OS-dependent (see, for example,
- http://msdn.microsoft.com/library/en-us/vccelng/htm/progs_12.asp).
- In other words, this function is just good enough for what we need
- here."""
+ arguments: it is just good enough for what we need here."""
arg = str(arg)
if _safe_arg_re.match(arg):
return arg
+
+ if windows:
+ # Note: subprocess.list2cmdline is Windows-specific.
+ return subprocess.list2cmdline([arg])
else:
- if os.name != 'nt':
- arg = arg.replace('$', '\$')
- return '"%s"' % (arg,)
+ # Quoting suitable for most Unix shells.
+ return "'" + arg.replace("'", "'\\''") + "'"
def open_pipe(command, bufsize=0, stdin=None, stdout=None, stderr=None):
"""Opens a subprocess.Popen pipe to COMMAND using STDIN,
@@ -375,15 +376,7 @@ def open_pipe(command, bufsize=0, stdin=
if (sys.platform == 'win32') and (command[0].endswith('.py')):
command.insert(0, sys.executable)
- # Quote only the arguments on Windows. Later versions of subprocess,
- # 2.5.2+ confirmed, don't require this quoting, but versions < 2.4.3 do.
- if sys.platform == 'win32':
- args = command[1:]
- args = ' '.join([_quote_arg(x) for x in args])
- command = command[0] + ' ' + args
- command_string = command
- else:
- command_string = ' '.join(command)
+ command_string = command[0] + ' ' + ' '.join(map(_quote_arg, command[1:]))
if not stdin:
stdin = subprocess.PIPE
@@ -445,6 +438,7 @@ def wait_on_pipe(waiter, binary_mode, st
if exit_code and options.verbose:
sys.stderr.write("CMD: %s exited with %d\n"
% (command_string, exit_code))
+ sys.stderr.flush()
return stdout_lines, stderr_lines, exit_code
def spawn_process(command, bufsize=0, binary_mode=0, stdin_lines=None,
@@ -1113,7 +1107,7 @@ class TestSpawningThread(threading.Threa
self.run_one(next_index)
def run_one(self, index):
- command = sys.argv[0]
+ command = os.path.abspath(sys.argv[0])
args = []
args.append(str(index))
@@ -1283,7 +1277,7 @@ def run_one_test(n, test_list, finished_
exit_code = TestRunner(test_list[n], n).run()
return exit_code
-def _internal_run_tests(test_list, testnums, parallel):
+def _internal_run_tests(test_list, testnums, parallel, srcdir, progress_func):
"""Run the tests from TEST_LIST whose indices are listed in TESTNUMS.
If we're running the tests in parallel spawn as much parallel processes
@@ -1295,10 +1289,19 @@ def _internal_run_tests(test_list, testn
finished_tests = []
tests_started = 0
+ # Some of the tests use sys.argv[0] to locate their test data
+ # directory. Perhaps we should just be passing srcdir to the tests?
+ if srcdir:
+ sys.argv[0] = os.path.join(srcdir, 'subversion', 'tests', 'cmdline',
+ sys.argv[0])
+
if not parallel:
- for testnum in testnums:
+ for i, testnum in enumerate(testnums):
if run_one_test(testnum, test_list) == 1:
exit_code = 1
+ # signal progress
+ if progress_func:
+ progress_func(i+1, len(testnums))
else:
number_queue = queue.Queue()
for num in testnums:
@@ -1317,6 +1320,10 @@ def _internal_run_tests(test_list, testn
results += t.results
results.sort()
+ # signal some kind of progress
+ if progress_func:
+ progress_func(len(testnums), len(testnums))
+
# terminate the line of dots
print("")
@@ -1344,6 +1351,7 @@ def create_default_options():
def _create_parser():
"""Return a parser for our test suite."""
# set up the parser
+ _default_http_library = 'serf'
usage = 'usage: %prog [options] [<test> ...]'
parser = optparse.OptionParser(usage=usage)
parser.add_option('-l', '--list', action='store_true', dest='list_tests',
@@ -1352,8 +1360,8 @@ def _create_parser():
help='Print binary command-lines (not with --quiet)')
parser.add_option('-q', '--quiet', action='store_true',
help='Print only unexpected results (not with --verbose)')
- parser.add_option('-p', '--parallel', action='store_const', const=5,
- dest='parallel',
+ parser.add_option('-p', '--parallel', action='store_const',
+ const=default_num_threads, dest='parallel',
help='Run the tests in parallel')
parser.add_option('-c', action='store_true', dest='is_child_process',
help='Flag if we are running this python test as a ' +
@@ -1374,7 +1382,7 @@ def _create_parser():
parser.add_option('--http-library', action='store',
help="Make svn use this DAV library (neon or serf) if " +
"it supports both, else assume it's using this " +
- "one; the default is neon")
+ "one; the default is " + _default_http_library)
parser.add_option('--server-minor-version', type='int', action='store',
help="Set the minor version for the server ('4', " +
"'5', or '6').")
@@ -1392,12 +1400,14 @@ def _create_parser():
'test output and ignores all exceptions in the ' +
'run_and_verify* functions. This option is only ' +
'useful during test development!')
+ parser.add_option('--srcdir', action='store', dest='srcdir',
+ help='Source directory.')
# most of the defaults are None, but some are other values, set them here
parser.set_defaults(
server_minor_version=7,
url=file_scheme_prefix + pathname2url(os.path.abspath(os.getcwd())),
- http_library='serf')
+ http_library=_default_http_library)
return parser
@@ -1428,10 +1438,6 @@ def _parse_options(arglist=sys.argv[1:])
return (parser, args)
-# Main func. This is the "entry point" that all the test scripts call
-# to run their list of tests.
-#
-# This routine parses sys.argv to decide what to do.
def run_tests(test_list, serial_only = False):
"""Main routine to run all tests in TEST_LIST.
@@ -1439,6 +1445,20 @@ def run_tests(test_list, serial_only = F
appropriate exit code.
"""
+ sys.exit(execute_tests(test_list, serial_only))
+
+
+# Main func. This is the "entry point" that all the test scripts call
+# to run their list of tests.
+#
+# This routine parses sys.argv to decide what to do.
+def execute_tests(test_list, serial_only = False, test_name = None,
+ progress_func = None):
+ """Similar to run_tests(), but just returns the exit code, rather than
+ exiting the process. This function can be used when a caller doesn't
+ want the process to die."""
+
+ global pristine_url
global pristine_greek_repos_url
global svn_binary
global svnadmin_binary
@@ -1448,6 +1468,9 @@ def run_tests(test_list, serial_only = F
global svnversion_binary
global options
+ if test_name:
+ sys.argv[0] = test_name
+
testnums = []
if not options:
@@ -1560,7 +1583,8 @@ def run_tests(test_list, serial_only = F
svntest.actions.setup_pristine_greek_repository()
# Run the tests.
- exit_code = _internal_run_tests(test_list, testnums, options.parallel)
+ exit_code = _internal_run_tests(test_list, testnums, options.parallel,
+ options.srcdir, progress_func)
# Remove all scratchwork: the 'pristine' repository, greek tree, etc.
# This ensures that an 'import' will happen the next time we run.
@@ -1571,4 +1595,4 @@ def run_tests(test_list, serial_only = F
svntest.sandbox.cleanup_deferred_test_paths()
# Return the appropriate exit code from the tests.
- sys.exit(exit_code)
+ return exit_code
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/sandbox.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/sandbox.py Sun Nov 21 00:48:20 2010
@@ -162,10 +162,18 @@ class Sandbox:
return self._is_built
def ospath(self, relpath, wc_dir=None):
+ """Return RELPATH converted to an OS-style path relative to the WC dir
+ of this sbox, or relative to OS-style path WC_DIR if supplied."""
if wc_dir is None:
wc_dir = self.wc_dir
return os.path.join(wc_dir, svntest.wc.to_ospath(relpath))
+ def ospaths(self, relpaths, wc_dir=None):
+ """Return a list of RELPATHS but with each path converted to an OS-style
+ path relative to the WC dir of this sbox, or relative to OS-style
+ path WC_DIR if supplied."""
+ return [self.ospath(rp, wc_dir) for rp in relpaths]
+
def redirected_root_url(self, temporary=False):
"""If TEMPORARY is set, return the URL which should be configured
to temporarily redirect to the root of this repository;
@@ -180,47 +188,61 @@ class Sandbox:
parts[1])
def simple_update(self, target=None):
+ """Update the WC or TARGET.
+ TARGET is a relpath relative to the WC."""
assert not self.read_only
if target is None:
target = self.wc_dir
+ else:
+ target = self.ospath(target)
svntest.main.run_svn(False, 'update', target)
def simple_commit(self, target=None):
+ """Commit the WC or TARGET with a default log message.
+ TARGET is a relpath relative to the WC."""
assert not self.read_only
if target is None:
target = self.wc_dir
+ else:
+ target = self.ospath(target)
svntest.main.run_svn(False, 'commit',
'-m', svntest.main.make_log_msg(),
target)
def simple_rm(self, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
- if len(targets) == 1 and is_url(targets[0]):
- assert not self.read_only
- targets = ('-m', svntests.main.make_log_msg(), targets[0])
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'rm', *targets)
def simple_mkdir(self, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
- if len(targets) == 1 and is_url(targets[0]):
- assert not self.read_only
- targets = ('-m', svntests.main.make_log_msg(), targets[0])
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'mkdir', *targets)
def simple_add(self, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'add', *targets)
def simple_revert(self, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'revert', *targets)
def simple_propset(self, name, value, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'propset', name, value, *targets)
def simple_propdel(self, name, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'propdel', name, *targets)
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/update_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/update_tests.py Sun Nov 21 00:48:20 2010
@@ -5317,7 +5317,24 @@ def update_with_file_lock_and_keywords_p
if (mu_ts_before_update != mu_ts_after_update):
print("The timestamp of 'mu' before and after update does not match.")
raise svntest.Failure
-
+
+#----------------------------------------------------------------------
+# Updating a nonexistent or deleted path should be a successful no-op,
+# when there is no incoming change. In trunk@1035343, such an update
+# within a copied directory triggered an assertion failure.
+def update_nonexistent_child_of_copy(sbox):
+ """update a nonexistent child of a copied dir"""
+ sbox.build()
+ os.chdir(sbox.wc_dir)
+
+ svntest.main.run_svn(None, 'copy', 'A', 'A2')
+
+ # Try updating a nonexistent path in the copied dir.
+ svntest.main.run_svn(None, 'update', os.path.join('A2', 'nonexistent'))
+
+ # Try updating a deleted path in the copied dir.
+ svntest.main.run_svn(None, 'delete', os.path.join('A2', 'mu'))
+ svntest.main.run_svn(None, 'update', os.path.join('A2', 'mu'))
#######################################################################
# Run the tests
@@ -5382,7 +5399,8 @@ test_list = [ None,
XFail(update_empty_hides_entries),
mergeinfo_updates_merge_with_local_mods,
update_with_excluded_subdir,
- XFail(update_with_file_lock_and_keywords_property_set)
+ XFail(update_with_file_lock_and_keywords_property_set),
+ XFail(update_nonexistent_child_of_copy),
]
if __name__ == '__main__':
Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py?rev=1037363&r1=1037362&r2=1037363&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py Sun Nov 21 00:48:20 2010
@@ -672,6 +672,47 @@ def dirs_only_upgrade(sbox):
})
run_and_verify_status_no_server(sbox.wc_dir, expected_status)
+
+def upgrade_tree_conflict_data(sbox):
+ "upgrade tree conflict data (f20->f21)"
+
+ sbox.build(create_wc = False)
+ wc_dir = sbox.wc_dir
+ replace_sbox_with_tarfile(sbox, 'upgrade_tc.tar.bz2')
+
+ # Check and see if we can still read our tree conflicts
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.tweak('A/D/G/pi', status='D ', treeconflict='C')
+ expected_status.tweak('A/D/G/tau', status='! ', treeconflict='C',
+ wc_rev=None)
+ expected_status.tweak('A/D/G/rho', status='A ', copied='+',
+ treeconflict='C', wc_rev='-')
+
+ run_and_verify_status_no_server(wc_dir, expected_status)
+
+def delete_in_copy_upgrade(sbox):
+ "upgrade a delete within a copy"
+
+ sbox.build(create_wc = False)
+ wc_dir = sbox.wc_dir
+ replace_sbox_with_tarfile(sbox, 'delete-in-copy.tar.bz2')
+
+ # Doesn't work, creates spurious base nodes for the copy
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'upgrade', sbox.wc_dir)
+
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+ expected_status.add({
+ 'A/B-copied' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A/B-copied/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B-copied/E' : Item(status='D ', wc_rev='?'),
+ 'A/B-copied/E/alpha' : Item(status='D ', wc_rev='?'),
+ 'A/B-copied/E/beta' : Item(status='D ', wc_rev='?'),
+ 'A/B-copied/F' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+ run_and_verify_status_no_server(sbox.wc_dir, expected_status)
+
+
########################################################################
# Run the tests
@@ -687,12 +728,14 @@ test_list = [ None,
# Upgrading from 1.4.0-1.4.5 with specific states fails
# See issue #2530
XFail(x3_1_4_0),
- x3_1_4_6,
- x3_1_6_12,
+ XFail(x3_1_4_6),
+ XFail(x3_1_6_12),
missing_dirs,
missing_dirs2,
XFail(delete_and_keep_local),
dirs_only_upgrade,
+ upgrade_tree_conflict_data,
+ delete_in_copy_upgrade,
]