You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/06/27 17:13:42 UTC
svn commit: r1354571 [34/37] - in /subversion/branches/master-passphrase: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/emacs/ contrib/server-side/ notes/
notes/api-errata/1.8/ notes/directory-i...
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests.py?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests.py Wed Jun 27 15:12:37 2012
@@ -28,13 +28,12 @@
import sys, os
# Test suite-specific modules
-import locale, re, urllib
+import re, urllib
# Our testing module
import svntest
from svntest.verify import SVNUnexpectedStdout, SVNUnexpectedStderr
from svntest.verify import SVNExpectedStderr
-from svntest.main import write_restrictive_svnserve_conf
from svntest.main import server_has_partial_replay
# (abbreviation)
@@ -385,349 +384,6 @@ def detect_meddling(sbox):
run_sync(dest_sbox.repo_url, None,
".*Destination HEAD \\(2\\) is not the last merged revision \\(1\\).*")
-#----------------------------------------------------------------------
-@Skip(svntest.main.is_ra_type_file)
-def basic_authz(sbox):
- "verify that unreadable content is not synced"
-
- sbox.build("svnsync-basic-authz")
-
- write_restrictive_svnserve_conf(sbox.repo_dir)
-
- dest_sbox = sbox.clone_dependent()
- build_repos(dest_sbox)
-
- svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
-
- run_init(dest_sbox.repo_url, sbox.repo_url)
-
- args = tuple(s.authz_name() for s in [sbox, sbox, dest_sbox])
- svntest.main.file_write(sbox.authz_file,
- "[%s:/]\n"
- "* = r\n"
- "\n"
- "[%s:/A/B]\n"
- "* = \n"
- "\n"
- "[%s:/]\n"
- "* = rw\n" % args)
-
- run_sync(dest_sbox.repo_url)
-
- lambda_url = dest_sbox.repo_url + '/A/B/lambda'
- iota_url = dest_sbox.repo_url + '/iota'
-
- # this file should have been blocked by authz
- svntest.actions.run_and_verify_svn(None,
- [], svntest.verify.AnyOutput,
- 'cat',
- lambda_url)
- # this file should have been synced
- svntest.actions.run_and_verify_svn(None,
- svntest.verify.AnyOutput, [],
- 'cat',
- iota_url)
-
-#----------------------------------------------------------------------
-@Skip(svntest.main.is_ra_type_file)
-def copy_from_unreadable_dir(sbox):
- "verify that copies from unreadable dirs work"
-
- sbox.build("svnsync-copy-from-unreadable-dir")
-
- B_url = sbox.repo_url + '/A/B'
- P_url = sbox.repo_url + '/A/P'
-
- # Set a property on the directory we're going to copy, and a file in it, to
- # confirm that they're transmitted when we later sync the copied directory
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'pset',
- 'foo',
- 'bar',
- sbox.wc_dir + '/A/B/lambda')
-
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'pset',
- 'baz',
- 'zot',
- sbox.wc_dir + '/A/B')
-
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'ci',
- sbox.wc_dir + '/A/B',
- '-m', 'log_msg')
-
- # Now copy that directory so we'll see it in our synced copy
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'cp',
- B_url,
- P_url,
- '-m', 'Copy B to P')
-
- write_restrictive_svnserve_conf(sbox.repo_dir)
-
- dest_sbox = sbox.clone_dependent()
- build_repos(dest_sbox)
-
- svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
-
- args = tuple(s.authz_name() for s in [sbox, sbox, dest_sbox])
- open(sbox.authz_file, 'w').write(
- "[%s:/]\n"
- "* = r\n"
- "\n"
- "[%s:/A/B]\n"
- "* = \n"
- "\n"
- "[%s:/]\n"
- "* = rw"
- % args)
-
- run_init(dest_sbox.repo_url, sbox.repo_url)
-
- run_sync(dest_sbox.repo_url)
-
- expected_out = [
- 'Changed paths:\n',
- ' A /A/P\n',
- ' A /A/P/E\n',
- ' A /A/P/E/alpha\n',
- ' A /A/P/E/beta\n',
- ' A /A/P/F\n',
- ' A /A/P/lambda\n',
- '\n',
- '\n', # log message is stripped
- ]
-
- exit_code, out, err = svntest.main.run_svn(None,
- 'log',
- '-r', '3',
- '-v',
- dest_sbox.repo_url)
-
- if err:
- raise SVNUnexpectedStderr(err)
-
- svntest.verify.compare_and_display_lines(None,
- 'LOG',
- expected_out,
- out[2:11])
-
- svntest.actions.run_and_verify_svn(None,
- ['bar\n'],
- [],
- 'pget',
- 'foo',
- dest_sbox.repo_url + '/A/P/lambda')
-
- svntest.actions.run_and_verify_svn(None,
- ['zot\n'],
- [],
- 'pget',
- 'baz',
- dest_sbox.repo_url + '/A/P')
-
-# Issue 2705.
-@Issue(2705)
-@Skip(svntest.main.is_ra_type_file)
-def copy_with_mod_from_unreadable_dir(sbox):
- "verify copies with mods from unreadable dirs"
-
- sbox.build("svnsync-copy-with-mod-from-unreadable-dir")
-
- # Make a copy of the B directory.
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'cp',
- sbox.wc_dir + '/A/B',
- sbox.wc_dir + '/A/P')
-
- # Set a property inside the copied directory.
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'pset',
- 'foo',
- 'bar',
- sbox.wc_dir + '/A/P/lambda')
-
- # Add a new directory and file inside the copied directory.
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'mkdir',
- sbox.wc_dir + '/A/P/NEW-DIR')
-
- svntest.main.file_append(sbox.wc_dir + '/A/P/E/new-file', "bla bla")
- svntest.main.run_svn(None, 'add', sbox.wc_dir + '/A/P/E/new-file')
-
- # Delete a file inside the copied directory.
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'rm',
- sbox.wc_dir + '/A/P/E/beta')
-
- # Commit the copy-with-modification.
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'ci',
- sbox.wc_dir,
- '-m', 'log_msg')
-
- # Lock down the source repository.
- write_restrictive_svnserve_conf(sbox.repo_dir)
-
- dest_sbox = sbox.clone_dependent()
- build_repos(dest_sbox)
-
- svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
-
- args = tuple(s.authz_name() for s in [sbox, sbox, dest_sbox])
- open(sbox.authz_file, 'w').write(
- "[%s:/]\n"
- "* = r\n"
- "\n"
- "[%s:/A/B]\n"
- "* = \n"
- "\n"
- "[%s:/]\n"
- "* = rw"
- % args)
-
- run_init(dest_sbox.repo_url, sbox.repo_url)
-
- run_sync(dest_sbox.repo_url)
-
- expected_out = [
- 'Changed paths:\n',
- ' A /A/P\n',
- ' A /A/P/E\n',
- ' A /A/P/E/alpha\n',
- ' A /A/P/E/new-file\n',
- ' A /A/P/F\n',
- ' A /A/P/NEW-DIR\n',
- ' A /A/P/lambda\n',
- '\n',
- '\n', # log message is stripped
- ]
-
- exit_code, out, err = svntest.main.run_svn(None,
- 'log',
- '-r', '2',
- '-v',
- dest_sbox.repo_url)
-
- if err:
- raise SVNUnexpectedStderr(err)
-
- svntest.verify.compare_and_display_lines(None,
- 'LOG',
- expected_out,
- out[2:12])
-
- svntest.actions.run_and_verify_svn(None,
- ['bar\n'],
- [],
- 'pget',
- 'foo',
- dest_sbox.repo_url + '/A/P/lambda')
-
-# Issue 2705.
-@Issue(2705)
-@Skip(svntest.main.is_ra_type_file)
-def copy_with_mod_from_unreadable_dir_and_copy(sbox):
- "verify copies with mods from unreadable dirs +copy"
-
- sbox.build("svnsync-copy-with-mod-from-unreadable-dir-and-copy")
-
- # Make a copy of the B directory.
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'cp',
- sbox.wc_dir + '/A/B',
- sbox.wc_dir + '/A/P')
-
-
- # Copy a (readable) file into the copied directory.
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'cp',
- sbox.wc_dir + '/A/D/gamma',
- sbox.wc_dir + '/A/P/E')
-
-
- # Commit the copy-with-modification.
- svntest.actions.run_and_verify_svn(None,
- None,
- [],
- 'ci',
- sbox.wc_dir,
- '-m', 'log_msg')
-
- # Lock down the source repository.
- write_restrictive_svnserve_conf(sbox.repo_dir)
-
- dest_sbox = sbox.clone_dependent()
- build_repos(dest_sbox)
-
- svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
-
- args = tuple(s.authz_name() for s in [sbox, sbox, dest_sbox])
- open(sbox.authz_file, 'w').write(
- "[%s:/]\n"
- "* = r\n"
- "\n"
- "[%s:/A/B]\n"
- "* = \n"
- "\n"
- "[%s:/]\n"
- "* = rw"
- % args)
-
- run_init(dest_sbox.repo_url, sbox.repo_url)
-
- run_sync(dest_sbox.repo_url)
-
- expected_out = [
- 'Changed paths:\n',
- ' A /A/P\n',
- ' A /A/P/E\n',
- ' A /A/P/E/alpha\n',
- ' A /A/P/E/beta\n',
- ' A /A/P/E/gamma (from /A/D/gamma:1)\n',
- ' A /A/P/F\n',
- ' A /A/P/lambda\n',
- '\n',
- '\n', # log message is stripped
- ]
-
- exit_code, out, err = svntest.main.run_svn(None,
- 'log',
- '-r', '2',
- '-v',
- dest_sbox.repo_url)
-
- if err:
- raise SVNUnexpectedStderr(err)
-
- svntest.verify.compare_and_display_lines(None,
- 'LOG',
- expected_out,
- out[2:12])
-
def url_encoding(sbox):
"test url encoding issues"
run_test(sbox, "url-encoding-bug.dump")
@@ -823,28 +479,6 @@ def copy_bad_encoding(sbox):
exp_dump_file_name="copy-bad-encoding.expected.dump",
bypass_prop_validation=True, source_prop_encoding="ISO-8859-3")
-def identity_copy(sbox):
- "copy UTF-8 svn:* props identically"
- orig_lc_all = locale.setlocale(locale.LC_ALL)
- other_locales = [ "English.1252", "German.1252", "French.1252",
- "en_US.ISO-8859-1", "en_GB.ISO-8859-1", "de_DE.ISO-8859-1",
- "en_US.ISO8859-1", "en_GB.ISO8859-1", "de_DE.ISO8859-1" ]
- for other_locale in other_locales:
- try:
- locale.setlocale(locale.LC_ALL, other_locale)
- break
- except:
- pass
- if locale.setlocale(locale.LC_ALL) != other_locale:
- raise svntest.Skip
-
- try:
- run_test(sbox, "copy-bad-encoding.expected.dump",
- exp_dump_file_name="copy-bad-encoding.expected.dump",
- bypass_prop_validation=True)
- finally:
- locale.setlocale(locale.LC_ALL, orig_lc_all)
-
#----------------------------------------------------------------------
def delete_svn_props(sbox):
@@ -858,66 +492,6 @@ def commit_a_copy_of_root(sbox):
run_test(sbox, "repo-with-copy-of-root-dir.dump")
-@Skip(svntest.main.is_ra_type_file)
-def specific_deny_authz(sbox):
- "verify if specifically denied paths dont sync"
-
- sbox.build("specific-deny-authz")
-
- dest_sbox = sbox.clone_dependent()
- build_repos(dest_sbox)
-
- svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
-
- run_init(dest_sbox.repo_url, sbox.repo_url)
-
- svntest.main.run_svn(None, "cp",
- os.path.join(sbox.wc_dir, "A"),
- os.path.join(sbox.wc_dir, "A_COPY")
- )
- svntest.main.run_svn(None, "ci", "-mm", sbox.wc_dir)
-
- write_restrictive_svnserve_conf(sbox.repo_dir)
-
- # For mod_dav_svn's parent path setup we need per-repos permissions in
- # the authz file...
- if sbox.repo_url.startswith('http'):
- svntest.main.file_write(sbox.authz_file,
- "[specific-deny-authz:/]\n"
- "* = r\n"
- "\n"
- "[specific-deny-authz:/A]\n"
- "* = \n"
- "\n"
- "[specific-deny-authz:/A_COPY/B/lambda]\n"
- "* = \n"
- "\n"
- "[specific-deny-authz-1:/]\n"
- "* = rw\n")
- # Otherwise we can just go with the permissions needed for the source
- # repository.
- else:
- svntest.main.file_write(sbox.authz_file,
- "[/]\n"
- "* = r\n"
- "\n"
- "[/A]\n"
- "* = \n"
- "\n"
- "[/A_COPY/B/lambda]\n"
- "* = \n")
-
- run_sync(dest_sbox.repo_url)
-
- lambda_url = dest_sbox.repo_url + '/A_COPY/B/lambda'
-
- # this file should have been blocked by authz
- svntest.actions.run_and_verify_svn(None,
- [], svntest.verify.AnyOutput,
- 'cat',
- lambda_url)
-
-
# 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
@@ -1002,44 +576,6 @@ def fd_leak_sync_from_serf_to_local(sbox
resource.setrlimit(resource.RLIMIT_NOFILE, (128, 128))
run_test(sbox, "largemods.dump", is_src_ra_local=None, is_dest_ra_local=True)
-@Issue(4121)
-@Skip(svntest.main.is_ra_type_file)
-def copy_delete_unreadable_child(sbox):
- "copy, then rm at-src-unreadable child"
-
- # Prepare the source: Greek tree (r1), cp+rm (r2).
- sbox.build("copy-delete-unreadable-child")
- svntest.actions.run_and_verify_svnmucc(None, None, [],
- '-m', 'r2',
- '-U', sbox.repo_url,
- 'cp', 'HEAD', '/', 'branch',
- 'rm', 'branch/A')
-
- # Create the destination.
- dest_sbox = sbox.clone_dependent()
- build_repos(dest_sbox)
- svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
-
- # Lock down the source.
- authz = sbox.authz_name()
- write_restrictive_svnserve_conf(sbox.repo_dir, anon_access='read')
- svntest.main.file_write(sbox.authz_file,
- "[%s:/]\n"
- "* = r\n"
- "[%s:/A]\n"
- "* = \n"
- % (authz, authz))
-
- dest_url = svntest.main.file_scheme_prefix \
- + urllib.pathname2url(os.path.abspath(dest_sbox.repo_dir))
- run_init(dest_url, sbox.repo_url)
- run_sync(dest_url)
-
- # sanity check
- svntest.actions.run_and_verify_svn(None,
- ["iota\n"], [],
- 'ls', dest_url+'/branch@2')
-
########################################################################
# Run the tests
@@ -1060,10 +596,6 @@ test_list = [ None,
file_dir_file,
copy_parent_modify_prop,
detect_meddling,
- basic_authz,
- copy_from_unreadable_dir,
- copy_with_mod_from_unreadable_dir,
- copy_with_mod_from_unreadable_dir_and_copy,
url_encoding,
no_author,
copy_revprops,
@@ -1075,19 +607,15 @@ test_list = [ None,
copy_bad_line_endings,
copy_bad_line_endings2,
copy_bad_encoding,
- identity_copy,
delete_svn_props,
commit_a_copy_of_root,
- specific_deny_authz,
descend_into_replace,
delete_revprops,
fd_leak_sync_from_serf_to_local, # calls setrlimit
- copy_delete_unreadable_child,
]
-serial_only = True
if __name__ == '__main__':
- svntest.main.run_tests(test_list, serial_only = serial_only)
+ svntest.main.run_tests(test_list)
# NOTREACHED
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.dump
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.dump?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.dump (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.dump Wed Jun 27 15:12:37 2012
@@ -1,6 +1,6 @@
SVN-fs-dump-format-version: 2
-UUID: 728f5e1e-a57c-4dd4-8b4f-ca752f5178f3
+UUID: 11659000-ab01-11e1-8800-0080c8fbf679
Revision-number: 0
Prop-content-length: 56
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.expected.dump
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.expected.dump?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.expected.dump (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.expected.dump Wed Jun 27 15:12:37 2012
@@ -1,6 +1,6 @@
SVN-fs-dump-format-version: 2
-UUID: 728f5e1e-a57c-4dd4-8b4f-ca752f5178f3
+UUID: 11659000-ab01-11e1-8800-0080c8fbf679
Revision-number: 0
Prop-content-length: 56
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.dump
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.dump?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.dump (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.dump Wed Jun 27 15:12:37 2012
@@ -1,6 +1,6 @@
SVN-fs-dump-format-version: 2
-UUID: 728f5e1e-a57c-4dd4-8b4f-ca752f5178f3
+UUID: a6952d52-ab01-11e1-b37f-0080c8fbf679
Revision-number: 0
Prop-content-length: 56
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.expected.dump
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.expected.dump?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.expected.dump (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.expected.dump Wed Jun 27 15:12:37 2012
@@ -1,6 +1,6 @@
SVN-fs-dump-format-version: 2
-UUID: 728f5e1e-a57c-4dd4-8b4f-ca752f5178f3
+UUID: a6952d52-ab01-11e1-b37f-0080c8fbf679
Revision-number: 0
Prop-content-length: 56
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/actions.py?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/actions.py Wed Jun 27 15:12:37 2012
@@ -1868,7 +1868,8 @@ def enable_revprop_changes(repo_dir):
pre-revprop-change hook script and (if appropriate) making it executable."""
hook_path = main.get_pre_revprop_change_hook_path(repo_dir)
- main.create_python_hook_script(hook_path, 'import sys; sys.exit(0)')
+ main.create_python_hook_script(hook_path, 'import sys; sys.exit(0)',
+ cmd_alternative='@exit 0')
def disable_revprop_changes(repo_dir):
"""Disable revprop changes in the repository at REPO_DIR by creating a
@@ -1878,8 +1879,12 @@ def disable_revprop_changes(repo_dir):
hook_path = main.get_pre_revprop_change_hook_path(repo_dir)
main.create_python_hook_script(hook_path,
'import sys\n'
- 'sys.stderr.write("pre-revprop-change %s" % " ".join(sys.argv[1:6]))\n'
- 'sys.exit(1)\n')
+ 'sys.stderr.write("pre-revprop-change %s" %'
+ ' " ".join(sys.argv[1:]))\n'
+ 'sys.exit(1)\n',
+ cmd_alternative=
+ '@echo pre-revprop-change %* 1>&2\n'
+ '@exit 1\n')
def create_failing_post_commit_hook(repo_dir):
"""Create a post-commit hook script in the repository at REPO_DIR that always
@@ -1888,7 +1893,10 @@ def create_failing_post_commit_hook(repo
hook_path = main.get_post_commit_hook_path(repo_dir)
main.create_python_hook_script(hook_path, 'import sys\n'
'sys.stderr.write("Post-commit hook failed")\n'
- 'sys.exit(1)')
+ 'sys.exit(1)\n',
+ cmd_alternative=
+ '@echo Post-commit hook failed 1>&2\n'
+ '@exit 1\n')
# set_prop can be used for properties with NULL characters which are not
# handled correctly when passed to subprocess.Popen() and values like "*"
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/err.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/err.py?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/err.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/err.py Wed Jun 27 15:12:37 2012
@@ -22,6 +22,7 @@ AUTHZ_PARTIALLY_READABLE = 220002
AUTHZ_ROOT_UNREADABLE = 220000
AUTHZ_UNREADABLE = 220001
AUTHZ_UNWRITABLE = 220004
+BAD_ATOMIC = 125015
BAD_CHANGELIST_NAME = 125014
BAD_CHECKSUM_KIND = 125011
BAD_CHECKSUM_PARSE = 125012
@@ -40,21 +41,24 @@ BAD_UUID = 125008
BAD_VERSION_FILE_FORMAT = 125006
BASE = 200000
CANCELLED = 200015
-CATEGORY_SIZE = 5000
CEASE_INVOCATION = 200021
CHECKSUM_MISMATCH = 200014
CLIENT_BAD_REVISION = 195002
CLIENT_CYCLE_DETECTED = 195019
CLIENT_DUPLICATE_COMMIT_URL = 195003
CLIENT_FILE_EXTERNAL_OVERWRITE_VERSIONED = 195017
+CLIENT_FORBIDDEN_BY_SERVER = 195023
CLIENT_INVALID_EXTERNALS_DESCRIPTION = 195005
+CLIENT_INVALID_MERGEINFO_NO_MERGETRACKING = 195021
CLIENT_INVALID_RELOCATION = 195009
CLIENT_IS_BINARY_FILE = 195004
CLIENT_IS_DIRECTORY = 195007
+CLIENT_MERGE_UPDATE_REQUIRED = 195020
CLIENT_MISSING_LOCK_TOKEN = 195013
CLIENT_MODIFIED = 195006
CLIENT_MULTIPLE_SOURCES_DISALLOWED = 195014
CLIENT_NOT_READY_TO_MERGE = 195016
+CLIENT_NO_LOCK_TOKEN = 195022
CLIENT_NO_VERSIONED_PARENT = 195015
CLIENT_PATCH_BAD_STRIP_COUNT = 195018
CLIENT_PROPERTY_NAME = 195011
@@ -95,6 +99,7 @@ FS_CONFLICT = 160024
FS_CORRUPT = 160004
FS_GENERAL = 160000
FS_ID_NOT_FOUND = 160014
+FS_INCORRECT_EDITOR_COMPLETION = 160050
FS_LOCK_EXPIRED = 160041
FS_LOCK_OWNER_MISMATCH = 160039
FS_MALFORMED_SKEL = 160027
@@ -143,11 +148,11 @@ IO_CORRUPT_EOL = 135002
IO_INCONSISTENT_EOL = 135000
IO_PIPE_FRAME_ERROR = 135004
IO_PIPE_READ_ERROR = 135005
+IO_PIPE_WRITE_ERROR = 135007
IO_UNIQUE_NAMES_EXHAUSTED = 135003
IO_UNKNOWN_EOL = 135001
IO_WRITE_ERROR = 135006
ITER_BREAK = 200023
-LAST = 235002
MALFORMED_FILE = 200002
MERGEINFO_PARSE_ERROR = 200020
NODE_UNEXPECTED_KIND = 145001
@@ -211,6 +216,7 @@ REPOS_UNSUPPORTED_VERSION = 165005
RESERVED_FILENAME_SPECIFIED = 200025
REVNUM_PARSE_FAILURE = 200022
SQLITE_BUSY = 200033
+SQLITE_CONSTRAINT = 200035
SQLITE_ERROR = 200030
SQLITE_READONLY = 200031
SQLITE_RESETTING_FOR_ROLLBACK = 200034
@@ -263,6 +269,7 @@ WC_NOT_SYMLINK = 155034
WC_NOT_UP_TO_DATE = 155011
WC_NOT_WORKING_COPY = 155007
WC_OBSTRUCTED_UPDATE = 155000
+WC_PATH_ACCESS_DENIED = 155039
WC_PATH_FOUND = 155014
WC_PATH_NOT_FOUND = 155010
WC_PATH_UNEXPECTED_STATUS = 155035
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/main.py?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/main.py Wed Jun 27 15:12:37 2012
@@ -35,6 +35,8 @@ import optparse
import xml
import urllib
import logging
+import hashlib
+from urlparse import urlparse
try:
# Python >=3.0
@@ -78,20 +80,8 @@ SVN_VER_MINOR = 8
default_num_threads = 5
-# This enables both a time stamp prefix on all log lines and a
-# '<TIME = 0.042552>' line after running every external command.
-log_with_timestamps = True
-
-# Set up logging
-logger = logging.getLogger()
-handler = logging.StreamHandler(sys.stdout)
-if log_with_timestamps:
- formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s',
- '%Y-%m-%d %H:%M:%S')
-else:
- formatter = logging.Formatter('[%(levelname)s] %(message)s')
-handler.setFormatter(formatter)
-logger.addHandler(handler)
+# Don't try to use this before calling execute_tests()
+logger = None
class SVNProcessTerminatedBySignal(Failure):
@@ -160,13 +150,12 @@ svnsync_binary = os.path.abspath('../../
svnversion_binary = os.path.abspath('../../svnversion/svnversion' + _exe)
svndumpfilter_binary = os.path.abspath('../../svndumpfilter/svndumpfilter' + \
_exe)
+svnmucc_binary=os.path.abspath('../../svnmucc/svnmucc' + _exe)
entriesdump_binary = os.path.abspath('entries-dump' + _exe)
atomic_ra_revprop_change_binary = os.path.abspath('atomic-ra-revprop-change' + \
_exe)
wc_lock_tester_binary = os.path.abspath('../libsvn_wc/wc-lock-tester' + _exe)
wc_incomplete_tester_binary = os.path.abspath('../libsvn_wc/wc-incomplete-tester' + _exe)
-svnmucc_binary=os.path.abspath('../../../tools/client-side/svnmucc/svnmucc' + \
- _exe)
# Location to the pristine repository, will be calculated from test_area_url
# when we know what the user specified for --url.
@@ -234,7 +223,7 @@ greek_state = svntest.wc.State('', {
######################################################################
# Utilities shared by the tests
-def wrap_ex(func):
+def wrap_ex(func, output):
"Wrap a function, catch, print and ignore exceptions"
def w(*args, **kwds):
try:
@@ -243,9 +232,9 @@ def wrap_ex(func):
if ex.__class__ != Failure or ex.args:
ex_args = str(ex)
if ex_args:
- print('EXCEPTION: %s: %s' % (ex.__class__.__name__, ex_args))
+ logger.warn('EXCEPTION: %s: %s', ex.__class__.__name__, ex_args)
else:
- print('EXCEPTION: %s' % ex.__class__.__name__)
+ logger.warn('EXCEPTION: %s', ex.__class__.__name__)
return w
def setup_development_mode():
@@ -511,9 +500,26 @@ def run_command_stdin(command, error_exp
stdin_lines,
*varargs)
- if log_with_timestamps:
- stop = time.time()
- logger.info('<TIME = %.6f>' % (stop - start))
+ def _line_contains_repos_diskpath(line):
+ # ### Note: this assumes that either svn-test-work isn't a symlink,
+ # ### or the diskpath isn't realpath()'d somewhere on the way from
+ # ### the server's configuration and the client's stderr. We could
+ # ### check for both the symlinked path and the realpath.
+ return \
+ os.path.join('cmdline', 'svn-test-work', 'repositories') in line \
+ or os.path.join('cmdline', 'svn-test-work', 'local_tmp', 'repos') in line
+
+ for lines, name in [[stdout_lines, "stdout"], [stderr_lines, "stderr"]]:
+ if is_ra_type_file() or 'svnadmin' in command or 'svnlook' in command:
+ break
+ # Does the server leak the repository on-disk path?
+ # (prop_tests-12 installs a hook script that does that intentionally)
+ if any(map(_line_contains_repos_diskpath, lines)) \
+ and not any(map(lambda arg: 'prop_tests-12' in arg, varargs)):
+ raise Failure("Repository diskpath in %s: %r" % (name, lines))
+
+ stop = time.time()
+ logger.info('<TIME = %.6f>' % (stop - start))
for x in stdout_lines:
logger.info(x.rstrip())
for x in stderr_lines:
@@ -528,7 +534,8 @@ def run_command_stdin(command, error_exp
[line for line in stdout_lines if not line.startswith("DBG:")], \
stderr_lines
-def create_config_dir(cfgdir, config_contents=None, server_contents=None):
+def create_config_dir(cfgdir, config_contents=None, server_contents=None,
+ ssl_cert=None, ssl_url=None):
"Create config directories and files"
# config file names
@@ -566,6 +573,56 @@ store-passwords=yes
file_write(cfgfile_cfg, config_contents)
file_write(cfgfile_srv, server_contents)
+ if (ssl_cert and ssl_url):
+ trust_ssl_cert(cfgdir, ssl_cert, ssl_url)
+ elif cfgdir != default_config_dir:
+ copy_trust(cfgdir, default_config_dir)
+
+
+def trust_ssl_cert(cfgdir, ssl_cert, ssl_url):
+ """Setup config dir to trust the given ssl_cert for the given ssl_url
+ """
+
+ cert_rep = ''
+ fp = open(ssl_cert, 'r')
+ for line in fp.readlines()[1:-1]:
+ cert_rep = cert_rep + line.strip()
+
+ parsed_url = urlparse(ssl_url)
+ netloc_url = '%s://%s' % (parsed_url.scheme, parsed_url.netloc)
+ ssl_dir = os.path.join(cfgdir, 'auth', 'svn.ssl.server')
+ if not os.path.isdir(ssl_dir):
+ os.makedirs(ssl_dir)
+ md5_name = hashlib.md5(netloc_url).hexdigest()
+ md5_file = os.path.join(ssl_dir, md5_name)
+ md5_file_contents = """K 10
+ascii_cert
+V %d
+%s
+K 8
+failures
+V 1
+8
+K 15
+svn:realmstring
+V %d
+%s
+END
+""" % (len(cert_rep), cert_rep, len(netloc_url), netloc_url)
+
+ file_write(md5_file, md5_file_contents)
+
+def copy_trust(dst_cfgdir, src_cfgdir):
+ """Copy svn.ssl.server files from one config dir to another.
+ """
+
+ src_ssl_dir = os.path.join(src_cfgdir, 'auth', 'svn.ssl.server')
+ dst_ssl_dir = os.path.join(dst_cfgdir, 'auth', 'svn.ssl.server')
+ if not os.path.isdir(dst_ssl_dir):
+ os.makedirs(dst_ssl_dir)
+ for f in os.listdir(src_ssl_dir):
+ shutil.copy(os.path.join(src_ssl_dir, f), os.path.join(dst_ssl_dir, f))
+
def _with_config_dir(args):
if '--config-dir' in args:
return args
@@ -672,7 +729,7 @@ def run_atomic_ra_revprop_change(url, re
# This passes HTTP_LIBRARY in addition to our params.
return run_command(atomic_ra_revprop_change_binary, True, False,
url, revision, propname, skel,
- options.http_library, want_error and 1 or 0)
+ want_error and 1 or 0, default_config_dir)
def run_wc_lock_tester(recursive, path):
"Run the wc-lock obtainer tool, returning its exit code, stdout and stderr"
@@ -885,9 +942,8 @@ def copy_repos(src_path, dst_path, head_
load_out.close()
load_err.close()
- if log_with_timestamps:
- stop = time.time()
- logger.info('<TIME = %.6f>' % (stop - start))
+ stop = time.time()
+ logger.info('<TIME = %.6f>' % (stop - start))
if saved_quiet is None:
del os.environ['SVN_DBG_QUIET']
@@ -899,11 +955,11 @@ def copy_repos(src_path, dst_path, head_
for dump_line in dump_stderr:
match = dump_re.match(dump_line)
if not match or match.group(1) != str(expect_revision):
- print('ERROR: dump failed: %s' % dump_line.strip())
+ logger.warn('ERROR: dump failed: %s', dump_line.strip())
raise SVNRepositoryCopyFailure
expect_revision += 1
if expect_revision != head_revision + 1:
- print('ERROR: dump failed; did not see revision %s' % head_revision)
+ logger.warn('ERROR: dump failed; did not see revision %s', head_revision)
raise SVNRepositoryCopyFailure
load_re = re.compile(r'^------- Committed revision (\d+) >>>\r?$')
@@ -912,11 +968,11 @@ def copy_repos(src_path, dst_path, head_
match = load_re.match(load_line)
if match:
if match.group(1) != str(expect_revision):
- print('ERROR: load failed: %s' % load_line.strip())
+ logger.warn('ERROR: load failed: %s', load_line.strip())
raise SVNRepositoryCopyFailure
expect_revision += 1
if expect_revision != head_revision + 1:
- print('ERROR: load failed; did not see revision %s' % head_revision)
+ logger.warn('ERROR: load failed; did not see revision %s', head_revision)
raise SVNRepositoryCopyFailure
@@ -931,18 +987,23 @@ def canonicalize_url(input):
return input
-def create_python_hook_script(hook_path, hook_script_code):
+def create_python_hook_script(hook_path, hook_script_code,
+ cmd_alternative=None):
"""Create a Python hook script at HOOK_PATH with the specified
HOOK_SCRIPT_CODE."""
if windows:
- # Use an absolute path since the working directory is not guaranteed
- hook_path = os.path.abspath(hook_path)
- # Fill the python file.
- file_write("%s.py" % hook_path, hook_script_code)
- # Fill the batch wrapper file.
- file_append("%s.bat" % hook_path,
- "@\"%s\" %s.py %%*\n" % (sys.executable, hook_path))
+ if cmd_alternative is not None:
+ file_write("%s.bat" % hook_path,
+ cmd_alternative)
+ else:
+ # Use an absolute path since the working directory is not guaranteed
+ hook_path = os.path.abspath(hook_path)
+ # Fill the python file.
+ file_write("%s.py" % hook_path, hook_script_code)
+ # Fill the batch wrapper file.
+ file_write("%s.bat" % hook_path,
+ "@\"%s\" %s.py %%*\n" % (sys.executable, hook_path))
else:
# For all other platforms
file_write(hook_path, "#!%s\n%s" % (sys.executable, hook_script_code))
@@ -1207,6 +1268,8 @@ class TestSpawningThread(threading.Threa
args.append('--mode-filter=' + options.mode_filter)
if options.milestone_filter:
args.append('--milestone-filter=' + options.milestone_filter)
+ if options.ssl_cert:
+ args.append('--ssl-cert=' + options.ssl_cert)
result, stdout_lines, stderr_lines = spawn_process(command, 0, 0, None,
*args)
@@ -1481,9 +1544,11 @@ def _create_parser():
"""Return a parser for our test suite."""
def set_log_level(option, opt, value, parser, level=None):
if level:
+ # called from --verbose
logger.setLevel(level)
else:
- logger.setLevel(value)
+ # called from --set-log-level
+ logger.setLevel(getattr(logging, value, None) or int(value))
# set up the parser
_default_http_library = 'serf'
@@ -1535,7 +1600,12 @@ def _create_parser():
parser.add_option('--config-file', action='store',
help="Configuration file for tests.")
parser.add_option('--set-log-level', action='callback', type='str',
- callback=set_log_level)
+ callback=set_log_level,
+ help="Set log level (numerically or symbolically). " +
+ "Symbolic levels are: CRITICAL, ERROR, WARNING, " +
+ "INFO, DEBUG")
+ parser.add_option('--log-with-timestamps', action='store_true',
+ help="Show timestamps in test log.")
parser.add_option('--keep-local-tmp', action='store_true',
help="Don't remove svn-test-work/local_tmp after test " +
"run is complete. Useful for debugging failures.")
@@ -1546,6 +1616,8 @@ def _create_parser():
'useful during test development!')
parser.add_option('--srcdir', action='store', dest='srcdir',
help='Source directory.')
+ parser.add_option('--ssl-cert', action='store',
+ help='Path to SSL server certificate.')
# most of the defaults are None, but some are other values, set them here
parser.set_defaults(
@@ -1636,6 +1708,28 @@ def get_target_milestones_for_issues(iss
return issue_dict
+
+class AbbreviatedFormatter(logging.Formatter):
+ """A formatter with abbreviated loglevel indicators in the output.
+
+ Use %(levelshort)s in the format string to get a single character
+ representing the loglevel..
+ """
+
+ _level_short = {
+ logging.CRITICAL : 'C',
+ logging.ERROR : 'E',
+ logging.WARNING : 'W',
+ logging.INFO : 'I',
+ logging.DEBUG : 'D',
+ logging.NOTSET : '-',
+ }
+
+ def format(self, record):
+ record.levelshort = self._level_short[record.levelno]
+ return logging.Formatter.format(self, record)
+
+
# Main func. This is the "entry point" that all the test scripts call
# to run their list of tests.
#
@@ -1646,6 +1740,7 @@ def execute_tests(test_list, serial_only
exiting the process. This function can be used when a caller doesn't
want the process to die."""
+ global logger
global pristine_url
global pristine_greek_repos_url
global svn_binary
@@ -1662,6 +1757,19 @@ def execute_tests(test_list, serial_only
testnums = []
+ # Initialize the LOGGER global variable so the option parsing can set
+ # its loglevel, as appropriate.
+ logger = logging.getLogger()
+
+ # Did some chucklehead log something before we configured it? If they
+ # did, then a default handler/formatter would get installed. We want
+ # to be the one to install the first (and only) handler.
+ for handler in logger.handlers:
+ if not isinstance(handler.formatter, AbbreviatedFormatter):
+ raise Exception('Logging occurred before configuration. Some code'
+ ' path needs to be fixed. Examine the log output'
+ ' to find what/where logged something.')
+
if not options:
# Override which tests to run from the commandline
(parser, args) = _parse_options()
@@ -1669,6 +1777,22 @@ def execute_tests(test_list, serial_only
else:
parser = _create_parser()
+ # If there are no handlers registered yet, then install our own with
+ # our custom formatter. (anything currently installed *is* our handler
+ # as tested above)
+ if not logger.handlers:
+ # Now that we have some options, let's get the logger configured before
+ # doing anything more
+ if options.log_with_timestamps:
+ formatter = AbbreviatedFormatter('%(levelshort)s:'
+ ' [%(asctime)s] %(message)s',
+ datefmt='%Y-%m-%d %H:%M:%S')
+ else:
+ formatter = AbbreviatedFormatter('%(levelshort)s: %(message)s')
+ handler = logging.StreamHandler(sys.stdout)
+ handler.setFormatter(formatter)
+ logger.addHandler(handler)
+
# parse the positional arguments (test nums, names)
for arg in test_selection:
appended = False
@@ -1731,7 +1855,7 @@ def execute_tests(test_list, serial_only
'jsvndumpfilter' + _bat)
svnversion_binary = os.path.join(options.svn_bin,
'jsvnversion' + _bat)
- svnversion_binary = os.path.join(options.svn_bin, 'jsvnmucc' + _bat)
+ svnmucc_binary = os.path.join(options.svn_bin, 'jsvnmucc' + _bat)
else:
if options.svn_bin:
svn_binary = os.path.join(options.svn_bin, 'svn' + _exe)
@@ -1794,7 +1918,9 @@ def execute_tests(test_list, serial_only
if not options.is_child_process:
# Build out the default configuration directory
- create_config_dir(default_config_dir)
+ create_config_dir(default_config_dir,
+ ssl_cert=options.ssl_cert,
+ ssl_url=options.test_area_url)
# Setup the pristine repository
svntest.actions.setup_pristine_greek_repository()
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/sandbox.py?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/sandbox.py Wed Jun 27 15:12:37 2012
@@ -276,6 +276,37 @@ class Sandbox:
targets = self.ospaths(targets)
svntest.main.run_svn(False, 'propdel', name, *targets)
+ def simple_propget(self, name, target):
+ """Return the value of the property NAME on TARGET.
+ TARGET is a relpath relative to the WC."""
+ target = self.ospath(target)
+ exit, out, err = svntest.main.run_svn(False, 'propget',
+ '--strict', name, target)
+ return ''.join(out)
+
+ def simple_proplist(self, target):
+ """Return a dictionary mapping property name to property value, of the
+ properties on TARGET.
+ TARGET is a relpath relative to the WC."""
+ target = self.ospath(target)
+ exit, out, err = svntest.main.run_svn(False, 'proplist',
+ '--verbose', '--quiet', target)
+ props = {}
+ for line in out:
+ line = line.rstrip('\r\n')
+ if line[2] != ' ': # property name
+ name = line[2:]
+ val = None
+ elif line.startswith(' '): # property value
+ if val is None:
+ val = line[4:]
+ else:
+ val += '\n' + line[4:]
+ props[name] = val
+ else:
+ raise Exception("Unexpected line '" + line + "' in proplist output" + str(out))
+ return props
+
def simple_copy(self, source, dest):
"""Copy SOURCE to DEST in the WC.
SOURCE and DEST are relpaths relative to the WC."""
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/wc.py?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/wc.py Wed Jun 27 15:12:37 2012
@@ -98,7 +98,7 @@ _re_parse_skipped = re.compile("^Skipped
_re_parse_summarize = re.compile("^([MAD ][M ]) (.+)\n")
-_re_parse_checkout = re.compile('^([RMAGCUDE_ ][MAGCUDE_ ])'
+_re_parse_checkout = re.compile('^([RMAGCUDE_ B][MAGCUDE_ ])'
'([B ])'
'([CAUD ])\s+'
'(.+)')
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/switch_tests.py?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/switch_tests.py Wed Jun 27 15:12:37 2012
@@ -284,14 +284,14 @@ def full_update(sbox):
commit_routine_switching(wc_backup, 0)
# Some convenient path variables
- iota_path = os.path.join(wc_dir, 'iota')
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
- Bpi_path = os.path.join(wc_dir, 'A', 'B', 'pi')
- BZ_path = os.path.join(wc_dir, 'A', 'B', 'Z')
- Bzeta_path = os.path.join(wc_dir, 'A', 'B', 'Z', 'zeta')
- Gpi_path = os.path.join(wc_dir, 'A', 'D', 'G', 'pi')
- GZ_path = os.path.join(wc_dir, 'A', 'D', 'G', 'Z')
- Gzeta_path = os.path.join(wc_dir, 'A', 'D', 'G', 'Z', 'zeta')
+ iota_path = sbox.ospath('iota')
+ gamma_path = sbox.ospath('A/D/gamma')
+ Bpi_path = sbox.ospath('A/B/pi')
+ BZ_path = sbox.ospath('A/B/Z')
+ Bzeta_path = sbox.ospath('A/B/Z/zeta')
+ Gpi_path = sbox.ospath('A/D/G/pi')
+ GZ_path = sbox.ospath('A/D/G/Z')
+ Gzeta_path = sbox.ospath('A/D/G/Z/zeta')
# Create expected output tree for an update of wc_backup.
expected_output = svntest.wc.State(wc_dir, {
@@ -352,12 +352,12 @@ def full_rev_update(sbox):
svntest.main.run_svn(None, 'up', wc_dir)
# Some convenient path variables
- iota_path = os.path.join(wc_dir, 'iota')
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
- Bpi_path = os.path.join(wc_dir, 'A', 'B', 'pi')
- BZ_path = os.path.join(wc_dir, 'A', 'B', 'Z')
- Gpi_path = os.path.join(wc_dir, 'A', 'D', 'G', 'pi')
- GZ_path = os.path.join(wc_dir, 'A', 'D', 'G', 'Z')
+ iota_path = sbox.ospath('iota')
+ gamma_path = sbox.ospath('A/D/gamma')
+ Bpi_path = sbox.ospath('A/B/pi')
+ BZ_path = sbox.ospath('A/B/Z')
+ Gpi_path = sbox.ospath('A/D/G/pi')
+ GZ_path = sbox.ospath('A/D/G/Z')
# Now, reverse update, back to the pre-commit state.
expected_output = svntest.wc.State(wc_dir, {
@@ -403,8 +403,8 @@ def update_switched_things(sbox):
commit_routine_switching(wc_backup, 0)
# Some convenient path variables
- iota_path = os.path.join(wc_dir, 'iota')
- B_path = os.path.join(wc_dir, 'A', 'B')
+ iota_path = sbox.ospath('iota')
+ B_path = sbox.ospath('A/B')
# Create expected output tree for an update of wc_backup.
expected_output = svntest.wc.State(wc_dir, {
@@ -459,8 +459,8 @@ def rev_update_switched_things(sbox):
commit_routine_switching(wc_dir, 0)
# Some convenient path variables
- iota_path = os.path.join(wc_dir, 'iota')
- B_path = os.path.join(wc_dir, 'A', 'B')
+ iota_path = sbox.ospath('iota')
+ B_path = sbox.ospath('A/B')
# Update to HEAD (tested elsewhere)
svntest.main.run_svn(None, 'up', wc_dir)
@@ -515,7 +515,7 @@ def log_switched_file(sbox):
do_routine_switching(wc_dir, sbox.repo_url, 0)
# edit and commit switched file 'iota'
- iota_path = os.path.join(wc_dir, 'iota')
+ iota_path = sbox.ospath('iota')
svntest.main.run_svn(None, 'ps', 'x', 'x', iota_path)
svntest.main.run_svn(None,
'ci', '-m',
@@ -537,7 +537,7 @@ def delete_subdir(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- A_path = os.path.join(wc_dir, 'A')
+ A_path = sbox.ospath('A')
A_url = sbox.repo_url + '/A'
A2_url = sbox.repo_url + '/A2'
A2_B_F_url = sbox.repo_url + '/A2/B/F'
@@ -577,7 +577,7 @@ def file_dir_file(sbox):
sbox.build(read_only = True)
wc_dir = sbox.wc_dir
- file_path = os.path.join(wc_dir, 'iota')
+ file_path = sbox.ospath('iota')
file_url = sbox.repo_url + '/iota'
dir_url = sbox.repo_url + '/A/C'
@@ -672,7 +672,7 @@ def failed_anchor_is_target(sbox):
'mkdir', '-m', 'log msg', G_psi_url)
# Modify the file 'H/psi' locally.
- H_path = os.path.join(wc_dir, 'A', 'D', 'H')
+ H_path = sbox.ospath('A/D/H')
psi_path = os.path.join(H_path, 'psi')
svntest.main.file_append(psi_path, "more text")
@@ -718,8 +718,8 @@ def bad_intermediate_urls(sbox):
wc_dir = sbox.wc_dir
url = sbox.repo_url
- A = os.path.join(wc_dir, 'A')
- A_Z = os.path.join(wc_dir, 'A', 'Z')
+ A = sbox.ospath('A')
+ A_Z = sbox.ospath('A/Z')
url_A_C = url + '/A/C'
url_A_C_A = url + '/A/C/A'
url_A_C_A_Z = url + '/A/C/A/Z'
@@ -822,8 +822,8 @@ def obstructed_switch(sbox):
wc_dir = sbox.wc_dir
url = sbox.repo_url
- A_B_E = os.path.join(wc_dir, 'A', 'B', 'E')
- A_B_E_alpha = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
+ A_B_E = sbox.ospath('A/B/E')
+ A_B_E_alpha = sbox.ospath('A/B/E/alpha')
url_A_B_E = url + '/A/B/E'
url_A_B_Esave = url + '/A/B/Esave'
@@ -899,7 +899,7 @@ def commit_mods_below_switch(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- C_path = os.path.join(wc_dir, 'A', 'C')
+ C_path = sbox.ospath('A/C')
B_url = sbox.repo_url + '/A/B'
expected_output = svntest.wc.State(wc_dir, {
'A/C/E' : Item(status='A '),
@@ -932,7 +932,7 @@ def commit_mods_below_switch(sbox):
None, None, None, None, None,
False, '--ignore-ancestry')
- D_path = os.path.join(wc_dir, 'A', 'D')
+ D_path = sbox.ospath('A/D')
svntest.actions.run_and_verify_svn(None, None, [],
'propset', 'x', 'x', C_path, D_path)
@@ -974,7 +974,7 @@ def refresh_read_only_attribute(sbox):
url, branch_url)
# Set the svn:needs-lock property on a file from the "trunk".
- A_path = os.path.join(wc_dir, 'A')
+ A_path = sbox.ospath('A')
mu_path = os.path.join(A_path, 'mu')
svntest.actions.run_and_verify_svn(None, None, [],
'ps', 'svn:needs-lock', '1', mu_path)
@@ -1033,7 +1033,7 @@ def switch_change_repos_root(sbox):
other_repo_url = other_repo_url + "_bogus"
other_A_url = other_repo_url + "/A"
- A_wc_dir = os.path.join(wc_dir, "A")
+ A_wc_dir = sbox.ospath('A')
# Test 1: A switch that changes to a non-existing repo shouldn't work.
expected_err = ".*Unable to open repository.*|.*Could not open.*|"\
@@ -1064,22 +1064,22 @@ def forced_switch(sbox):
sbox.build(read_only = True)
# Dir obstruction
- G_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'G')
+ G_path = sbox.ospath('A/B/F/G')
os.mkdir(G_path)
# Faux file obstructions
- shutil.copyfile(os.path.join(sbox.wc_dir, 'A', 'D', 'gamma'),
- os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'gamma'))
- shutil.copyfile(os.path.join(sbox.wc_dir, 'A', 'D', 'G', 'tau'),
- os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'G', 'tau'))
+ shutil.copyfile(sbox.ospath('A/D/gamma'),
+ sbox.ospath('A/B/F/gamma'))
+ shutil.copyfile(sbox.ospath('A/D/G/tau'),
+ sbox.ospath('A/B/F/G/tau'))
# Real file obstruction
- pi_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'G', 'pi')
+ pi_path = sbox.ospath('A/B/F/G/pi')
svntest.main.file_write(pi_path,
"This is the OBSTRUCTING file 'pi'.\n")
# Non-obstructing dir and file
- I_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'I')
+ I_path = sbox.ospath('A/B/F/I')
os.mkdir(I_path)
upsilon_path = os.path.join(G_path, 'upsilon')
svntest.main.file_write(upsilon_path,
@@ -1126,7 +1126,7 @@ def forced_switch(sbox):
})
# Do the switch and check the results in three ways.
- F_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F')
+ F_path = sbox.ospath('A/B/F')
AD_url = sbox.repo_url + '/A/D'
svntest.actions.run_and_verify_switch(sbox.wc_dir, F_path, AD_url,
expected_output,
@@ -1186,12 +1186,12 @@ def forced_switch_failures(sbox):
wc_dir = sbox.wc_dir
url = sbox.repo_url
- A_B_F = os.path.join(wc_dir, 'A', 'B', 'F')
- A_B_F_pi = os.path.join(wc_dir, 'A', 'B', 'F', 'pi')
- A_C = os.path.join(wc_dir, 'A', 'C')
- A_C_H = os.path.join(wc_dir, 'A', 'C', 'H')
- A_D_G = os.path.join(wc_dir, 'A', 'D', 'G')
- A_D_G_I = os.path.join(wc_dir, 'A', 'D', 'G', 'I')
+ A_B_F = sbox.ospath('A/B/F')
+ A_B_F_pi = sbox.ospath('A/B/F/pi')
+ A_C = sbox.ospath('A/C')
+ A_C_H = sbox.ospath('A/C/H')
+ A_D_G = sbox.ospath('A/D/G')
+ A_D_G_I = sbox.ospath('A/D/G/I')
url_A_D = url + '/A/D'
url_A_D_G = url + '/A/D/G'
url_A_D_H = url + '/A/D/H'
@@ -1387,7 +1387,7 @@ def forced_switch_failures(sbox):
expected_status.tweak('A/B/F/pi', 'A/C/H', treeconflict=None)
expected_status.tweak('A/D/G', switched='S')
- svntest.main.run_svn(None, 'revert', '-R', os.path.join(wc_dir, 'A/C/H'))
+ svntest.main.run_svn(None, 'revert', '-R', sbox.ospath('A/C/H'))
actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
expected_status, None, None, None, None, None, False, wc_dir)
@@ -1398,25 +1398,25 @@ def switch_with_obstructing_local_adds(s
sbox.build(read_only = True)
# Dir obstruction scheduled for addition without history.
- G_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'G')
+ G_path = sbox.ospath('A/B/F/G')
os.mkdir(G_path)
# File obstructions scheduled for addition without history.
# Contents identical to additions from switch.
- gamma_copy_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'gamma')
- shutil.copyfile(os.path.join(sbox.wc_dir, 'A', 'D', 'gamma'),
+ gamma_copy_path = sbox.ospath('A/B/F/gamma')
+ shutil.copyfile(sbox.ospath('A/D/gamma'),
gamma_copy_path)
- shutil.copyfile(os.path.join(sbox.wc_dir, 'A', 'D', 'G', 'tau'),
- os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'G', 'tau'))
+ shutil.copyfile(sbox.ospath('A/D/G/tau'),
+ sbox.ospath('A/B/F/G/tau'))
# File obstruction scheduled for addition without history.
# Contents conflict with addition from switch.
- pi_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'G', 'pi')
+ pi_path = sbox.ospath('A/B/F/G/pi')
svntest.main.file_write(pi_path,
"This is the OBSTRUCTING file 'pi'.\n")
# Non-obstructing dir and file scheduled for addition without history.
- I_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F', 'I')
+ I_path = sbox.ospath('A/B/F/I')
os.mkdir(I_path)
upsilon_path = os.path.join(G_path, 'upsilon')
svntest.main.file_write(upsilon_path,
@@ -1473,7 +1473,7 @@ def switch_with_obstructing_local_adds(s
extra_files = ['pi\.r0', 'pi\.r1', 'pi\.mine']
# Do the switch and check the results in three ways.
- F_path = os.path.join(sbox.wc_dir, 'A', 'B', 'F')
+ F_path = sbox.ospath('A/B/F')
D_url = sbox.repo_url + '/A/D'
svntest.actions.run_and_verify_switch(sbox.wc_dir, F_path, D_url,
@@ -1492,9 +1492,9 @@ def switch_scheduled_add(sbox):
sbox.build(read_only = True)
wc_dir = sbox.wc_dir
- file_path = os.path.join(wc_dir, 'stub_file')
+ file_path = sbox.ospath('stub_file')
switch_url = sbox.repo_url + '/iota'
- nodo_path = os.path.join(wc_dir, 'nodo')
+ nodo_path = sbox.ospath('nodo')
svntest.main.file_append(file_path, "")
svntest.actions.run_and_verify_svn(None, None, [],
@@ -1524,20 +1524,20 @@ def mergeinfo_switch_elision(sbox):
wc_dir = sbox.wc_dir
# Some paths we'll care about
- lambda_path = os.path.join(wc_dir, "A", "B_COPY_1", "lambda")
- B_COPY_1_path = os.path.join(wc_dir, "A", "B_COPY_1")
- B_COPY_2_path = os.path.join(wc_dir, "A", "B_COPY_2")
- E_COPY_2_path = os.path.join(wc_dir, "A", "B_COPY_2", "E")
- alpha_path = os.path.join(wc_dir, "A", "B", "E", "alpha")
- beta_path = os.path.join(wc_dir, "A", "B", "E", "beta")
+ lambda_path = sbox.ospath('A/B_COPY_1/lambda')
+ B_COPY_1_path = sbox.ospath('A/B_COPY_1')
+ B_COPY_2_path = sbox.ospath('A/B_COPY_2')
+ E_COPY_2_path = sbox.ospath('A/B_COPY_2/E')
+ alpha_path = sbox.ospath('A/B/E/alpha')
+ beta_path = sbox.ospath('A/B/E/beta')
# Make branches A/B_COPY_1 and A/B_COPY_2
expected_stdout = verify.UnorderedOutput([
- "A " + os.path.join(wc_dir, "A", "B_COPY_1", "lambda") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY_1", "E") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY_1", "E", "alpha") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY_1", "E", "beta") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY_1", "F") + "\n",
+ "A " + sbox.ospath('A/B_COPY_1/lambda') + "\n",
+ "A " + sbox.ospath('A/B_COPY_1/E') + "\n",
+ "A " + sbox.ospath('A/B_COPY_1/E/alpha') + "\n",
+ "A " + sbox.ospath('A/B_COPY_1/E/beta') + "\n",
+ "A " + sbox.ospath('A/B_COPY_1/F') + "\n",
"Checked out revision 1.\n",
"A " + B_COPY_1_path + "\n",
])
@@ -1545,11 +1545,11 @@ def mergeinfo_switch_elision(sbox):
sbox.repo_url + "/A/B", B_COPY_1_path)
expected_stdout = verify.UnorderedOutput([
- "A " + os.path.join(wc_dir, "A", "B_COPY_2", "lambda") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY_2", "E") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY_2", "E", "alpha") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY_2", "E", "beta") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY_2", "F") + "\n",
+ "A " + sbox.ospath('A/B_COPY_2/lambda') + "\n",
+ "A " + sbox.ospath('A/B_COPY_2/E') + "\n",
+ "A " + sbox.ospath('A/B_COPY_2/E/alpha') + "\n",
+ "A " + sbox.ospath('A/B_COPY_2/E/beta') + "\n",
+ "A " + sbox.ospath('A/B_COPY_2/F') + "\n",
"Checked out revision 1.\n",
"A " + B_COPY_2_path + "\n",
])
@@ -1795,7 +1795,7 @@ def switch_with_depth(sbox):
repo_url = sbox.repo_url
AD_url = repo_url + '/A/D'
AB_url = repo_url + '/A/B'
- AB_path = os.path.join(wc_dir, 'A', 'B')
+ AB_path = sbox.ospath('A/B')
# Set up expected results of 'switch --depth=empty'
expected_output = svntest.wc.State(wc_dir, {})
@@ -1968,15 +1968,15 @@ def switch_to_dir_with_peg_rev(sbox):
repo_url = sbox.repo_url
# prepare two dirs X and Y in rev. 2
- X_path = os.path.join(wc_dir, 'X')
- Y_path = os.path.join(wc_dir, 'Y')
+ X_path = sbox.ospath('X')
+ Y_path = sbox.ospath('Y')
svntest.main.run_svn(None, 'mkdir', X_path, Y_path)
svntest.main.run_svn(None, 'ci',
'-m', 'log message',
wc_dir)
# change tau in rev. 3
- ADG_path = os.path.join(wc_dir, 'A', 'D', 'G')
+ ADG_path = sbox.ospath('A/D/G')
tau_path = os.path.join(ADG_path, 'tau')
svntest.main.file_append(tau_path, "new line\n")
svntest.main.run_svn(None, 'ci',
@@ -2032,12 +2032,12 @@ def switch_urls_with_spaces(sbox):
repo_url = sbox.repo_url
# add file and directory with spaces in their names.
- XYZ_path = os.path.join(wc_dir, 'X Y Z')
- ABC_path = os.path.join(wc_dir, 'A B C')
+ XYZ_path = sbox.ospath('X Y Z')
+ ABC_path = sbox.ospath('A B C')
svntest.main.run_svn(None, 'mkdir', XYZ_path, ABC_path)
- tpm_path = os.path.join(wc_dir, 'tau pau mau')
- bbb_path = os.path.join(wc_dir, 'bar baz bal')
+ tpm_path = sbox.ospath('tau pau mau')
+ bbb_path = sbox.ospath('bar baz bal')
svntest.main.file_write(tpm_path, "This is the file 'tau pau mau'.\n")
svntest.main.file_write(bbb_path, "This is the file 'bar baz bal'.\n")
svntest.main.run_svn(None, 'add', tpm_path, bbb_path)
@@ -2105,21 +2105,21 @@ def switch_to_dir_with_peg_rev2(sbox):
repo_url = sbox.repo_url
# prepare dir X in rev. 2
- X_path = os.path.join(wc_dir, 'X')
+ X_path = sbox.ospath('X')
svntest.main.run_svn(None, 'mkdir', X_path)
svntest.main.run_svn(None, 'ci',
'-m', 'log message',
wc_dir)
# make a change in ADG in rev. 3
- tau_path = os.path.join(wc_dir, 'A', 'D', 'G', 'tau')
+ tau_path = sbox.ospath('A/D/G/tau')
svntest.main.file_append(tau_path, "extra line\n")
svntest.main.run_svn(None, 'ci', '-m', 'log message', wc_dir)
# Rename ADG to ADY in rev 4
svntest.main.run_svn(None, 'up', wc_dir)
- ADG_path = os.path.join(wc_dir, 'A', 'D', 'G')
- ADY_path = os.path.join(wc_dir, 'A', 'D', 'Y')
+ ADG_path = sbox.ospath('A/D/G')
+ ADY_path = sbox.ospath('A/D/Y')
svntest.main.run_svn(None, 'mv', ADG_path, ADY_path)
svntest.main.run_svn(None, 'ci',
'-m', 'log message',
@@ -2172,7 +2172,7 @@ def switch_to_root(sbox):
wc_dir = sbox.wc_dir
repo_url = sbox.repo_url
- ADG_path = os.path.join(wc_dir, 'A', 'D', 'G')
+ ADG_path = sbox.ospath('A/D/G')
# Test switch /A/D/G to /
AD_url = sbox.repo_url + '/A/D'
@@ -2227,7 +2227,7 @@ def tolerate_local_mods(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- A_path = os.path.join(wc_dir, 'A')
+ A_path = sbox.ospath('A')
L_path = os.path.join(A_path, 'L')
LM_path = os.path.join(L_path, 'local_mod')
A_url = sbox.repo_url + '/A'
@@ -2763,11 +2763,11 @@ def copy_with_switched_subdir(sbox):
"copy directory with switched subdir"
sbox.build()
wc_dir = sbox.wc_dir
- D = os.path.join(wc_dir, 'A/D')
+ D = sbox.ospath('A/D')
G = os.path.join(D, 'G')
E_url = sbox.repo_url + '/A/B/E'
- R = os.path.join(wc_dir, 'R')
+ R = sbox.ospath('R')
state = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -2807,7 +2807,7 @@ def copy_with_switched_subdir(sbox):
# Additional test, it should commit to R/G/alpha.
svntest.main.run_svn(None, 'up', wc_dir)
- svntest.main.file_append(os.path.join(wc_dir, 'R/G/alpha'), "apple")
+ svntest.main.file_append(sbox.ospath('R/G/alpha'), "apple")
svntest.main.run_svn(None, 'ci', '-m', 'Commit changed file', wc_dir)
# Checkout working copy to verify result
@@ -2836,8 +2836,8 @@ def up_to_old_rev_with_subtree_switched_
wc_dir = sbox.wc_dir
# Some paths we'll care about.
- A_path = os.path.join(wc_dir, 'A')
- branch_path = os.path.join(wc_dir, 'branch')
+ A_path = sbox.ospath('A')
+ branch_path = sbox.ospath('branch')
# Starting with a vanilla greek tree, create a branch of A, switch
# that branch to the root of the repository, then update the WC to
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/tree_conflict_tests.py?rev=1354571&r1=1354570&r2=1354571&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/tree_conflict_tests.py Wed Jun 27 15:12:37 2012
@@ -1343,6 +1343,18 @@ def actual_only_node_behaviour(sbox):
svntest.main.run_svn(None, "merge", '-c', '4', A_copy_url,
os.path.join(wc_dir, 'A'))
+ # revert
+ expected_stdout = "Reverted.*foo.*"
+ expected_stderr = []
+ run_and_verify_svn(None, expected_stdout, expected_stderr,
+ "revert", "-R", foo_path)
+
+ # revert the entire working copy and repeat the merge so we can test
+ # more commands
+ svntest.main.run_svn(None, "revert", "-R", wc_dir)
+ svntest.main.run_svn(None, "merge", '-c', '4', A_copy_url,
+ os.path.join(wc_dir, 'A'))
+
# status (stat, st)
expected_status = wc.State(foo_path, {
'' : Item(status='! ', treeconflict='C'),
@@ -1398,7 +1410,8 @@ def update_dir_with_not_present(sbox):
sbox.simple_rm('A/B')
# We can't commit this without updating (ra_svn produces its own error)
- run_and_verify_svn(None, None, "svn: (E155011|E160028): Dir.*B.*out of date",
+ run_and_verify_svn(None, None,
+ "svn: (E155011|E160028|E170004): (Dir|Item).*B.*out of date",
'ci', '-m', '', wc_dir)
# So we run update