You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/03/05 21:34:28 UTC
svn commit: r1297221 [6/7] - in /subversion/branches/ev2-export: ./
build/ac-macros/ build/generator/ build/win32/ notes/
subversion/bindings/javahl/native/
subversion/bindings/javahl/tests/org/apache/subversion/javahl/
subversion/bindings/swig/include...
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py Mon Mar 5 20:34:22 2012
@@ -998,7 +998,7 @@ def replace_symlinks(sbox):
os.symlink('../iota', wc('A/mu.sh'))
sbox.simple_add('A/mu',
'A/mu.sh')
-
+
# Ditto, without the Subversion replacement. Failing git-svn test
# 'executable file becomes a symlink to bar/zzz (file)'.
os.remove(wc('Ax/mu'))
@@ -1009,7 +1009,7 @@ def replace_symlinks(sbox):
'Ax/mu',
'Ax/mu.sh')
sbox.simple_propdel('svn:executable', 'Ax/mu.sh')
-
+
### TODO Replace a normal {file, exec, dir, dir} with a symlink to
### {dir, dir, file, exec}. And the same symlink-to-normal.
@@ -1023,7 +1023,6 @@ def replace_symlinks(sbox):
sbox.simple_update()
-@XFail()
@Issue(4102)
@SkipUnless(svntest.main.is_posix_os)
def externals_as_symlink_targets(sbox):
@@ -1053,7 +1052,20 @@ def externals_as_symlink_targets(sbox):
sbox.simple_add('sym_ext_E')
sbox.simple_commit()
-
+
+@XFail()
+@Issue(4119)
+@SkipUnless(svntest.main.is_posix_os)
+def cat_added_symlink(sbox):
+ "cat added symlink"
+
+ sbox.build(read_only = True)
+
+ kappa_path = sbox.ospath('kappa')
+ os.symlink('iota', kappa_path)
+ sbox.simple_add('kappa')
+ svntest.actions.run_and_verify_svn(None, "link iota", [],
+ "cat", kappa_path)
########################################################################
# Run the tests
@@ -1084,6 +1096,7 @@ test_list = [ None,
update_symlink,
replace_symlinks,
externals_as_symlink_targets,
+ cat_added_symlink,
]
if __name__ == '__main__':
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py Mon Mar 5 20:34:22 2012
@@ -924,76 +924,27 @@ def status_in_xml(sbox):
else:
raise svntest.Failure
- template = ['<?xml version="1.0" encoding="UTF-8"?>\n',
- "<status>\n",
- "<target\n",
- " path=\"%s\">\n" % (file_path),
- "<entry\n",
- " path=\"%s\">\n" % (file_path),
- "<wc-status\n",
- " props=\"none\"\n",
- " item=\"modified\"\n",
- " revision=\"1\">\n",
- "<commit\n",
- " revision=\"1\">\n",
- "<author>%s</author>\n" % svntest.main.wc_author,
- time_str,
- "</commit>\n",
- "</wc-status>\n",
- "</entry>\n",
- "<against\n",
- " revision=\"1\"/>\n",
- "</target>\n",
- "</status>\n",
- ]
+ expected_entries = {file_path : {'wcprops' : 'none',
+ 'wcitem' : 'modified',
+ 'wcrev' : '1',
+ 'crev' : '1',
+ 'author' : svntest.main.wc_author}}
- exit_code, output, error = svntest.actions.run_and_verify_svn(None, None, [],
- 'status',
- file_path,
- '--xml', '-u')
-
- for i in range(0, len(output)):
- if output[i] != template[i]:
- print("ERROR: expected: %s actual: %s" % (template[i], output[i]))
- raise svntest.Failure
+ svntest.actions.run_and_verify_status_xml(expected_entries, file_path, '-u')
svntest.actions.run_and_verify_svn(None, None, [],
'cp', '-m', 'repo-to-repo copy',
sbox.repo_url + '/iota',
sbox.repo_url + '/iota2')
-
+
file_path = sbox.ospath('iota2')
- template = ['<?xml version="1.0" encoding="UTF-8"?>\n',
- "<status>\n",
- "<target\n",
- " path=\"%s\">\n" % (file_path),
- "<entry\n",
- " path=\"%s\">\n" % (file_path),
- "<wc-status\n",
- " props=\"none\"\n",
- " item=\"none\">\n",
- "</wc-status>\n",
- "<repos-status\n",
- " props=\"none\"\n",
- " item=\"added\">\n",
- "</repos-status>\n",
- "</entry>\n",
- "<against\n",
- " revision=\"2\"/>\n",
- "</target>\n",
- "</status>\n",
- ]
+ expected_entries = {file_path : {'wcprops' : 'none',
+ 'wcitem' : 'none',
+ 'rprops' : 'none',
+ 'ritem' : 'added'}}
- exit_code, output, error = svntest.actions.run_and_verify_svn(None, None, [],
- 'status',
- file_path,
- '--xml', '-u')
-
- for i in range(0, len(output)):
- if output[i] != template[i]:
- print("ERROR: expected: %s actual: %s" % (template[i], output[i]))
- raise svntest.Failure
+ svntest.actions.run_and_verify_status_xml(expected_entries, file_path, '-u')
#----------------------------------------------------------------------
@@ -1269,53 +1220,23 @@ def status_update_with_incoming_props(sb
else:
raise svntest.Failure
- xout = ['<?xml version="1.0" encoding="UTF-8"?>\n',
- "<status>\n",
- "<target\n",
- " path=\"%s\">\n" % (wc_dir),
- "<entry\n",
- " path=\"%s\">\n" % (A_path),
- "<wc-status\n",
- " props=\"none\"\n",
- " item=\"normal\"\n",
- " revision=\"1\">\n",
- "<commit\n",
- " revision=\"1\">\n",
- "<author>%s</author>\n" % svntest.main.wc_author,
- time_str,
- "</commit>\n",
- "</wc-status>\n",
- "<repos-status\n",
- " props=\"modified\"\n",
- " item=\"none\">\n",
- "</repos-status>\n",
- "</entry>\n",
- "<entry\n",
- " path=\"%s\">\n" % (wc_dir),
- "<wc-status\n",
- " props=\"none\"\n",
- " item=\"normal\"\n",
- " revision=\"1\">\n",
- "<commit\n",
- " revision=\"1\">\n",
- "<author>%s</author>\n" % svntest.main.wc_author,
- time_str,
- "</commit>\n",
- "</wc-status>\n",
- "<repos-status\n",
- " props=\"modified\"\n",
- " item=\"none\">\n",
- "</repos-status>\n",
- "</entry>\n",
- "<against\n",
- " revision=\"2\"/>\n",
- "</target>\n",
- "</status>\n",]
-
- exit_code, output, error = svntest.actions.run_and_verify_svn(None, xout, [],
- 'status',
- wc_dir,
- '--xml', '-uN')
+ expected_entries ={wc_dir : {'wcprops' : 'none',
+ 'wcitem' : 'normal',
+ 'wcrev' : '1',
+ 'crev' : '1',
+ 'author' : svntest.main.wc_author,
+ 'rprops' : 'modified',
+ 'ritem' : 'none'},
+ A_path : {'wcprops' : 'none',
+ 'wcitem' : 'normal',
+ 'wcrev' : '1',
+ 'crev' : '1',
+ 'author' : svntest.main.wc_author,
+ 'rprops' : 'modified',
+ 'ritem' : 'none'},
+ }
+
+ svntest.actions.run_and_verify_status_xml(expected_entries, wc_dir, '-uN')
# more incoming prop updates.
def status_update_verbose_with_incoming_props(sbox):
@@ -2004,7 +1925,7 @@ def status_not_present(sbox):
svntest.main.run_svn(None, 'up', '--set-depth', 'exclude',
sbox.ospath('A/mu'), sbox.ospath('A/B'))
sbox.simple_commit()
-
+
svntest.actions.run_and_verify_svn(None, [], [],'status',
sbox.ospath('iota'),
sbox.ospath('A/B'),
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py Mon Mar 5 20:34:22 2012
@@ -111,10 +111,10 @@ def check_hotcopy_fsfs(src, dst):
# both at EOF
break
elif buf1:
- raise svntest.Failure("%s differs at offset %i" %
+ raise svntest.Failure("%s differs at offset %i" %
(dst_path, offset))
elif buf2:
- raise svntest.Failure("%s differs at offset %i" %
+ raise svntest.Failure("%s differs at offset %i" %
(dst_path, offset))
if len(buf1) != len(buf2):
raise svntest.Failure("%s differs in length" % dst_path)
@@ -1466,7 +1466,7 @@ def verify_non_utf8_paths(sbox):
def test_lslocks_and_rmlocks(sbox):
"test 'svnadmin lslocks' and 'svnadmin rmlocks'"
-
+
sbox.build(create_wc=False)
iota_url = sbox.repo_url + '/iota'
lambda_url = sbox.repo_url + '/A/B/lambda'
@@ -1480,7 +1480,7 @@ def test_lslocks_and_rmlocks(sbox):
expected_output = UnorderedOutput(
["'A/B/lambda' locked by user 'jrandom'.\n",
"'iota' locked by user 'jrandom'.\n"])
-
+
# Lock iota and A/B/lambda using svn client
svntest.actions.run_and_verify_svn(None, expected_output,
[], "lock", "-m", "Locking files",
@@ -1495,18 +1495,18 @@ def test_lslocks_and_rmlocks(sbox):
"Comment \(1 line\):",
"Locking files",
"Path: /iota",
- "UUID Token: opaquelocktoken.*",
- "\n", # empty line
+ "UUID Token: opaquelocktoken.*",
+ "\n", # empty line
]
# List all locks
exit_code, output, errput = svntest.main.run_svnadmin("lslocks",
sbox.repo_dir)
-
+
if errput:
raise SVNUnexpectedStderr(errput)
svntest.verify.verify_exit_code(None, exit_code, 0)
-
+
try:
expected_output = svntest.verify.UnorderedRegexOutput(expected_output_list)
svntest.verify.compare_and_display_lines('lslocks output mismatch',
@@ -1540,7 +1540,7 @@ def test_lslocks_and_rmlocks(sbox):
"Expires:",
"Comment \(1 line\):",
"Locking files",
- "\n", # empty line
+ "\n", # empty line
])
svntest.verify.compare_and_display_lines('message', 'label',
@@ -1554,7 +1554,7 @@ def test_lslocks_and_rmlocks(sbox):
"A/B/lambda")
expected_output = UnorderedOutput(["Removed lock on '/iota'.\n",
"Removed lock on '/A/B/lambda'.\n"])
-
+
svntest.verify.verify_outputs(
"Unexpected output while running 'svnadmin rmlocks'.",
output, [], expected_output, None)
@@ -1652,7 +1652,7 @@ def hotcopy_incremental_packed(sbox):
def locking(sbox):
"svnadmin lock tests"
sbox.build(create_wc=False)
-
+
comment_path = os.path.join(svntest.main.temp_dir, "comment")
svntest.main.file_write(comment_path, "dummy comment")
@@ -1662,15 +1662,15 @@ def locking(sbox):
# Test illegal character in comment file.
expected_error = ".*svnadmin: E130004:.*"
svntest.actions.run_and_verify_svnadmin(None, None,
- expected_error, "lock",
+ expected_error, "lock",
sbox.repo_dir,
"iota", "jrandom",
invalid_comment_path)
-
+
# Test locking path with --bypass-hooks
expected_output = "'iota' locked by user 'jrandom'."
svntest.actions.run_and_verify_svnadmin(None, expected_output,
- None, "lock",
+ None, "lock",
sbox.repo_dir,
"iota", "jrandom",
comment_path,
@@ -1678,13 +1678,13 @@ def locking(sbox):
# Remove lock
svntest.actions.run_and_verify_svnadmin(None, None,
- None, "rmlocks",
+ None, "rmlocks",
sbox.repo_dir, "iota")
-
+
# Test locking path without --bypass-hooks
expected_output = "'iota' locked by user 'jrandom'."
svntest.actions.run_and_verify_svnadmin(None, expected_output,
- None, "lock",
+ None, "lock",
sbox.repo_dir,
"iota", "jrandom",
comment_path)
@@ -1692,7 +1692,7 @@ def locking(sbox):
# Test locking already locked path.
expected_error = ".*svnadmin: E160035:.*"
svntest.actions.run_and_verify_svnadmin(None, None,
- expected_error, "lock",
+ expected_error, "lock",
sbox.repo_dir,
"iota", "jrandom",
comment_path)
@@ -1700,7 +1700,7 @@ def locking(sbox):
# Test locking non-existent path.
expected_error = ".*svnadmin: E160013:.*"
svntest.actions.run_and_verify_svnadmin(None, None,
- expected_error, "lock",
+ expected_error, "lock",
sbox.repo_dir,
"non-existent", "jrandom",
comment_path)
@@ -1709,7 +1709,7 @@ def locking(sbox):
expected_output = "'A/D/G/rho' locked by user 'jrandom'."
lock_token = "opaquelocktoken:01234567-89ab-cdef-89ab-cdef01234567"
svntest.actions.run_and_verify_svnadmin(None, expected_output,
- None, "lock",
+ None, "lock",
sbox.repo_dir,
"A/D/G/rho", "jrandom",
comment_path, lock_token)
@@ -1718,11 +1718,11 @@ def locking(sbox):
expected_error = ".*svnadmin: E160040:.*"
wrong_lock_token = "opaquelocktoken:12345670-9ab8-defc-9ab8-def01234567c"
svntest.actions.run_and_verify_svnadmin(None, None,
- expected_error, "unlock",
+ expected_error, "unlock",
sbox.repo_dir,
"A/D/G/rho", "jrandom",
wrong_lock_token)
-
+
# Test unlocking the path again, but this time provide the correct
# lock token.
expected_output = "'A/D/G/rho' unlocked."
@@ -1737,12 +1737,12 @@ def locking(sbox):
svntest.main.create_python_hook_script(hook_path, 'import sys; sys.exit(1)')
hook_path = svntest.main.get_pre_unlock_hook_path(sbox.repo_dir)
svntest.main.create_python_hook_script(hook_path, 'import sys; sys.exit(1)')
-
+
# Test locking a path. Don't use --bypass-hooks, though, as we wish
# to verify that hook script is really getting executed.
expected_error = ".*svnadmin: E165001:.*"
svntest.actions.run_and_verify_svnadmin(None, None,
- expected_error, "lock",
+ expected_error, "lock",
sbox.repo_dir,
"iota", "jrandom",
comment_path)
@@ -1764,7 +1764,7 @@ def locking(sbox):
# with a preventative hook in place.
expected_error = ".*svnadmin: E165001:.*"
svntest.actions.run_and_verify_svnadmin(None, None,
- expected_error, "unlock",
+ expected_error, "unlock",
sbox.repo_dir,
"iota", "jrandom",
iota_token)
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svndumpfilter_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svndumpfilter_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svndumpfilter_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svndumpfilter_tests.py Mon Mar 5 20:34:22 2012
@@ -164,6 +164,9 @@ def svndumpfilter_loses_mergeinfo(sbox):
def _simple_dumpfilter_test(sbox, dumpfile, *dumpargs):
+ """Run svndumpfilter with arguments DUMPARGS, taking input from DUMPFILE.
+ Check that the output consists of the standard Greek tree excluding
+ all paths that start with 'A/B/E', 'A/D/G' or 'A/D/H'."""
wc_dir = sbox.wc_dir
filtered_output, filtered_err = filter_and_return_output(dumpfile, 0,
@@ -596,6 +599,58 @@ def dropped_but_not_renumbered_empty_rev
'propget', 'svn:mergeinfo', '-R',
sbox.repo_url)
+#----------------------------------------------------------------------
+def match_empty_prefix(sbox):
+ "svndumpfilter with an empty prefix"
+
+ dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
+ 'svndumpfilter_tests_data',
+ 'greek_tree.dump')
+ dumpfile = open(dumpfile_location).read()
+
+ def test(sbox, dumpfile, *dumpargs):
+ """Run svndumpfilter with DUMPFILE as the input lines, load
+ the result and check it matches EXPECTED_DISK, EXPECTED_OUTPUT,
+ EXPECTED_STATUS."""
+
+ # Filter the Greek tree dump
+ filtered_output, filtered_err = filter_and_return_output(dumpfile, 0,
+ '--quiet',
+ *dumpargs)
+ if filtered_err:
+ raise verify.UnexpectedStderr(filtered_err)
+
+ # Load the filtered dump into a repo and check the result
+ test_create(sbox)
+ load_and_verify_dumpstream(sbox, [], [], None, filtered_output,
+ '--ignore-uuid')
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status)
+
+ # Test excluding everything
+ expected_disk = svntest.wc.State(sbox.wc_dir, {})
+ expected_output = svntest.wc.State(sbox.wc_dir, {})
+ expected_status = svntest.wc.State(sbox.wc_dir, {
+ '': Item(status=' ', wc_rev=1) })
+
+ test(sbox, dumpfile, 'exclude', '')
+
+ # Test including everything
+ expected_disk = svntest.main.greek_state.copy()
+ expected_output = svntest.main.greek_state.copy().tweak(status='A ')
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+
+ test(sbox, dumpfile, 'include', '', '/A/D/G')
+
+ # Note: We also ought to test the '--pattern' option, including or
+ # excluding a pattern of '*'. However, passing a wildcard parameter
+ # is troublesome on Windows: it may be expanded, depending on whether
+ # the svndumpfilter executable was linked with 'setargv.obj', and there
+ # doesn't seem to be a consistent way to quote such an argument to
+ # prevent expansion.
+
########################################################################
# Run the tests
@@ -608,6 +663,7 @@ test_list = [ None,
dumpfilter_with_patterns,
filter_mergeinfo_revs_outside_of_dump_stream,
dropped_but_not_renumbered_empty_revs,
+ match_empty_prefix,
]
if __name__ == '__main__':
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svnlook_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svnlook_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svnlook_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svnlook_tests.py Mon Mar 5 20:34:22 2012
@@ -117,35 +117,39 @@ def test_misc(sbox):
# the 'svnlook tree --full-paths' output if demanding the whole repository
treelist = run_svnlook('tree', repo_dir)
treelistfull = run_svnlook('tree', '--full-paths', repo_dir)
+
path = ''
- n = 0
+ treelistexpand = []
for entry in treelist:
len1 = len(entry)
len2 = len(entry.lstrip())
- path = path[0:2*(len1-len2)-1] + entry.strip()
- test = treelistfull[n].rstrip()
- if n != 0:
- test = "/" + test
- if not path == test:
- print("Unexpected result from tree with --full-paths:")
- print(" entry : %s" % entry.rstrip())
- print(" with --full-paths: %s" % treelistfull[n].rstrip())
- raise svntest.Failure
- n = n + 1
+ path = path[0:2*(len1-len2)-1] + entry.strip() + '\n'
+ if path == '/\n':
+ treelistexpand.append(path)
+ else:
+ treelistexpand.append(path[1:])
+
+ treelistexpand = svntest.verify.UnorderedOutput(treelistexpand)
+ svntest.verify.compare_and_display_lines('Unexpected result from tree', '',
+ treelistexpand, treelistfull)
# check if the 'svnlook tree' output is the ending of
# the 'svnlook tree --full-paths' output if demanding
# any part of the repository
- n = 0
treelist = run_svnlook('tree', repo_dir, '/A/B')
treelistfull = run_svnlook('tree', '--full-paths', repo_dir, '/A/B')
+
+ path = ''
+ treelistexpand = []
for entry in treelist:
- if not treelistfull[n].endswith(entry.lstrip()):
- print("Unexpected result from tree with --full-paths:")
- print(" entry : %s" % entry.rstrip())
- print(" with --full-paths: %s" % treelistfull[n].rstrip())
- raise svntest.Failure
- n = n + 1
+ len1 = len(entry)
+ len2 = len(entry.lstrip())
+ path = path[0:2*(len1-len2)] + entry.strip() + '\n'
+ treelistexpand.append('/A/' + path)
+
+ treelistexpand = svntest.verify.UnorderedOutput(treelistexpand)
+ svntest.verify.compare_and_display_lines('Unexpected result from tree', '',
+ treelistexpand, treelistfull)
treelist = run_svnlook('tree', repo_dir, '/')
if treelist[0] != '/\n':
@@ -695,7 +699,7 @@ fp.close()"""
# internal property, not really expected
' svn:check-locks\n',
' bogus_rev_prop\n', ' svn:date\n']
- verify_logfile(logfilepath, expected_data)
+ verify_logfile(logfilepath, svntest.verify.UnorderedOutput(expected_data))
########################################################################
# Run the tests
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svnrdump_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svnrdump_tests.py Mon Mar 5 20:34:22 2012
@@ -89,7 +89,7 @@ def compare_repos_dumps(svnrdump_sbox, s
svnadmin_contents = svntest.actions.run_and_verify_dump(
svnadmin_sbox.repo_dir)
- svntest.verify.compare_and_display_lines(
+ svntest.verify.compare_dump_files(
"Dump files", "DUMP", svnadmin_contents, svnrdump_contents)
def run_dump_test(sbox, dumpfile_name, expected_dumpfile_name = None,
@@ -142,7 +142,7 @@ def run_dump_test(sbox, dumpfile_name, e
svntest.verify.compare_and_display_lines(
"Dump files", "DUMP", svnadmin_dumpfile, svnrdump_dumpfile,
None, mismatched_headers_re)
-
+
else:
compare_repos_dumps(sbox, svnadmin_dumpfile)
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svnsync_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svnsync_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svnsync_tests.py Mon Mar 5 20:34:22 2012
@@ -223,7 +223,7 @@ def verify_mirror(dest_sbox, src_sbox):
dest_dump = svntest.actions.run_and_verify_dump(dest_sbox.repo_dir)
src_dump = svntest.actions.run_and_verify_dump(src_sbox.repo_dir)
- svntest.verify.compare_and_display_lines(
+ svntest.verify.compare_dump_files(
"Dump files", "DUMP", src_dump, dest_dump)
def run_test(sbox, dump_file_name, subdir=None, exp_dump_file_name=None,
@@ -251,7 +251,7 @@ or another dump file."""
# file.
if exp_dump_file_name:
build_repos(sbox)
- svntest.actions.run_and_verify_load(sbox.repo_dir,
+ svntest.actions.run_and_verify_load(sbox.repo_dir,
open(os.path.join(svnsync_tests_dir,
exp_dump_file_name),
'rb').readlines())
@@ -399,25 +399,32 @@ def basic_authz(sbox):
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,
- "[svnsync-basic-authz:/]\n"
+ "[%s:/]\n"
"* = r\n"
"\n"
- "[svnsync-basic-authz:/A/B]\n"
+ "[%s:/A/B]\n"
"* = \n"
"\n"
- "[svnsync-basic-authz-1:/]\n"
- "* = rw\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)
@@ -470,29 +477,17 @@ def copy_from_unreadable_dir(sbox):
svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
- fp = open(sbox.authz_file, 'w')
-
- # For mod_dav_svn's parent path setup we need per-repos permissions in
- # the authz file...
- if sbox.repo_url.startswith('http'):
- fp.write("[svnsync-copy-from-unreadable-dir:/]\n" +
- "* = r\n" +
- "\n" +
- "[svnsync-copy-from-unreadable-dir:/A/B]\n" +
- "* = \n" +
- "\n" +
- "[svnsync-copy-from-unreadable-dir-1:/]\n" +
- "* = rw")
-
- # Otherwise we can just go with the permissions needed for the source
- # repository.
- else:
- fp.write("[/]\n" +
- "* = r\n" +
- "\n" +
- "[/A/B]\n" +
- "* =\n")
- fp.close()
+ 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)
@@ -596,29 +591,17 @@ def copy_with_mod_from_unreadable_dir(sb
svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
- fp = open(sbox.authz_file, 'w')
-
- # For mod_dav_svn's parent path setup we need per-repos permissions in
- # the authz file...
- if sbox.repo_url.startswith('http'):
- fp.write("[svnsync-copy-with-mod-from-unreadable-dir:/]\n" +
- "* = r\n" +
- "\n" +
- "[svnsync-copy-with-mod-from-unreadable-dir:/A/B]\n" +
- "* = \n" +
- "\n" +
- "[svnsync-copy-with-mod-from-unreadable-dir-1:/]\n" +
- "* = rw")
-
- # Otherwise we can just go with the permissions needed for the source
- # repository.
- else:
- fp.write("[/]\n" +
- "* = r\n" +
- "\n" +
- "[/A/B]\n" +
- "* =\n")
- fp.close()
+ 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)
@@ -700,29 +683,17 @@ def copy_with_mod_from_unreadable_dir_an
svntest.actions.enable_revprop_changes(dest_sbox.repo_dir)
- fp = open(sbox.authz_file, 'w')
-
- # For mod_dav_svn's parent path setup we need per-repos permissions in
- # the authz file...
- if sbox.repo_url.startswith('http'):
- fp.write("[svnsync-copy-with-mod-from-unreadable-dir-and-copy:/]\n" +
- "* = r\n" +
- "\n" +
- "[svnsync-copy-with-mod-from-unreadable-dir-and-copy:/A/B]\n" +
- "* = \n" +
- "\n" +
- "[svnsync-copy-with-mod-from-unreadable-dir-and-copy-1:/]\n" +
- "* = rw")
-
- # Otherwise we can just go with the permissions needed for the source
- # repository.
- else:
- fp.write("[/]\n" +
- "* = r\n" +
- "\n" +
- "[/A/B]\n" +
- "* =\n")
- fp.close()
+ 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)
@@ -1028,6 +999,46 @@ def fd_leak_sync_from_serf_to_local(sbox
import resource
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 \
+ + svntest.main.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
@@ -1068,7 +1079,8 @@ test_list = [ None,
specific_deny_authz,
descend_into_replace,
delete_revprops,
- fd_leak_sync_from_serf_to_local,
+ fd_leak_sync_from_serf_to_local, # calls setrlimit
+ copy_delete_unreadable_child,
]
serial_only = True
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svntest/actions.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svntest/actions.py Mon Mar 5 20:34:22 2012
@@ -129,7 +129,7 @@ def guarantee_empty_repository(path):
# the `pristine repos' to a new location.
# Note: make sure setup_pristine_greek_repository was called once before
# using this function.
-def guarantee_greek_repository(path):
+def guarantee_greek_repository(path, minor_version):
"""Guarantee that a local svn repository exists at PATH, containing
nothing but the greek-tree at revision 1."""
@@ -139,7 +139,7 @@ def guarantee_greek_repository(path):
# copy the pristine repository to PATH.
main.safe_rmtree(path)
- if main.copy_repos(main.pristine_greek_repos_dir, path, 1):
+ if main.copy_repos(main.pristine_greek_repos_dir, path, 1, 1, minor_version):
print("ERROR: copying repository failed.")
sys.exit(1)
@@ -556,9 +556,13 @@ class LogEntry:
self.revprops = revprops
def assert_changed_paths(self, changed_paths):
- """Not implemented, so just raises svntest.Failure.
+ """Assert that changed_paths is the same as this entry's changed_paths
+ Raises svntest.Failure if not.
"""
- raise Failure('NOT IMPLEMENTED')
+ if self.changed_paths != changed_paths:
+ raise Failure('\n' + '\n'.join(difflib.ndiff(
+ pprint.pformat(changed_paths).splitlines(),
+ pprint.pformat(self.changed_paths).splitlines())))
def assert_revprops(self, revprops):
"""Assert that the dict revprops is the same as this entry's revprops.
@@ -591,11 +595,13 @@ class LogParser:
self.parser.EndElementHandler = self.handle_end_element
self.parser.CharacterDataHandler = self.handle_character_data
# Ignore some things.
- self.ignore_elements('log', 'paths', 'path', 'revprops')
+ self.ignore_elements('log', 'paths', 'revprops')
self.ignore_tags('logentry_end', 'author_start', 'date_start', 'msg_start')
# internal state
self.cdata = []
self.property = None
+ self.kind = None
+ self.action = None
# the result
self.entries = []
@@ -639,6 +645,12 @@ class LogParser:
self.property = attrs['name']
def property_end(self):
self.entries[-1].revprops[self.property] = self.use_cdata()
+ def path_start(self, attrs):
+ self.kind = attrs['kind']
+ self.action = attrs['action']
+ def path_end(self):
+ self.entries[-1].changed_paths[self.use_cdata()] = [{'kind': self.kind,
+ 'action': self.action}]
def run_and_verify_log_xml(message=None, expected_paths=None,
expected_revprops=None, expected_stdout=None,
@@ -1079,13 +1091,21 @@ def run_and_verify_merge(dir, rev1, rev2
if dry_run and merge_diff_out != out_dry:
# Due to the way ra_serf works, it's possible that the dry-run and
# real merge operations did the same thing, but the output came in
- # a different order. Let's see if maybe that's the case.
+ # a different order. Let's see if maybe that's the case by comparing
+ # the outputs as unordered sets rather than as lists.
+ #
+ # This now happens for other RA layers with modern APR because the
+ # hash order now varies.
#
- # NOTE: Would be nice to limit this dance to serf tests only, but...
- out_copy = merge_diff_out[:]
- out_dry_copy = out_dry[:]
- out_copy.sort()
- out_dry_copy.sort()
+ # The different orders of the real and dry-run merges may cause
+ # the "Merging rX through rY into" lines to be duplicated a
+ # different number of times in the two outputs. The list-set
+ # conversion removes duplicates so these differences are ignored.
+ # It also removes "U some/path" duplicate lines. Perhaps we
+ # should avoid that?
+ out_copy = set(merge_diff_out[:])
+ out_dry_copy = set(out_dry[:])
+
if out_copy != out_dry_copy:
print("=============================================================")
print("Merge outputs differ")
@@ -1198,16 +1218,11 @@ def run_and_verify_patch(dir, patch_path
raise verify.SVNUnexpectedStderr
if dry_run and out != out_dry:
- print("=============================================================")
- print("Outputs differ")
- print("'svn patch --dry-run' output:")
- for x in out_dry:
- sys.stdout.write(x)
- print("'svn patch' output:")
- for x in out:
- sys.stdout.write(x)
- print("=============================================================")
- raise main.SVNUnmatchedError
+ # APR hash order means the output order can vary, assume everything is OK
+ # if only the order changes.
+ out_dry_expected = svntest.verify.UnorderedOutput(out)
+ verify.compare_and_display_lines('dry-run patch output not as expected',
+ '', out_dry_expected, out_dry)
def missing_skip(a, b):
print("=============================================================")
@@ -1230,7 +1245,8 @@ def run_and_verify_patch(dir, patch_path
# when the expected output is a list, we want a line-by-line
# comparison to happen instead of a tree comparison
- if isinstance(output_tree, list):
+ if (isinstance(output_tree, list)
+ or isinstance(output_tree, verify.UnorderedOutput)):
verify.verify_outputs(None, out, err, output_tree, error_re_string)
output_tree = None
@@ -1503,6 +1519,56 @@ def run_and_verify_unquiet_status(wc_dir
tree.dump_tree_script(actual, wc_dir_name + os.sep)
raise
+def run_and_verify_status_xml(expected_entries = [],
+ *args):
+ """ Run 'status --xml' with arguments *ARGS. If successful the output
+ is parsed into an XML document and will be verified by comparing against
+ EXPECTED_ENTRIES.
+ """
+
+ exit_code, output, errput = run_and_verify_svn(None, None, [],
+ 'status', '--xml', *args)
+
+ if len(errput) > 0:
+ raise Failure
+
+ doc = parseString(''.join(output))
+ entries = doc.getElementsByTagName('entry')
+
+ def getText(nodelist):
+ rc = []
+ for node in nodelist:
+ if node.nodeType == node.TEXT_NODE:
+ rc.append(node.data)
+ return ''.join(rc)
+
+ actual_entries = {}
+ for entry in entries:
+ wcstatus = entry.getElementsByTagName('wc-status')[0]
+ commit = entry.getElementsByTagName('commit')
+ author = entry.getElementsByTagName('author')
+ rstatus = entry.getElementsByTagName('repos-status')
+
+ actual_entry = {'wcprops' : wcstatus.getAttribute('props'),
+ 'wcitem' : wcstatus.getAttribute('item'),
+ }
+ if wcstatus.hasAttribute('revision'):
+ actual_entry['wcrev'] = wcstatus.getAttribute('revision')
+ if (commit):
+ actual_entry['crev'] = commit[0].getAttribute('revision')
+ if (author):
+ actual_entry['author'] = getText(author[0].childNodes)
+ if (rstatus):
+ actual_entry['rprops'] = rstatus[0].getAttribute('props')
+ actual_entry['ritem'] = rstatus[0].getAttribute('item')
+
+ actual_entries[entry.getAttribute('path')] = actual_entry
+
+ if expected_entries != actual_entries:
+ raise Failure('\n' + '\n'.join(difflib.ndiff(
+ pprint.pformat(expected_entries).splitlines(),
+ pprint.pformat(actual_entries).splitlines())))
+
def run_and_verify_diff_summarize_xml(error_re_string = [],
expected_prefix = None,
expected_paths = [],
@@ -1678,7 +1744,8 @@ def run_and_verify_revert(expected_paths
# This allows a test to *quickly* bootstrap itself.
-def make_repo_and_wc(sbox, create_wc = True, read_only = False):
+def make_repo_and_wc(sbox, create_wc = True, read_only = False,
+ minor_version = None):
"""Create a fresh 'Greek Tree' repository and check out a WC from it.
If READ_ONLY is False, a dedicated repository will be created, at the path
@@ -1693,7 +1760,7 @@ def make_repo_and_wc(sbox, create_wc = T
# Create (or copy afresh) a new repos with a greek tree in it.
if not read_only:
- guarantee_greek_repository(sbox.repo_dir)
+ guarantee_greek_repository(sbox.repo_dir, minor_version)
if create_wc:
# Generate the expected output tree.
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py Mon Mar 5 20:34:22 2012
@@ -766,7 +766,7 @@ def file_substitute(path, contents, new_
open(path, 'w').write(fcontent)
# For creating blank new repositories
-def create_repos(path):
+def create_repos(path, minor_version = None):
"""Create a brand-new SVN repository at PATH. If PATH does not yet
exist, create it."""
@@ -774,11 +774,13 @@ def create_repos(path):
os.makedirs(path) # this creates all the intermediate dirs, if neccessary
opts = ("--bdb-txn-nosync",)
- if options.server_minor_version < 4:
+ if not minor_version or minor_version > options.server_minor_version:
+ minor_version = options.server_minor_version
+ if minor_version < 4:
opts += ("--pre-1.4-compatible",)
- elif options.server_minor_version < 5:
+ elif minor_version < 5:
opts += ("--pre-1.5-compatible",)
- elif options.server_minor_version < 6:
+ elif minor_version < 6:
opts += ("--pre-1.6-compatible",)
if options.fs_type is not None:
opts += ("--fs-type=" + options.fs_type,)
@@ -802,6 +804,9 @@ def create_repos(path):
"realm = svntest\n[sasl]\nuse-sasl = true\n")
else:
file_append(get_svnserve_conf_file_path(path), "password-db = passwd\n")
+ # This actually creates TWO [users] sections in the file (one of them is
+ # uncommented in `svnadmin create`'s template), so we exercise the .ini
+ # files reading code's handling of duplicates, too. :-)
file_append(os.path.join(path, "conf", "passwd"),
"[users]\njrandom = rayjandom\njconstant = rayjandom\n");
@@ -852,7 +857,8 @@ def create_repos(path):
chmod_tree(path, 0666, 0666)
# For copying a repository
-def copy_repos(src_path, dst_path, head_revision, ignore_uuid = 1):
+def copy_repos(src_path, dst_path, head_revision, ignore_uuid = 1,
+ minor_version = None):
"Copy the repository SRC_PATH, with head revision HEAD_REVISION, to DST_PATH"
# Save any previous value of SVN_DBG_QUIET
@@ -861,7 +867,7 @@ def copy_repos(src_path, dst_path, head_
# Do an svnadmin dump|svnadmin load cycle. Print a fake pipe command so that
# the displayed CMDs can be run by hand
- create_repos(dst_path)
+ create_repos(dst_path, minor_version)
dump_args = ['dump', src_path]
load_args = ['load', dst_path]
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svntest/sandbox.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svntest/sandbox.py Mon Mar 5 20:34:22 2012
@@ -93,14 +93,23 @@ class Sandbox:
shutil.copytree(self.wc_dir, clone.wc_dir, symlinks=True)
return clone
- def build(self, name=None, create_wc=True, read_only=False):
+ def build(self, name=None, create_wc=True, read_only=False,
+ minor_version=None):
"""Make a 'Greek Tree' repo (or refer to the central one if READ_ONLY),
and check out a WC from it (unless CREATE_WC is false). Change the
sandbox's name to NAME. See actions.make_repo_and_wc() for details."""
self._set_name(name, read_only)
- svntest.actions.make_repo_and_wc(self, create_wc, read_only)
+ svntest.actions.make_repo_and_wc(self, create_wc, read_only, minor_version)
self._is_built = True
+ def authz_name(self, repo_dir=None):
+ "return this sandbox's name for use in an authz file"
+ repo_dir = repo_dir or self.repo_dir
+ if self.repo_url.startswith("http"):
+ return os.path.basename(repo_dir)
+ else:
+ return repo_dir.replace('\\', '/')
+
def add_test_path(self, path, remove=True):
self.test_paths.append(path)
if remove:
@@ -272,6 +281,10 @@ class Sandbox:
self.repo_url + '/' + source,
self.repo_url + '/' + dest)
+ def simple_append(self, dest, contents, truncate=False):
+ """Append CONTENTS to file DEST, optionally truncating it first."""
+ open(self.ospath(dest), truncate and 'w' or 'a').write(contents)
+
def is_url(target):
return (target.startswith('^/')
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svntest/verify.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svntest/verify.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svntest/verify.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svntest/verify.py Mon Mar 5 20:34:22 2012
@@ -25,7 +25,8 @@
######################################################################
import re, sys
-from difflib import unified_diff
+from difflib import unified_diff, ndiff
+import pprint
import svntest
@@ -68,6 +69,10 @@ class SVNIncorrectDatatype(SVNUnexpected
run_and_verify_* API"""
pass
+class SVNDumpParseError(svntest.Failure):
+ """Exception raised if parsing a dump file fails"""
+ pass
+
######################################################################
# Comparison of expected vs. actual output
@@ -397,3 +402,193 @@ def verify_exit_code(message, actual, ex
display_lines(message, "Exit Code",
str(expected) + '\n', str(actual) + '\n')
raise raisable
+
+# A simple dump file parser. While sufficient for the current
+# testsuite it doesn't cope with all valid dump files.
+class DumpParser:
+ def __init__(self, lines):
+ self.current = 0
+ self.lines = lines
+ self.parsed = {}
+
+ def parse_line(self, regex, required=True):
+ m = re.match(regex, self.lines[self.current])
+ if not m:
+ if required:
+ raise SVNDumpParseError("expected '%s' at line %d\n%s"
+ % (regex, self.current,
+ self.lines[self.current]))
+ else:
+ return None
+ self.current += 1
+ return m.group(1)
+
+ def parse_blank(self, required=True):
+ if self.lines[self.current] != '\n': # Works on Windows
+ if required:
+ raise SVNDumpParseError("expected blank at line %d\n%s"
+ % (self.current, self.lines[self.current]))
+ else:
+ return False
+ self.current += 1
+ return True
+
+ def parse_format(self):
+ return self.parse_line('SVN-fs-dump-format-version: ([0-9]+)$')
+
+ def parse_uuid(self):
+ return self.parse_line('UUID: ([0-9a-z-]+)$')
+
+ def parse_revision(self):
+ return self.parse_line('Revision-number: ([0-9]+)$')
+
+ def parse_prop_length(self, required=True):
+ return self.parse_line('Prop-content-length: ([0-9]+)$', required)
+
+ def parse_content_length(self, required=True):
+ return self.parse_line('Content-length: ([0-9]+)$', required)
+
+ def parse_path(self):
+ path = self.parse_line('Node-path: (.+)$', required=False)
+ if not path and self.lines[self.current] == 'Node-path: \n':
+ self.current += 1
+ path = ''
+ return path
+
+ def parse_kind(self):
+ return self.parse_line('Node-kind: (.+)$', required=False)
+
+ def parse_action(self):
+ return self.parse_line('Node-action: ([0-9a-z-]+)$')
+
+ def parse_copyfrom_rev(self):
+ return self.parse_line('Node-copyfrom-rev: ([0-9]+)$', required=False)
+
+ def parse_copyfrom_path(self):
+ path = self.parse_line('Node-copyfrom-path: (.+)$', required=False)
+ if not path and self.lines[self.current] == 'Node-copyfrom-path: \n':
+ self.current += 1
+ path = ''
+ return path
+
+ def parse_copy_md5(self):
+ return self.parse_line('Text-copy-source-md5: ([0-9a-z]+)$', required=False)
+
+ def parse_copy_sha1(self):
+ return self.parse_line('Text-copy-source-sha1: ([0-9a-z]+)$', required=False)
+
+ def parse_text_md5(self):
+ return self.parse_line('Text-content-md5: ([0-9a-z]+)$', required=False)
+
+ def parse_text_sha1(self):
+ return self.parse_line('Text-content-sha1: ([0-9a-z]+)$', required=False)
+
+ def parse_text_length(self):
+ return self.parse_line('Text-content-length: ([0-9]+)$', required=False)
+
+ # One day we may need to parse individual property name/values into a map
+ def get_props(self):
+ props = []
+ while not re.match('PROPS-END$', self.lines[self.current]):
+ props.append(self.lines[self.current])
+ self.current += 1
+ self.current += 1
+ return props
+
+ def get_content(self, length):
+ content = ''
+ while len(content) < length:
+ content += self.lines[self.current]
+ self.current += 1
+ if len(content) == length + 1:
+ content = content[:-1]
+ elif len(content) != length:
+ raise SVNDumpParseError("content length expected %d actual %d at line %d"
+ % (length, len(content), self.current))
+ return content
+
+ def parse_one_node(self):
+ node = {}
+ node['kind'] = self.parse_kind()
+ action = self.parse_action()
+ node['copyfrom_rev'] = self.parse_copyfrom_rev()
+ node['copyfrom_path'] = self.parse_copyfrom_path()
+ node['copy_md5'] = self.parse_copy_md5()
+ node['copy_sha1'] = self.parse_copy_sha1()
+ node['prop_length'] = self.parse_prop_length(required=False)
+ node['text_length'] = self.parse_text_length()
+ node['text_md5'] = self.parse_text_md5()
+ node['text_sha1'] = self.parse_text_sha1()
+ node['content_length'] = self.parse_content_length(required=False)
+ self.parse_blank()
+ if node['prop_length']:
+ node['props'] = self.get_props()
+ if node['text_length']:
+ node['content'] = self.get_content(int(node['text_length']))
+ # Hard to determine how may blanks is 'correct' (a delete that is
+ # followed by an add that is a replace and a copy has one fewer
+ # than expected but that can't be predicted until seeing the add)
+ # so allow arbitrary number
+ blanks = 0
+ while self.current < len(self.lines) and self.parse_blank(required=False):
+ blanks += 1
+ node['blanks'] = blanks
+ return action, node
+
+ def parse_all_nodes(self):
+ nodes = {}
+ while True:
+ if self.current >= len(self.lines):
+ break
+ path = self.parse_path()
+ if not path and not path is '':
+ break
+ if not nodes.get(path):
+ nodes[path] = {}
+ action, node = self.parse_one_node()
+ if nodes[path].get(action):
+ raise SVNDumpParseError("duplicate action '%s' for node '%s' at line %d"
+ % (action, path, self.current))
+ nodes[path][action] = node
+ return nodes
+
+ def parse_one_revision(self):
+ revision = {}
+ number = self.parse_revision()
+ revision['prop_length'] = self.parse_prop_length()
+ revision['content_length'] = self.parse_content_length()
+ self.parse_blank()
+ revision['props'] = self.get_props()
+ self.parse_blank()
+ revision['nodes'] = self.parse_all_nodes()
+ return number, revision
+
+ def parse_all_revisions(self):
+ while self.current < len(self.lines):
+ number, revision = self.parse_one_revision()
+ if self.parsed.get(number):
+ raise SVNDumpParseError("duplicate revision %d at line %d"
+ % (number, self.current))
+ self.parsed[number] = revision
+
+ def parse(self):
+ self.parsed['format'] = self.parse_format()
+ self.parse_blank()
+ self.parsed['uuid'] = self.parse_uuid()
+ self.parse_blank()
+ self.parse_all_revisions()
+ return self.parsed
+
+def compare_dump_files(message, label, expected, actual):
+ """Parse two dump files EXPECTED and ACTUAL, both of which are lists
+ of lines as returned by run_and_verify_dump, and check that the same
+ revisions, nodes, properties, etc. are present in both dumps.
+ """
+
+ parsed_expected = DumpParser(expected).parse()
+ parsed_actual = DumpParser(actual).parse()
+
+ if parsed_expected != parsed_actual:
+ raise svntest.Failure('\n' + '\n'.join(ndiff(
+ pprint.pformat(parsed_expected).splitlines(),
+ pprint.pformat(parsed_actual).splitlines())))
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py Mon Mar 5 20:34:22 2012
@@ -307,6 +307,92 @@ def update_binary_file_2(sbox):
#----------------------------------------------------------------------
+@XFail()
+@Issue(4128)
+def update_binary_file_3(sbox):
+ "update locally modified file to equal versions"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Suck up contents of a test .png file.
+ theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
+
+ # Write our files contents out to disk, in A/theta.
+ theta_path = os.path.join(wc_dir, 'A', 'theta')
+ svntest.main.file_write(theta_path, theta_contents, 'wb')
+
+ # Now, `svn add' that file.
+ svntest.main.run_svn(None, 'add', theta_path)
+
+ # Created expected output tree for 'svn ci'
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/theta' : Item(verb='Adding (bin)'),
+ })
+
+ # Create expected status tree
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'A/theta' : Item(status=' ', wc_rev=2),
+ })
+
+ # Commit the new binary file, creating revision 2.
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ # Make some mods to the binary files.
+ svntest.main.file_append(theta_path, "foobar")
+ new_theta_contents = theta_contents + "foobar"
+
+ # Created expected output tree for 'svn ci'
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/theta' : Item(verb='Sending'),
+ })
+
+ # Create expected status tree
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'A/theta' : Item(status=' ', wc_rev=3),
+ })
+
+ # Commit modified working copy, creating revision 3.
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ # Now we locally modify the file back to the old version.
+ svntest.main.file_write(theta_path, theta_contents, 'wb')
+
+ # Create expected output tree for an update to rev 2.
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/theta' : Item(status=' '),
+ })
+
+ # Create expected disk tree for the update
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({
+ 'A/theta' : Item(theta_contents,
+ props={'svn:mime-type' : 'application/octet-stream'}),
+ })
+
+ # Create expected status tree for the update.
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.add({
+ 'A/theta' : Item(status=' ', wc_rev=2),
+ })
+
+ # Do an update from revision 2 and make sure that our binary file
+ # gets reverted to its original contents.
+ # This used to raise a conflict.
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None,
+ None, None, 1,
+ '-r', '2', wc_dir)
+
+#----------------------------------------------------------------------
+
def update_missing(sbox):
"update missing items (by name) in working copy"
@@ -1189,6 +1275,7 @@ def another_hudson_problem(sbox):
# Sigh, I can't get run_and_verify_update to work (but not because
# of issue 919 as far as I can tell)
+ expected_output = svntest.verify.UnorderedOutput(expected_output)
svntest.actions.run_and_verify_svn(None,
expected_output, [],
'up', G_path)
@@ -5680,6 +5767,7 @@ test_list = [ None,
update_moved_dir_file_add,
update_moved_dir_dir_add,
update_moved_dir_file_move,
+ update_binary_file_3,
]
if __name__ == '__main__':
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/upgrade_tests.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/upgrade_tests.py Mon Mar 5 20:34:22 2012
@@ -83,7 +83,7 @@ def replace_sbox_repo_with_tarfile(sbox,
if not dir:
dir = tar_filename.split('.')[0]
-
+
tarpath = os.path.join(os.path.dirname(sys.argv[0]), 'upgrade_tests_data',
tar_filename)
t = tarfile.open(tarpath, 'r:bz2')
@@ -1079,7 +1079,7 @@ def upgrade_with_missing_subdir(sbox):
svntest.main.safe_rmtree(sbox.ospath('A/B'))
# Now upgrade the working copy and expect a missing subdir
- expected_output = [
+ expected_output = svntest.verify.UnorderedOutput([
"Upgraded '%s'\n" % sbox.wc_dir,
"Upgraded '%s'\n" % sbox.ospath('A'),
"Skipped '%s'\n" % sbox.ospath('A/B'),
@@ -1087,7 +1087,7 @@ def upgrade_with_missing_subdir(sbox):
"Upgraded '%s'\n" % sbox.ospath('A/D'),
"Upgraded '%s'\n" % sbox.ospath('A/D/G'),
"Upgraded '%s'\n" % sbox.ospath('A/D/H'),
- ]
+ ])
svntest.actions.run_and_verify_svn(None, expected_output, [],
'upgrade', sbox.wc_dir)
@@ -1163,7 +1163,7 @@ def upgrade_file_externals(sbox):
svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
'file:///tmp/repo', sbox.repo_url,
sbox.wc_dir)
-
+
expected_output = svntest.wc.State(sbox.wc_dir, {
'A/mu' : Item(status=' U'),
'A/B/lambda' : Item(status=' U'),
Modified: subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c Mon Mar 5 20:34:22 2012
@@ -2394,7 +2394,40 @@ merge_adjacent_changes(apr_pool_t *pool)
return SVN_NO_ERROR;
}
+/* Issue #4133, '"diff -x -w" showing wrong change'.
+ The magic number used in this test, 1<<17, is
+ CHUNK_SIZE from ../../libsvn_diff/diff_file.c
+ */
+static svn_error_t *
+test_wrap(apr_pool_t *pool)
+{
+ char ldata[(1<<17) + 4+4+3+1];
+ char rdata[(1<<17) + 4+3+3+1];
+ svn_string_t left, right;
+ svn_diff_file_options_t *diff_opts = svn_diff_file_options_create(pool);
+ diff_opts->ignore_space = TRUE;
+ /* Two long lines. */
+ memset(ldata, '@', 1<<17);
+ memset(rdata, '@', 1<<17);
+ strcpy(&ldata[1<<17], "foo\n" "ba \n" "x \n");
+ strcpy(&rdata[1<<17], "foo\n" "ba\n" "x\t\n");
+
+ /* Cast them to svn_string_t. */
+ left.data = ldata;
+ right.data = rdata;
+ left.len = sizeof(ldata)-1;
+ right.len = sizeof(rdata)-1;
+
+ /* Diff them. Modulo whitespace, they are identical. */
+ {
+ svn_diff_t *diff;
+ SVN_ERR(svn_diff_mem_string_diff(&diff, &left, &right, diff_opts, pool));
+ SVN_TEST_ASSERT(FALSE == svn_diff_contains_diffs(diff));
+ }
+
+ return SVN_NO_ERROR;
+}
/* ========================================================================== */
@@ -2425,5 +2458,7 @@ struct svn_test_descriptor_t test_funcs[
"3-way merge with conflict styles"),
SVN_TEST_PASS2(test_diff4,
"4-way merge; see variance-adjusted-patching.html"),
+ SVN_TEST_XFAIL2(test_wrap,
+ "difference at the start of a 128KB window"),
SVN_TEST_NULL
};
Modified: subversion/branches/ev2-export/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_subr/spillbuf-test.c Mon Mar 5 20:34:22 2012
@@ -112,7 +112,7 @@ test_spillbuf_callback(apr_pool_t *pool)
SVN_ERR(svn_spillbuf__process(&exhausted, buf, read_callback, &counter,
pool));
SVN_TEST_ASSERT(!exhausted);
-
+
SVN_ERR(svn_spillbuf__process(&exhausted, buf, read_callback, &counter,
pool));
SVN_TEST_ASSERT(exhausted);
Modified: subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c Mon Mar 5 20:34:22 2012
@@ -350,12 +350,12 @@ print_row(const nodes_row_t *row,
moved_here_str = ", here";
else
moved_here_str = "";
-
+
if (row->file_external)
file_external_str = ", file-external";
else
file_external_str = "";
-
+
if (row->repo_revnum == SVN_INVALID_REVNUM)
return apr_psprintf(result_pool, "%d, %s, %s%s%s%s",
row->op_depth, row->local_relpath, row->presence,
@@ -3727,7 +3727,7 @@ incomplete_switch(const svn_test_opts_t
{0}
};
- nodes_row_t after_update[] = {
+ nodes_row_t after_update[] = {
{0, "", "normal", 4, "X"},
{0, "B", "normal", 4, "A/B"},
{0, "B/C", "normal", 4, "A/B/C"},
@@ -4195,7 +4195,7 @@ move_to_swap(const svn_test_opts_t *opts
SVN_ERR(wc_move(&b, "A/Y", "X/Y"));
SVN_ERR(wc_move(&b, "X/B", "A/B"));
-
+
{
nodes_row_t nodes[] = {
{0, "", "normal", 1, ""},
Modified: subversion/branches/ev2-export/subversion/tests/libsvn_wc/wc-incomplete-tester.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_wc/wc-incomplete-tester.c?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_wc/wc-incomplete-tester.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_wc/wc-incomplete-tester.c Mon Mar 5 20:34:22 2012
@@ -78,7 +78,7 @@ int main(int argc, const char *argv[])
"Mark WCPATH incomplete at REVISION [and REPOS_RELPATH]\n");
exit(EXIT_FAILURE);
}
-
+
if (apr_initialize())
{
fprintf(stderr, "apr_initialize failed\n");
Modified: subversion/branches/ev2-export/tools/buildbot/slaves/ubuntu-x64/svnbuild.sh
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/buildbot/slaves/ubuntu-x64/svnbuild.sh?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/buildbot/slaves/ubuntu-x64/svnbuild.sh (original)
+++ subversion/branches/ev2-export/tools/buildbot/slaves/ubuntu-x64/svnbuild.sh Mon Mar 5 20:34:22 2012
@@ -30,7 +30,7 @@ echo "========= autogen.sh"
echo "========= configure"
./configure --enable-javahl --enable-maintainer-mode \
--without-berkeley-db \
- --with-jdk=/usr/lib/jvm/java-6-openjdk/ \
+ --with-jdk=/usr/lib/jvm/java-7-openjdk-amd64/ \
--with-junit=/usr/share/java/junit.jar || exit $?
echo "========= make"
Modified: subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd (original)
+++ subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd Mon Mar 5 20:34:22 2012
@@ -32,8 +32,6 @@ IF ERRORLEVEL 1 (
PATH %PATH%;%TESTDIR%\bin
SET result=0
-
-echo python win-tests.py -r -f fsfs --javahl "%TESTDIR%\tests"
python win-tests.py -r -f fsfs --javahl "%TESTDIR%\tests"
IF ERRORLEVEL 1 (
echo [python reported error %ERRORLEVEL%]
@@ -44,10 +42,10 @@ IF EXIST "%TESTDIR%\swig" rmdir /s /q "%
mkdir "%TESTDIR%\swig\py-release\libsvn"
mkdir "%TESTDIR%\swig\py-release\svn"
-xcopy "release\subversion\bindings\swig\python\*.pyd" "%TESTDIR%\swig\py-release\libsvn\*.pyd"
-xcopy "release\subversion\bindings\swig\python\libsvn_swig_py\*.dll" "%TESTDIR%\swig\py-release\libsvn\*.dll"
-xcopy "subversion\bindings\swig\python\*.py" "%TESTDIR%\swig\py-release\libsvn\*.py"
-xcopy "subversion\bindings\swig\python\svn\*.py" "%TESTDIR%\swig\py-release\svn\*.py"
+xcopy "release\subversion\bindings\swig\python\*.pyd" "%TESTDIR%\swig\py-release\libsvn\*.pyd" > nul:
+xcopy "release\subversion\bindings\swig\python\libsvn_swig_py\*.dll" "%TESTDIR%\swig\py-release\libsvn\*.dll" > nul:
+xcopy "subversion\bindings\swig\python\*.py" "%TESTDIR%\swig\py-release\libsvn\*.py" > nul:
+xcopy "subversion\bindings\swig\python\svn\*.py" "%TESTDIR%\swig\py-release\svn\*.py" > nul:
SET PYTHONPATH=%TESTDIR%\swig\py-release
@@ -57,4 +55,25 @@ IF ERRORLEVEL 1 (
SET result=1
)
+mkdir "%TESTDIR%\swig\pl-release\SVN"
+mkdir "%TESTDIR%\swig\pl-release\auto\SVN"
+xcopy subversion\bindings\swig\perl\native\*.pm "%TESTDIR%\swig\pl-release\SVN" > nul:
+pushd release\subversion\bindings\swig\perl\native
+for %%i in (*.dll) do (
+ set name=%%i
+ mkdir "%TESTDIR%\swig\pl-release\auto\SVN\!name:~0,-4!"
+ xcopy "!name:~0,-4!.*" "%TESTDIR%\swig\pl-release\auto\SVN\!name:~0,-4!" > nul:
+ xcopy /y "_Core.dll" "%TESTDIR%\swig\pl-release\auto\SVN\!name:~0,-4!" > nul:
+)
+popd
+
+SET PERL5LIB=%PERL5LIB%;%TESTDIR%\swig\pl-release;
+pushd subversion\bindings\swig\perl\native
+perl -MExtUtils::Command::MM -e test_harness() t\*.t
+IF ERRORLEVEL 1 (
+ echo [Perl reported error %ERRORLEVEL%]
+ REM SET result=1
+)
+popd
+
exit /b %result%
Modified: subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd (original)
+++ subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd Mon Mar 5 20:34:22 2012
@@ -48,7 +48,9 @@ IF NOT ERRORLEVEL 1 (
)
POPD
+
taskkill /im svn.exe /f 2> nul:
+taskkill /im svnlook.exe /f 2> nul:
taskkill /im svnadmin.exe /f 2> nul:
taskkill /im svnserve.exe /f 2> nul:
taskkill /im svnrdump.exe /f 2> nul:
@@ -58,6 +60,9 @@ taskkill /im op-depth-test.exe /f 2> nul
IF EXIST "%TESTDIR%\tests\subversion\tests\cmdline\httpd\" (
rmdir /s /q "%TESTDIR%\tests\subversion\tests\cmdline\httpd"
)
+IF EXIST "%TESTDIR%\swig\" (
+ rmdir /s /q "%TESTDIR%\swig"
+)
del "%TESTDIR%\tests\*.log" 2> nul:
Modified: subversion/branches/ev2-export/tools/client-side/detach.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/client-side/detach.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/client-side/detach.py (original)
+++ subversion/branches/ev2-export/tools/client-side/detach.py Mon Mar 5 20:34:22 2012
@@ -67,7 +67,7 @@ def migrate_sqlite(wc_src, target, wcro
src_c.execute('select count(*) from wc_lock')
count = int(src_c.fetchone()[0])
assert count == 0
-
+
src_c.execute('select count(*) from work_queue')
count = int(src_c.fetchone()[0])
assert count == 0
Modified: subversion/branches/ev2-export/tools/client-side/mergeinfo-sanitizer.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/client-side/mergeinfo-sanitizer.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/client-side/mergeinfo-sanitizer.py (original)
+++ subversion/branches/ev2-export/tools/client-side/mergeinfo-sanitizer.py Mon Mar 5 20:34:22 2012
@@ -177,7 +177,7 @@ def sanitize_mergeinfo(parsed_original_m
for entry in parsed_original_mergeinfo:
get_new_location_segments(parsed_original_mergeinfo[entry], repo_root, wcpath, ctx)
full_mergeinfo.update(parsed_original_mergeinfo[entry])
-
+
hasher(hash_file, newmergeinfo_file)
diff_mergeinfo = core.svn_mergeinfo_diff(full_mergeinfo,
mergeinfo, 1, temp_pool)
@@ -200,7 +200,7 @@ def fix_sanitized_mergeinfo(parsed_origi
ctx, hash_file, newmergeinfo_file, temp_pool):
has_local_modification = check_local_modifications(wcpath, temp_pool)
old_hash = ''
- new_hash = ''
+ new_hash = ''
try:
with open(hash_file, "r") as f:
old_hash = pickle.load(f)
@@ -248,7 +248,7 @@ the working copy before running the scri
sys.exit(1)
def get_original_mergeinfo(wcpath, revision, depth, ctx, temp_pool):
- propget_list = client.svn_client_propget3("svn:mergeinfo", wcpath,
+ propget_list = client.svn_client_propget3("svn:mergeinfo", wcpath,
revision, revision, depth, None,
ctx, temp_pool)
Modified: subversion/branches/ev2-export/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/dev/unix-build/Makefile.svn?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/ev2-export/tools/dev/unix-build/Makefile.svn Mon Mar 5 20:34:22 2012
@@ -70,7 +70,7 @@ SERF_VER = 1.0.0
SERF_OLD_VER = 0.3.1
CYRUS_SASL_VER = 2.1.23
SQLITE_VER = 3070603
-LIBMAGIC_VER = 5.07
+LIBMAGIC_VER = 5.11
RUBY_VER = 1.8.7-p334
BZ2_VER = 1.0.6
PYTHON_VER = 2.7.2
Modified: subversion/branches/ev2-export/tools/dev/which-error.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/dev/which-error.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/dev/which-error.py (original)
+++ subversion/branches/ev2-export/tools/dev/which-error.py Mon Mar 5 20:34:22 2012
@@ -81,7 +81,10 @@ def print_error(code):
try:
print('%08d %s' % (code, __svn_error_codes[code]))
except KeyError:
- print('%08d *** UNKNOWN ERROR CODE ***' % (code))
+ if code == -41:
+ print("Sit by a lake.")
+ else:
+ print('%08d *** UNKNOWN ERROR CODE ***' % (code))
if __name__ == "__main__":
global __svn_error_codes
Modified: subversion/branches/ev2-export/tools/dev/windows-build/Makefile
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/dev/windows-build/Makefile?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/dev/windows-build/Makefile (original)
+++ subversion/branches/ev2-export/tools/dev/windows-build/Makefile Mon Mar 5 20:34:22 2012
@@ -107,7 +107,7 @@ config: targetdir
libsvn_auth_gnome_keyring libsvn_auth_kwallet libsvn_client libsvn_delta libsvn_diff libsvn_fs libsvn_fs_base libsvn_fs_fs libsvn_fs_util libsvn_ra libsvn_ra_local libsvn_ra_neon libsvn_ra_serf libsvn_ra_svn libsvn_repos libsvn_subr libsvn_wc: targetdir
$(MSBUILD) /t:Libraries\$@
$(MAKE) package
-svn svnadmin svndumpfilter svnlook svnmucc svnserve svnsync svnversion entries-dump: targetdir
+svn svnadmin svndumpfilter svnlook svnmucc svnserve svnsync svnversion svnrdump entries-dump: targetdir
$(MSBUILD) /t:Programs\$@
$(MAKE) package
auth-test cache-test changes-test checksum-test client-test compat-test config-test db-test diff-diff3-test dir-delta-editor dirent_uri-test error-test fs-base-test fs-pack-test fs-test hashdump-test key-test locks-test mergeinfo-test opt-test path-test ra-local-test random-test repos-test revision-test skel-test stream-test string-test strings-reps-test svn_test_fs svn_test_main svndiff-test target-test time-test translate-test tree-conflict-data-test utf-test vdelta-test window-test: targetdir
@@ -128,7 +128,7 @@ all2: targetdir
package:
test -d $(SVNDIR)\$(CONFIG)\Subversion\tests\cmdline || mkdir $(SVNDIR)\$(CONFIG)\Subversion\tests\cmdline
test -d $(TARGETDIR)\bin || mkdir $(TARGETDIR)\bin
- for %%i in (svn svnadmin svndumpfilter svnlook svnserve svnsync svnversion) do @$(CP) $(CONFIG)\subversion\%%i\%%i.exe $(TARGETDIR)\bin
+ for %%i in (svn svnadmin svndumpfilter svnlook svnserve svnsync svnversion svnrdump) do @$(CP) $(CONFIG)\subversion\%%i\%%i.exe $(TARGETDIR)\bin
for %%i in (diff diff3 diff4) do @if exist $(CONFIG)\tools\diff\%%i.exe $(CP) $(CONFIG)\tools\diff\%%i.exe $(TARGETDIR)\bin
$(CP) $(APRDIR)\$(CONFIG)/*.dll $(TARGETDIR)\bin
$(CP) $(APRUTILDIR)\$(CONFIG)/*.dll $(TARGETDIR)\bin
Modified: subversion/branches/ev2-export/tools/diff/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/diff/diff.c?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/diff/diff.c (original)
+++ subversion/branches/ev2-export/tools/diff/diff.c Mon Mar 5 20:34:22 2012
@@ -89,6 +89,8 @@ int main(int argc, const char *argv[])
options_array = apr_array_make(pool, 0, sizeof(const char *));
+ diff_options = svn_diff_file_options_create(pool);
+
for (i = 1 ; i < argc ; i++)
{
if (!no_more_options && (argv[i][0] == '-'))
@@ -105,6 +107,11 @@ int main(int argc, const char *argv[])
show_c_function = TRUE;
continue;
}
+ if (argv[i][1] == 'w' && !argv[i][2])
+ {
+ diff_options->ignore_space = svn_diff_file_ignore_space_all;
+ continue;
+ }
APR_ARRAY_PUSH(options_array, const char *) = argv[i];
}
else
@@ -127,8 +134,6 @@ int main(int argc, const char *argv[])
return 2;
}
- diff_options = svn_diff_file_options_create(pool);
-
svn_err = svn_diff_file_options_parse(diff_options, options_array, pool);
if (svn_err)
{
Modified: subversion/branches/ev2-export/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/dist/backport.pl?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/dist/backport.pl (original)
+++ subversion/branches/ev2-export/tools/dist/backport.pl Mon Mar 5 20:34:22 2012
@@ -24,21 +24,19 @@ use Term::ReadKey qw/ReadMode ReadKey/;
use File::Temp qw/tempfile/;
use POSIX qw/ctermid/;
-$/ = ""; # paragraph mode
-
my $SVN = $ENV{SVN} || 'svn'; # passed unquoted to sh
my $VIM = 'vim';
my $STATUS = './STATUS';
my $BRANCHES = '^/subversion/branches';
-my $YES = $ENV{YES}; # batch mode: assume 'yes' without asking
+my $YES = $ENV{YES}; # batch mode: eliminate prompts, add sleeps
my $WET_RUN = qw[false true][1]; # don't commit
my $DEBUG = qw[false true][0]; # 'set -x', etc
# derived values
my $SVNq;
-$SVN .= " --non-interactive" unless defined ctermid;
+$SVN .= " --non-interactive" if $YES or not defined ctermid;
$SVNq = "$SVN -q ";
$SVNq =~ s/-q// if $DEBUG eq 'true';
@@ -127,7 +125,10 @@ EOF
$script .= <<"EOF" if $entry{branch};
reinteg_rev=\`$SVN info $STATUS | sed -ne 's/Last Changed Rev: //p'\`
if $WET_RUN; then
+ # Sleep to avoid out-of-order commit notifications
+ if [ -n "$YES" ]; then sleep 15; fi
$SVNq rm $BRANCHES/$entry{branch} -m "Remove the '$entry{branch}' branch, reintegrated in r\$reinteg_rev."
+ if [ -n "$YES" ]; then sleep 1; fi
else
echo "Removing reintegrated '$entry{branch}' branch"
fi
@@ -162,7 +163,7 @@ sub parse_entry {
# revisions
$branch = sanitize_branch $1 if $_[0] =~ /^(\S*) branch$/;
while ($_[0] =~ /^r/) {
- while ($_[0] =~ s/^r(\d+)(?:,\s*)?//) {
+ while ($_[0] =~ s/^r(\d+)(?:$|[,; ]+)//) {
push @revisions, $1;
}
shift;
@@ -228,22 +229,32 @@ sub main {
usage, exit 0 if @ARGV;
usage, exit 1 unless -r $STATUS;
- my $sawapproved;
@ARGV = $STATUS;
+
+ # Skip most of the file
while (<>) {
- my @lines = split /\n/;
+ last if /^Approved changes/;
+ }
+ while (<>) {
+ last unless /^=+$/;
+ }
+ $/ = ""; # paragraph mode
- # Skip most of the file
- next unless $sawapproved ||= /^Approved changes/;
+ while (<>) {
+ my @lines = split /\n/;
given ($lines[0]) {
# Section header
when (/^[A-Z].*:$/i) {
print "\n\n=== $lines[0]" unless $YES;
}
+ # Separator after section header
+ when (/^=+$/i) {
+ break;
+ }
# Backport entry?
when (/^ \*/) {
- handle_entry @lines if $sawapproved;
+ handle_entry @lines;
}
default {
warn "Unknown entry '$lines[0]' at $ARGV:$.\n";
Modified: subversion/branches/ev2-export/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/dist/release.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/dist/release.py (original)
+++ subversion/branches/ev2-export/tools/dist/release.py Mon Mar 5 20:34:22 2012
@@ -396,9 +396,9 @@ def roll_tarballs(args):
raise RuntimeError('Cannot find usable %s' % dep.label)
if branch != 'trunk':
- # Make sure CHANGES is sync'd.
+ # Make sure CHANGES is sync'd.
compare_changes(repos, branch, args.revnum)
-
+
# Ensure the output directory doesn't already exist
if os.path.exists(get_deploydir(args.base_dir)):
raise RuntimeError('output directory \'%s\' already exists'
Modified: subversion/branches/ev2-export/tools/server-side/svnpredumpfilter.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpredumpfilter.py?rev=1297221&r1=1297220&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/server-side/svnpredumpfilter.py (original)
+++ subversion/branches/ev2-export/tools/server-side/svnpredumpfilter.py Mon Mar 5 20:34:22 2012
@@ -114,12 +114,12 @@ def log(msg, min_verbosity):
elif min_verbosity == 2:
sys.stderr.write("[**] ")
sys.stderr.write(msg + "\n")
-
+
class DependencyTracker:
def __init__(self, include_paths):
self.include_paths = include_paths[:]
self.dependent_paths = []
-
+
def path_included(self, path):
for include_path in self.include_paths + self.dependent_paths:
if subsumes(include_path, path):
@@ -143,7 +143,7 @@ def readline(stream):
def svn_log_stream_get_dependencies(stream, included_paths):
import re
- dt = DependencyTracker(included_paths)
+ dt = DependencyTracker(included_paths)
header_re = re.compile(r'^r([0-9]+) \|.*$')
action_re = re.compile(r'^ [ADMR] /(.*)$')
@@ -153,7 +153,7 @@ def svn_log_stream_get_dependencies(stre
eof = False
path_copies = {}
found_changed_path = False
-
+
while not eof:
try:
line = line_buf is not None and line_buf or readline(stream)
@@ -220,7 +220,7 @@ def svn_log_stream_get_dependencies(stre
raise LogStreamError("No changed paths found; did you remember to run "
"'svn log' with the --verbose (-v) option when "
"generating the input to this script?")
-
+
return dt
def analyze_logs(included_paths):
@@ -268,13 +268,13 @@ def usage_and_exit(errmsg=None):
def main():
config_dir = None
targets_file = None
-
+
try:
opts, args = getopt.getopt(sys.argv[1:], "hv",
["help", "verbose", "targets="])
except getopt.GetoptError, e:
usage_and_exit(str(e))
-
+
for option, value in opts:
if option in ['-h', '--help']:
usage_and_exit()
Modified: subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/client.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/client.py?rev=1297221&r1=1295003&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/client.py (original)
+++ subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/client.py Mon Mar 5 20:34:22 2012
@@ -145,8 +145,8 @@ class XMLStreamHandler(xml.sax.handler.C
class Revision(object):
- def __init__(self, repos, rev):
- self.repos = repos
+ def __init__(self, uuid, rev):
+ self.uuid = uuid
self.rev = rev
self.dirs_changed = [ ]
self.author = None
Modified: subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/server.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/server.py?rev=1297221&r1=1295003&r2=1297221&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/server.py (original)
+++ subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/server.py Mon Mar 5 20:34:22 2012
@@ -37,7 +37,7 @@
# URL is built into 3 parts:
# /${type}/${optional_repo_uuid}/${format}
#
-# If the repository UUID is included in the URl, you will only recieve
+# If the repository UUID is included in the URl, you will only receive
# messages about that repository.
#
# Example Pub clients:
@@ -88,7 +88,7 @@ class Revision:
'author': self.author,
'log': self.log,
'date': self.date}}) +","
- elif format == "xml":
+ elif format == "xml":
c = ET.Element('commit', {'repository': self.repos, 'revision': "%d" % (self.rev)})
ET.SubElement(c, 'author').text = self.author
ET.SubElement(c, 'date').text = self.date
@@ -107,7 +107,7 @@ class Revision:
return json.dumps({'commit': {'repository': self.repos,
'revision': self.rev,
'dirs_changed': self.dirs_changed}}) +","
- elif format == "xml":
+ elif format == "xml":
c = ET.Element('commit', {'repository': self.repos, 'revision': "%d" % (self.rev)})
d = ET.SubElement(c, 'dirs_changed')
for p in self.dirs_changed:
@@ -133,7 +133,7 @@ class Client(object):
def finished(self, reason):
self.alive = False
log.msg("CLOSE: %s:%d (%d clients online)"% (self.r.getClientIP(), self.r.client.port, self.pubsub.cc()))
- try:
+ try:
self.pubsub.remove(self)
except ValueError:
pass
@@ -210,11 +210,11 @@ class SvnPubSub(resource.Resource):
else:
fmt = uri[3]
uuid = uri[2]
-
+
if type not in self.clients.keys():
request.setResponseCode(400)
return "Invalid Reuqest Type\n"
-
+
clients = {'json': JSONClient, 'xml': XMLClient}
clientCls = clients.get(fmt)
if clientCls == None:
@@ -262,7 +262,7 @@ def svnpubsub_server():
root.putChild("commits", s)
root.putChild("commit", s)
return server.Site(root)
-
+
if __name__ == "__main__":
log.startLogging(sys.stdout)
# Port 2069 "HTTP Event Port", whatever, sounds good to me