You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/03/09 11:08:53 UTC
svn commit: r1575685 [11/13] - in /subversion/branches/fsfs-ucsnorm: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/cgi/ contrib/client-side/emacs/ contrib/client-side/svn2cl/
contrib/hook-scripts/ contrib/server-side/sv...
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/diff_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/diff_tests.py Sun Mar 9 10:08:46 2014
@@ -35,6 +35,11 @@ import svntest
from svntest import err, wc
from prop_tests import binary_mime_type_on_text_file_warning
+from svntest.verify import make_diff_header, make_no_diff_deleted_header, \
+ make_diff_header, make_no_diff_deleted_header, \
+ make_git_diff_header, make_diff_prop_header, \
+ make_diff_prop_val, make_diff_prop_deleted, \
+ make_diff_prop_added, make_diff_prop_modified
# (abbreviation)
Skip = svntest.testcase.Skip_deco
@@ -49,183 +54,6 @@ Item = svntest.wc.StateItem
######################################################################
# Generate expected output
-def is_absolute_url(target):
- return (target.startswith('file://')
- or target.startswith('http://')
- or target.startswith('https://')
- or target.startswith('svn://')
- or target.startswith('svn+ssh://'))
-
-def make_diff_header(path, old_tag, new_tag, src_label=None, dst_label=None):
- """Generate the expected diff header for file PATH, with its old and new
- versions described in parentheses by OLD_TAG and NEW_TAG. SRC_LABEL and
- DST_LABEL are paths or urls that are added to the diff labels if we're
- diffing against the repository or diffing two arbitrary paths.
- Return the header as an array of newline-terminated strings."""
- if src_label:
- src_label = src_label.replace('\\', '/')
- if not is_absolute_url(src_label):
- src_label = '.../' + src_label
- src_label = '\t(' + src_label + ')'
- else:
- src_label = ''
- if dst_label:
- dst_label = dst_label.replace('\\', '/')
- if not is_absolute_url(dst_label):
- dst_label = '.../' + dst_label
- dst_label = '\t(' + dst_label + ')'
- else:
- dst_label = ''
- path_as_shown = path.replace('\\', '/')
- return [
- "Index: " + path_as_shown + "\n",
- "===================================================================\n",
- "--- " + path_as_shown + src_label + "\t(" + old_tag + ")\n",
- "+++ " + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
- ]
-
-def make_no_diff_deleted_header(path, old_tag, new_tag):
- """Generate the expected diff header for a deleted file PATH when in
- 'no-diff-deleted' mode. (In that mode, no further details appear after the
- header.) Return the header as an array of newline-terminated strings."""
- path_as_shown = path.replace('\\', '/')
- return [
- "Index: " + path_as_shown + " (deleted)\n",
- "===================================================================\n",
- ]
-
-def make_git_diff_header(target_path, repos_relpath,
- old_tag, new_tag, add=False, src_label=None,
- dst_label=None, delete=False, text_changes=True,
- cp=False, mv=False, copyfrom_path=None,
- copyfrom_rev=None):
- """ Generate the expected 'git diff' header for file TARGET_PATH.
- REPOS_RELPATH is the location of the path relative to the repository root.
- The old and new versions ("revision X", or "working copy") must be
- specified in OLD_TAG and NEW_TAG.
- SRC_LABEL and DST_LABEL are paths or urls that are added to the diff
- labels if we're diffing against the repository. ADD, DELETE, CP and MV
- denotes the operations performed on the file. COPYFROM_PATH is the source
- of a copy or move. Return the header as an array of newline-terminated
- strings."""
-
- path_as_shown = target_path.replace('\\', '/')
- if src_label:
- src_label = src_label.replace('\\', '/')
- src_label = '\t(.../' + src_label + ')'
- else:
- src_label = ''
- if dst_label:
- dst_label = dst_label.replace('\\', '/')
- dst_label = '\t(.../' + dst_label + ')'
- else:
- dst_label = ''
-
- output = [
- "Index: " + path_as_shown + "\n",
- "===================================================================\n"
- ]
- if add:
- output.extend([
- "diff --git a/" + repos_relpath + " b/" + repos_relpath + "\n",
- "new file mode 10644\n",
- ])
- if text_changes:
- output.extend([
- "--- /dev/null\t(" + old_tag + ")\n",
- "+++ b/" + repos_relpath + dst_label + "\t(" + new_tag + ")\n"
- ])
- elif delete:
- output.extend([
- "diff --git a/" + repos_relpath + " b/" + repos_relpath + "\n",
- "deleted file mode 10644\n",
- ])
- if text_changes:
- output.extend([
- "--- a/" + repos_relpath + src_label + "\t(" + old_tag + ")\n",
- "+++ /dev/null\t(" + new_tag + ")\n"
- ])
- elif cp:
- if copyfrom_rev:
- copyfrom_rev = '@' + copyfrom_rev
- else:
- copyfrom_rev = ''
- output.extend([
- "diff --git a/" + copyfrom_path + " b/" + repos_relpath + "\n",
- "copy from " + copyfrom_path + copyfrom_rev + "\n",
- "copy to " + repos_relpath + "\n",
- ])
- if text_changes:
- output.extend([
- "--- a/" + copyfrom_path + src_label + "\t(" + old_tag + ")\n",
- "+++ b/" + repos_relpath + "\t(" + new_tag + ")\n"
- ])
- elif mv:
- output.extend([
- "diff --git a/" + copyfrom_path + " b/" + path_as_shown + "\n",
- "rename from " + copyfrom_path + "\n",
- "rename to " + repos_relpath + "\n",
- ])
- if text_changes:
- output.extend([
- "--- a/" + copyfrom_path + src_label + "\t(" + old_tag + ")\n",
- "+++ b/" + repos_relpath + "\t(" + new_tag + ")\n"
- ])
- else:
- output.extend([
- "diff --git a/" + repos_relpath + " b/" + repos_relpath + "\n",
- "--- a/" + repos_relpath + src_label + "\t(" + old_tag + ")\n",
- "+++ b/" + repos_relpath + dst_label + "\t(" + new_tag + ")\n",
- ])
- return output
-
-def make_diff_prop_header(path):
- """Return a property diff sub-header, as a list of newline-terminated
- strings."""
- return [
- "\n",
- "Property changes on: " + path.replace('\\', '/') + "\n",
- "___________________________________________________________________\n"
- ]
-
-def make_diff_prop_val(plus_minus, pval):
- "Return diff for prop value PVAL, with leading PLUS_MINUS (+ or -)."
- if len(pval) > 0 and pval[-1] != '\n':
- return [plus_minus + pval + "\n","\\ No newline at end of property\n"]
- return [plus_minus + pval]
-
-def make_diff_prop_deleted(pname, pval):
- """Return a property diff for deletion of property PNAME, old value PVAL.
- PVAL is a single string with no embedded newlines. Return the result
- as a list of newline-terminated strings."""
- return [
- "Deleted: " + pname + "\n",
- "## -1 +0,0 ##\n"
- ] + make_diff_prop_val("-", pval)
-
-def make_diff_prop_added(pname, pval):
- """Return a property diff for addition of property PNAME, new value PVAL.
- PVAL is a single string with no embedded newlines. Return the result
- as a list of newline-terminated strings."""
- return [
- "Added: " + pname + "\n",
- "## -0,0 +1 ##\n",
- ] + make_diff_prop_val("+", pval)
-
-def make_diff_prop_modified(pname, pval1, pval2):
- """Return a property diff for modification of property PNAME, old value
- PVAL1, new value PVAL2.
-
- PVAL is a single string with no embedded newlines. A newline at the
- end is significant: without it, we add an extra line saying '\ No
- newline at end of property'.
-
- Return the result as a list of newline-terminated strings.
- """
- return [
- "Modified: " + pname + "\n",
- "## -1 +1 ##\n",
- ] + make_diff_prop_val("-", pval1) + make_diff_prop_val("+", pval2)
######################################################################
# Diff output checker
@@ -732,20 +560,9 @@ def diff_non_version_controlled_file(sbo
svntest.main.file_append(sbox.ospath('A/D/foo'), "a new file")
- exit_code, diff_output, err_output = svntest.main.run_svn(
- 1, 'diff', sbox.ospath('A/D/foo'))
-
- if count_diff_output(diff_output) != 0: raise svntest.Failure
-
- # At one point this would crash, so we would only get a 'Segmentation Fault'
- # error message. The appropriate response is a few lines of errors. I wish
- # there was a way to figure out if svn crashed, but all run_svn gives us is
- # the output, so here we are...
- for line in err_output:
- if re.search("foo' is not under version control$", line):
- break
- else:
- raise svntest.Failure
+ svntest.actions.run_and_verify_svn(None, None,
+ 'svn: E155010: .*foo\' was not found.',
+ 'diff', sbox.ospath('A/D/foo'))
# test 9
def diff_pure_repository_update_a_file(sbox):
@@ -2204,37 +2021,37 @@ def diff_schedule_delete(sbox):
sbox.build()
expected_output_r2_working = make_diff_header("foo", "revision 2",
- "working copy") + [
+ "nonexistent") + [
"@@ -1 +0,0 @@\n",
"-xxx\n"
]
expected_output_r2_base = make_diff_header("foo", "revision 2",
- "working copy") + [
+ "nonexistent") + [
"@@ -1 +0,0 @@\n",
"-xxx\n",
]
- expected_output_base_r2 = make_diff_header("foo", "revision 0",
+ expected_output_base_r2 = make_diff_header("foo", "nonexistent",
"revision 2") + [
"@@ -0,0 +1 @@\n",
"+xxx\n",
]
- expected_output_r1_base = make_diff_header("foo", "revision 0",
+ expected_output_r1_base = make_diff_header("foo", "nonexistent",
"working copy") + [
"@@ -0,0 +1,2 @@\n",
"+xxx\n",
"+yyy\n"
]
expected_output_base_r1 = make_diff_header("foo", "working copy",
- "revision 1") + [
+ "nonexistent") + [
"@@ -1,2 +0,0 @@\n",
"-xxx\n",
"-yyy\n"
]
expected_output_base_working = expected_output_base_r1[:]
expected_output_base_working[2] = "--- foo\t(revision 3)\n"
- expected_output_base_working[3] = "+++ foo\t(working copy)\n"
+ expected_output_base_working[3] = "+++ foo\t(nonexistent)\n"
wc_dir = sbox.wc_dir
os.chdir(wc_dir)
@@ -2427,17 +2244,17 @@ def diff_repos_wc_add_with_props(sbox):
] + make_diff_prop_header("X/bar") + \
make_diff_prop_added("propname", "propvalue")
- diff_X_r1_base = make_diff_header("X", "revision 0",
+ diff_X_r1_base = make_diff_header("X", "nonexistent",
"working copy") + diff_X
- diff_X_base_r3 = make_diff_header("X", "revision 0",
+ diff_X_base_r3 = make_diff_header("X", "nonexistent",
"revision 3") + diff_X
- diff_foo_r1_base = make_diff_header("foo", "revision 0",
+ diff_foo_r1_base = make_diff_header("foo", "nonexistent",
"revision 3") + diff_foo
- diff_foo_base_r3 = make_diff_header("foo", "revision 0",
+ diff_foo_base_r3 = make_diff_header("foo", "nonexistent",
"revision 3") + diff_foo
- diff_X_bar_r1_base = make_diff_header("X/bar", "revision 0",
+ diff_X_bar_r1_base = make_diff_header("X/bar", "nonexistent",
"revision 3") + diff_X_bar
- diff_X_bar_base_r3 = make_diff_header("X/bar", "revision 0",
+ diff_X_bar_base_r3 = make_diff_header("X/bar", "nonexistent",
"revision 3") + diff_X_bar
expected_output_r1_base = svntest.verify.UnorderedOutput(diff_X_r1_base +
@@ -2523,11 +2340,11 @@ def diff_repos_working_added_dir(sbox):
sbox.build()
- expected_output_r1_BASE = make_diff_header("X/bar", "revision 0",
+ expected_output_r1_BASE = make_diff_header("X/bar", "nonexistent",
"revision 2") + [
"@@ -0,0 +1 @@\n",
"+content\n" ]
- expected_output_r1_WORKING = make_diff_header("X/bar", "revision 0",
+ expected_output_r1_WORKING = make_diff_header("X/bar", "nonexistent",
"working copy") + [
"@@ -0,0 +1,2 @@\n",
"+content\n",
@@ -3126,7 +2943,7 @@ def diff_backward_repos_wc_copy(sbox):
svntest.main.run_svn(None, 'up', '-r1')
# diff r2 against working copy
- diff_repos_wc = make_diff_header("A/mucopy", "revision 2", "working copy")
+ diff_repos_wc = make_diff_header("A/mucopy", "revision 2", "nonexistent")
diff_repos_wc += [
"@@ -1 +0,0 @@\n",
"-This is the file 'mu'.\n",
@@ -3398,7 +3215,7 @@ def diff_git_format_wc_wc(sbox):
expected_output = make_git_diff_header(
alpha_copied_path, "A/B/E/alpha_copied",
- "revision 0", "working copy",
+ "nonexistent", "working copy",
copyfrom_path="A/B/E/alpha",
copyfrom_rev='1', cp=True,
text_changes=True) + [
@@ -3412,7 +3229,7 @@ def diff_git_format_wc_wc(sbox):
copyfrom_rev='1', cp=True,
text_changes=False) \
+ make_git_diff_header(mu_path, "A/mu", "revision 1",
- "working copy",
+ "nonexistent",
delete=True) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'mu'.\n",
@@ -3421,7 +3238,7 @@ def diff_git_format_wc_wc(sbox):
"@@ -1 +1,2 @@\n",
" This is the file 'iota'.\n",
"+Changed 'iota'.\n",
- ] + make_git_diff_header(new_path, "new", "revision 0",
+ ] + make_git_diff_header(new_path, "new", "nonexistent",
"working copy", add=True) + [
"@@ -0,0 +1 @@\n",
"+This is the file 'new'.\n",
@@ -3449,19 +3266,19 @@ def diff_git_format_wc_wc_dir_mv(sbox):
svntest.main.run_svn(None, 'mv', g_path, g2_path)
expected_output = make_git_diff_header(pi_path, "A/D/G/pi",
- "revision 1", "working copy",
+ "revision 1", "nonexistent",
delete=True) \
+ [
"@@ -1 +0,0 @@\n",
"-This is the file 'pi'.\n"
] + make_git_diff_header(rho_path, "A/D/G/rho",
- "revision 1", "working copy",
+ "revision 1", "nonexistent",
delete=True) \
+ [
"@@ -1 +0,0 @@\n",
"-This is the file 'rho'.\n"
] + make_git_diff_header(tau_path, "A/D/G/tau",
- "revision 1", "working copy",
+ "revision 1", "nonexistent",
delete=True) \
+ [
"@@ -1 +0,0 @@\n",
@@ -3496,11 +3313,11 @@ def diff_git_format_url_wc(sbox):
svntest.main.run_svn(None, 'commit', '-m', 'Committing changes', wc_dir)
svntest.main.run_svn(None, 'up', wc_dir)
- expected_output = make_git_diff_header(new_path, "new", "revision 0",
+ expected_output = make_git_diff_header(new_path, "new", "nonexistent",
"revision 2", add=True) + [
"@@ -0,0 +1 @@\n",
"+This is the file 'new'.\n",
- ] + make_git_diff_header(mu_path, "A/mu", "revision 1", "working copy",
+ ] + make_git_diff_header(mu_path, "A/mu", "revision 1", "nonexistent",
delete=True) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'mu'.\n",
@@ -3538,11 +3355,11 @@ def diff_git_format_url_url(sbox):
svntest.main.run_svn(None, 'up', wc_dir)
expected_output = make_git_diff_header("A/mu", "A/mu", "revision 1",
- "revision 2",
+ "nonexistent",
delete=True) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'mu'.\n",
- ] + make_git_diff_header("new", "new", "revision 0", "revision 2",
+ ] + make_git_diff_header("new", "new", "nonexistent", "revision 2",
add=True) + [
"@@ -0,0 +1 @@\n",
"+This is the file 'new'.\n",
@@ -3713,7 +3530,7 @@ def diff_git_empty_files(sbox):
svntest.main.run_svn(None, 'add', new_path)
svntest.main.run_svn(None, 'rm', iota_path)
- expected_output = make_git_diff_header(new_path, "new", "revision 0",
+ expected_output = make_git_diff_header(new_path, "new", "nonexistent",
"working copy",
add=True, text_changes=False) + [
] + make_git_diff_header(iota_path, "iota", "revision 2", "working copy",
@@ -3752,7 +3569,7 @@ def diff_git_with_props(sbox):
svntest.main.run_svn(None, 'propset', 'svn:keywords', 'Id', iota_path)
expected_output = make_git_diff_header(new_path, "new",
- "revision 0", "working copy",
+ "nonexistent", "working copy",
add=True, text_changes=False) + \
make_diff_prop_header("new") + \
make_diff_prop_added("svn:eol-style", "native") + \
@@ -3801,7 +3618,7 @@ def diff_correct_wc_base_revnum(sbox):
svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
'--git', wc_dir)
- # The same again, but specifying the target explicity. This should
+ # The same again, but specifying the target explicitly. This should
# give the same output.
svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
'--git', iota_path)
@@ -3935,23 +3752,23 @@ def diff_two_working_copies(sbox):
src_label = os.path.basename(wc_dir_old)
dst_label = os.path.basename(wc_dir)
- expected_output = make_diff_header('newdir/newfile', 'working copy',
+ expected_output = make_diff_header('newdir/newfile', 'nonexistent',
'working copy',
src_label, dst_label) + [
"@@ -0,0 +1 @@\n",
"+new text\n",
] + make_diff_header('A/mu', 'working copy',
- 'working copy',
+ 'nonexistent',
src_label, dst_label) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'mu'.\n",
- ] + make_diff_header('A/B/F', 'working copy',
+ ] + make_diff_header('A/B/F', 'nonexistent',
'working copy',
src_label, dst_label) + [
"@@ -0,0 +1 @@\n",
"+new text\n",
] + make_diff_prop_header('A/B/F') + \
- make_diff_prop_modified("newprop", "propval-old\n",
+ make_diff_prop_added("newprop",
"propval-new\n") + \
make_diff_header('A/B/lambda', 'working copy',
'working copy',
@@ -3969,33 +3786,38 @@ def diff_two_working_copies(sbox):
make_diff_prop_header('A/D/gamma') + \
make_diff_prop_added("newprop", "propval") + \
make_diff_header('A/D/G/pi', 'working copy',
- 'working copy',
+ 'nonexistent',
src_label, dst_label) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'pi'.\n",
- ] + make_diff_header('A/D/G/pi', 'working copy',
+ ] + make_diff_header('A/D/G/pi', 'nonexistent',
'working copy',
src_label, dst_label) + \
make_diff_prop_header('A/D/G/pi') + \
make_diff_prop_added("newprop", "propval") + \
make_diff_header('A/D/H/chi', 'working copy',
- 'working copy',
+ 'nonexistent',
src_label, dst_label) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'chi'.\n",
] + make_diff_header('A/D/H/omega', 'working copy',
- 'working copy',
+ 'nonexistent',
src_label, dst_label) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'omega'.\n",
] + make_diff_header('A/D/H/psi', 'working copy',
- 'working copy',
+ 'nonexistent',
src_label, dst_label) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'psi'.\n",
- ]
+ ] + make_diff_header('A/B/F', 'working copy',
+ 'nonexistent',
+ src_label, dst_label) + \
+ make_diff_prop_header('A/B/F') + \
+ make_diff_prop_deleted('newprop', 'propval-old\n')
- # Files in diff may be in any order.
+
+ # Files in diff may be in any order. #### Not any more, but test order is wrong.
expected_output = svntest.verify.UnorderedOutput(expected_output)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '--old', wc_dir_old,
@@ -4011,15 +3833,15 @@ def diff_deleted_url(sbox):
sbox.simple_commit()
# A diff of r2 with target A/D/H should show the removed children
- expected_output = make_diff_header("chi", "revision 1", "revision 2") + [
+ expected_output = make_diff_header("chi", "revision 1", "nonexistent") + [
"@@ -1 +0,0 @@\n",
"-This is the file 'chi'.\n",
] + make_diff_header("omega", "revision 1",
- "revision 2") + [
+ "nonexistent") + [
"@@ -1 +0,0 @@\n",
"-This is the file 'omega'.\n",
] + make_diff_header("psi", "revision 1",
- "revision 2") + [
+ "nonexistent") + [
"@@ -1 +0,0 @@\n",
"-This is the file 'psi'.\n",
]
@@ -4047,39 +3869,39 @@ def diff_arbitrary_files_and_dirs(sbox):
'--new', sbox.ospath('A/mu'))
# diff A/B/E with A/D
- expected_output = make_diff_header("G/pi", "working copy", "working copy",
+ expected_output = make_diff_header("G/pi", "nonexistent", "working copy",
"B/E", "D") + [
"@@ -0,0 +1 @@\n",
"+This is the file 'pi'.\n"
- ] + make_diff_header("G/rho", "working copy",
+ ] + make_diff_header("G/rho", "nonexistent",
"working copy", "B/E", "D") + [
"@@ -0,0 +1 @@\n",
"+This is the file 'rho'.\n"
- ] + make_diff_header("G/tau", "working copy",
+ ] + make_diff_header("G/tau", "nonexistent",
"working copy", "B/E", "D") + [
"@@ -0,0 +1 @@\n",
"+This is the file 'tau'.\n"
- ] + make_diff_header("H/chi", "working copy",
+ ] + make_diff_header("H/chi", "nonexistent",
"working copy", "B/E", "D") + [
"@@ -0,0 +1 @@\n",
"+This is the file 'chi'.\n"
- ] + make_diff_header("H/omega", "working copy",
+ ] + make_diff_header("H/omega", "nonexistent",
"working copy", "B/E", "D") + [
"@@ -0,0 +1 @@\n",
"+This is the file 'omega'.\n"
- ] + make_diff_header("H/psi", "working copy",
+ ] + make_diff_header("H/psi", "nonexistent",
"working copy", "B/E", "D") + [
"@@ -0,0 +1 @@\n",
"+This is the file 'psi'.\n"
] + make_diff_header("alpha", "working copy",
- "working copy", "B/E", "D") + [
+ "nonexistent", "B/E", "D") + [
"@@ -1 +0,0 @@\n",
"-This is the file 'alpha'.\n"
] + make_diff_header("beta", "working copy",
- "working copy", "B/E", "D") + [
+ "nonexistent", "B/E", "D") + [
"@@ -1 +0,0 @@\n",
"-This is the file 'beta'.\n"
- ] + make_diff_header("gamma", "working copy",
+ ] + make_diff_header("gamma", "nonexistent",
"working copy", "B/E", "D") + [
"@@ -0,0 +1 @@\n",
"+This is the file 'gamma'.\n"
@@ -4413,18 +4235,18 @@ def diff_dir_replaced_by_file(sbox):
'Index: %s\n' % sbox.path('A/B/E/alpha'),
'===================================================================\n',
'--- %s\t(revision 1)\n' % sbox.path('A/B/E/alpha'),
- '+++ %s\t(working copy)\n' % sbox.path('A/B/E/alpha'),
+ '+++ %s\t(nonexistent)\n' % sbox.path('A/B/E/alpha'),
'@@ -1 +0,0 @@\n',
'-This is the file \'alpha\'.\n',
'Index: %s\n' % sbox.path('A/B/E/beta'),
'===================================================================\n',
'--- %s\t(revision 1)\n' % sbox.path('A/B/E/beta'),
- '+++ %s\t(working copy)\n' % sbox.path('A/B/E/beta'),
+ '+++ %s\t(nonexistent)\n' % sbox.path('A/B/E/beta'),
'@@ -1 +0,0 @@\n',
'-This is the file \'beta\'.\n',
'Index: %s\n' % sbox.path('A/B/E'),
'===================================================================\n',
- '--- %s\t(revision 0)\n' % sbox.path('A/B/E'),
+ '--- %s\t(nonexistent)\n' % sbox.path('A/B/E'),
'+++ %s\t(working copy)\n' % sbox.path('A/B/E'),
'@@ -0,0 +1 @@\n',
'+text\n',
@@ -4451,24 +4273,24 @@ def diff_dir_replaced_by_dir(sbox):
'Index: %s\n' % sbox.path('A/B/E/alpha'),
'===================================================================\n',
'--- %s\t(revision 1)\n' % sbox.path('A/B/E/alpha'),
- '+++ %s\t(working copy)\n' % sbox.path('A/B/E/alpha'),
+ '+++ %s\t(nonexistent)\n' % sbox.path('A/B/E/alpha'),
'@@ -1 +0,0 @@\n',
'-This is the file \'alpha\'.\n',
'Index: %s\n' % sbox.path('A/B/E/beta'),
'===================================================================\n',
'--- %s\t(revision 1)\n' % sbox.path('A/B/E/beta'),
- '+++ %s\t(working copy)\n' % sbox.path('A/B/E/beta'),
+ '+++ %s\t(nonexistent)\n' % sbox.path('A/B/E/beta'),
'@@ -1 +0,0 @@\n',
'-This is the file \'beta\'.\n',
'Index: %s\n' % sbox.path('A/B/E/beta'),
'===================================================================\n',
- '--- %s\t(revision 0)\n' % sbox.path('A/B/E/beta'),
+ '--- %s\t(nonexistent)\n' % sbox.path('A/B/E/beta'),
'+++ %s\t(working copy)\n' % sbox.path('A/B/E/beta'),
'@@ -0,0 +1 @@\n',
'+New beta\n',
'Index: %s\n' % sbox.path('A/B/E'),
'===================================================================\n',
- '--- %s\t(revision 0)\n' % sbox.path('A/B/E'),
+ '--- %s\t(nonexistent)\n' % sbox.path('A/B/E'),
'+++ %s\t(working copy)\n' % sbox.path('A/B/E'),
'\n',
'Property changes on: %s\n' % sbox.path('A/B/E'),
@@ -4498,7 +4320,7 @@ def diff_dir_replaced_by_dir(sbox):
'Index: %s\n' % sbox.path('A/B/E/alpha'),
'===================================================================\n',
'--- %s\t(revision 1)\n' % sbox.path('A/B/E/alpha'),
- '+++ %s\t(working copy)\n' % sbox.path('A/B/E/alpha'),
+ '+++ %s\t(nonexistent)\n' % sbox.path('A/B/E/alpha'),
'@@ -1 +0,0 @@\n',
'-This is the file \'alpha\'.\n',
'Index: %s\n' % sbox.path('A/B/E/beta'),
@@ -4688,7 +4510,7 @@ def diff_repo_wc_copies(sbox):
iota_url = sbox.repo_url + '/iota'
sbox.simple_copy('iota', 'iota_copy')
- expected_output = make_diff_header(iota_copy, "revision 0", "working copy",
+ expected_output = make_diff_header(iota_copy, "nonexistent", "working copy",
iota_url, iota_copy) + [
"@@ -0,0 +1 @@\n",
"+This is the file 'iota'.\n" ]
@@ -4791,7 +4613,7 @@ def diff_repo_repo_added_file_mime_type(
sbox.simple_commit() # r2
# try to diff across the addition
- expected_output = make_diff_header(newfile, 'revision 0', 'revision 2') + \
+ expected_output = make_diff_header(newfile, 'nonexistent', 'revision 2') + \
[ '@@ -0,0 +1 @@\n',
"+This is the file 'newfile'.\n" ] + \
make_diff_prop_header(newfile) + \
@@ -4801,13 +4623,59 @@ def diff_repo_repo_added_file_mime_type(
'-r1:2', newfile)
# reverse the diff to diff across a deletion
- # Note no property delete is printed when whole file is deleted
- expected_output = make_diff_header(newfile, 'revision 2', 'revision 1') + \
- [ '@@ -1, +0,0 @@\n',
- "-This is the file 'newfile'.\n" ]
- svntest.actions.run_and_verify_svn(None, None, [], 'diff',
+ expected_output = make_diff_header(newfile, 'revision 2', 'nonexistent') + \
+ [ '@@ -1 +0,0 @@\n',
+ "-This is the file 'newfile'.\n",
+ '\n',
+ 'Property changes on: %s\n' % sbox.path('newfile'),
+ '__________________________________________________' +
+ '_________________\n',
+ 'Deleted: svn:mime-type\n',
+ '## -1 +0,0 ##\n',
+ '-text/plain\n',
+ '\ No newline at end of property\n']
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
'-r2:1', newfile)
+def diff_switched_file(sbox):
+ "diff a switched file against repository"
+
+ sbox.build()
+ svntest.actions.run_and_verify_svn(None, None, [], 'switch',
+ sbox.repo_url + '/A/mu',
+ sbox.ospath('iota'), '--ignore-ancestry')
+ sbox.simple_append('iota', 'Mu????')
+
+ # This diffs the file against its origin
+ expected_output = [
+ 'Index: %s\n' % sbox.path('iota'),
+ '===================================================================\n',
+ '--- %s\t(.../A/mu)\t(revision 1)\n' % sbox.path('iota'),
+ '+++ %s\t(.../iota)\t(working copy)\n' % sbox.path('iota'),
+ '@@ -1 +1,2 @@\n',
+ ' This is the file \'mu\'.\n',
+ '+Mu????\n',
+ '\ No newline at end of file\n',
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', '-r', '1', sbox.ospath('iota'))
+
+ # And this undoes the switch for the diff
+ expected_output = [
+ 'Index: %s\n' % sbox.path('iota'),
+ '===================================================================\n',
+ '--- %s\t(revision 1)\n' % sbox.path('iota'),
+ '+++ %s\t(working copy)\n' % sbox.path('iota'),
+ '@@ -1 +1,2 @@\n',
+ '-This is the file \'iota\'.\n',
+ '+This is the file \'mu\'.\n',
+ '+Mu????\n',
+ '\ No newline at end of file\n',
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', '-r', '1', sbox.ospath(''))
+
+
########################################################################
#Run the tests
@@ -4893,6 +4761,7 @@ test_list = [ None,
diff_repo_wc_copies,
diff_repo_wc_file_props,
diff_repo_repo_added_file_mime_type,
+ diff_switched_file,
]
if __name__ == '__main__':
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/export_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/export_tests.py Sun Mar 9 10:08:46 2014
@@ -964,6 +964,59 @@ def export_custom_keywords(sbox):
if open(export_file).read() != ''.join(alpha_content):
raise svntest.Failure("wrong keyword expansion")
+@Issue(4427)
+def export_file_external(sbox):
+ "export file external from WC and URL"
+ sbox.build()
+
+ wc_dir = sbox.wc_dir
+
+ # Set 'svn:externals' property in 'A/C' to 'A/B/E/alpha'(file external),
+ C_path = os.path.join(wc_dir, 'A', 'C')
+ externals_prop = "^/A/B/E/alpha exfile_alpha"
+
+ tmp_f = sbox.get_tempname('prop')
+ svntest.main.file_append(tmp_f, externals_prop)
+ svntest.main.run_svn(None, 'ps', '-F', tmp_f, 'svn:externals', C_path)
+ svntest.main.run_svn(None,'ci', '-m', 'log msg', '--quiet', C_path)
+
+ # Update the working copy to receive file external
+ svntest.main.run_svn(None, 'up', wc_dir)
+
+ # Update the expected disk tree to include the external.
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({
+ 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\n"),
+ })
+
+ # Export from URL
+ export_target = sbox.add_wc_path('export_url')
+ expected_output = svntest.main.greek_state.copy()
+ expected_output.add({
+ 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\r"),
+ })
+ expected_output.wc_dir = export_target
+ expected_output.desc[''] = Item()
+ expected_output.tweak(contents=None, status='A ')
+ svntest.actions.run_and_verify_export(sbox.repo_url,
+ export_target,
+ expected_output,
+ expected_disk)
+
+ # Export from WC
+ export_target = sbox.add_wc_path('export_wc')
+ expected_output = svntest.main.greek_state.copy()
+ expected_output.add({
+ 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\r"),
+ })
+ expected_output.wc_dir = export_target
+ expected_output.desc['A'] = Item()
+ expected_output.tweak(contents=None, status='A ')
+ svntest.actions.run_and_verify_export(wc_dir,
+ export_target,
+ expected_output,
+ expected_disk)
+
########################################################################
# Run the tests
@@ -998,6 +1051,7 @@ test_list = [ None,
export_to_current_dir,
export_file_overwrite_with_force,
export_custom_keywords,
+ export_file_external,
]
if __name__ == '__main__':
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests.py Sun Mar 9 10:08:46 2014
@@ -74,6 +74,15 @@ del_lines_res = [
re.compile(r" - with Cyrus SASL authentication"),
re.compile(r" - using serf \d+\.\d+\.\d+"),
re.compile(r"\* fs_(base|fs) :"),
+
+ # Remove 'svn --version' list of platform-specific
+ # auth cache providers.
+ re.compile(r"\* Wincrypt cache.*"),
+ re.compile(r"\* Plaintext cache.*"),
+ re.compile(r"\* Gnome Keyring"),
+ re.compile(r"\* GPG-Agent"),
+ re.compile(r"\* Mac OS X Keychain"),
+ re.compile(r"\* KWallet \(KDE\)"),
]
# This is a list of lines to search and replace text on.
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout Sun Mar 9 10:08:46 2014
@@ -10,6 +10,7 @@ command, it recurses on the current dire
Available subcommands:
add
+ auth
blame (praise, annotate, ann)
cat
changelist (cl)
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout Sun Mar 9 10:08:46 2014
@@ -1,5 +1,5 @@
-svn, version 1.8.0-dev (under development)
- compiled Sep 10 2012, 14:00:24 on i386-apple-darwin11.4.0
+svn, version 1.9.0-dev (under development)
+ compiled Feb 26 2014, 15:15:42 on x86_64-unknown-openbsd5.5
Copyright (C) 2012 The Apache Software Foundation.
This software consists of contributions made by many people;
@@ -14,9 +14,16 @@ The following repository access (RA) mod
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
+ - using serf 1.3.3
- handles 'http' scheme
- handles 'https' scheme
+The following authentication credential caches are available:
+
+* Plaintext cache in /home/stsp/.subversion
+* Gnome Keyring
+* GPG-Agent
+
System information:
* running on i386-apple-darwin11.4.0
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout Sun Mar 9 10:08:46 2014
@@ -1,18 +1,26 @@
-svn, version 0.16.0 (r3987)
- compiled Dec 5 2002, 00:02:51
+svn, version 1.9.0-dev (under development)
+ compiled Feb 26 2014, 15:15:42 on x86_64-unknown-openbsd5.5
-Copyright (C) 2010 The Apache Software Foundation.
+Copyright (C) 2014 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository access (RA) modules are available:
-* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- - handles 'http' scheme
- - handles 'https' scheme
-* ra_local : Module for accessing a repository on local disk.
- - handles 'file' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
+ - with Cyrus SASL authentication
- handles 'svn' scheme
+* ra_local : Module for accessing a repository on local disk.
+ - handles 'file' scheme
+* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
+ - using serf 1.3.3
+ - handles 'http' scheme
+ - handles 'https' scheme
+
+The following authentication credential caches are available:
+
+* Plaintext cache in /home/stsp/.subversion
+* Gnome Keyring
+* GPG-Agent
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout Sun Mar 9 10:08:46 2014
@@ -10,6 +10,7 @@ command, it recurses on the current dire
Available subcommands:
add
+ auth
blame (praise, annotate, ann)
cat
changelist (cl)
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py Sun Mar 9 10:08:46 2014
@@ -35,7 +35,7 @@ from svntest.main import server_has_merg
from svntest.main import server_has_auto_move
from svntest.main import SVN_PROP_MERGEINFO
from svntest.mergetrees import set_up_branch
-from diff_tests import make_diff_header, make_no_diff_deleted_header
+from svntest.verify import make_diff_header, make_no_diff_deleted_header
# (abbreviation)
Skip = svntest.testcase.Skip_deco
@@ -718,6 +718,13 @@ def compare_diff_output(expected_diffs,
if diffs.issubset(expected_diffs) and diffs.issuperset(expected_diffs):
return
+ print("=============== DIFFS NOT EQUAL ===================")
+ print("Expected")
+ for line in expected_diffs:
+ print(line)
+ print("Actual:")
+ for line in output:
+ print(line)
raise svntest.Failure("Diffs not equal")
@@ -2173,7 +2180,7 @@ def log_diff(sbox):
"\ No newline at end of file\n",
]
]
- r8diff = [ make_diff_header('A2/D/G/rho', 'revision 0', 'revision 8')
+ r8diff = [ make_diff_header('A2/D/G/rho', 'nonexistent', 'revision 8')
+ [ "@@ -0,0 +1 @@\n",
"+88\n",
"\ No newline at end of file\n",
@@ -2221,7 +2228,7 @@ def log_diff_moved(sbox):
mu_at_1 = sbox.repo_url + '/A/mu@1'
mu3_at_3 = sbox.repo_url + '/A/mu3@3'
- r1diff = [make_diff_header('mu', 'revision 0', 'revision 1')
+ r1diff = [make_diff_header('mu', 'nonexistent', 'revision 1')
+ ["@@ -0,0 +1 @@\n",
"+This is the file 'mu'.\n"]]
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_authz_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_authz_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_authz_tests.py Sun Mar 9 10:08:46 2014
@@ -737,6 +737,174 @@ def reintegrate_fails_if_no_root_access(
None, True, True,
'--reintegrate', A_path)
+def diff_unauth_parent(sbox):
+ "diff directory without reading parent"
+
+ sbox.build(create_wc=False)
+
+ # Create r2: Change A a bit
+ svntest.actions.run_and_verify_svnmucc(None, None, [],
+ 'propset', 'k', 'v',
+ sbox.repo_url + '/A',
+ '-m', 'set prop')
+
+ # Create r3 Mark E and G
+ svntest.actions.run_and_verify_svnmucc(None, None, [],
+ 'propset', 'this-is', 'E',
+ sbox.repo_url + '/A/B/E',
+ 'propset', 'this-is', 'G',
+ sbox.repo_url + '/A/D/G',
+ '-m', 'set prop')
+
+ # Create r4: Replace A/B/E with A/D/G
+ svntest.actions.run_and_verify_svnmucc(None, None, [],
+ 'rm', sbox.repo_url + '/A/B/E',
+ 'cp', '3', sbox.repo_url + '/A/D/G',
+ sbox.repo_url + '/A/B/E',
+ '-m', 'replace A/B/E')
+
+
+ if is_ra_type_svn() or is_ra_type_dav():
+ write_restrictive_svnserve_conf(sbox.repo_dir)
+ write_authz_file(sbox, {"/" : "* =",
+ "/A" : "* = rw"})
+
+ # Diff the property change
+ expected_output = [
+ 'Index: .\n',
+ '===================================================================\n',
+ '--- .\t(revision 1)\n',
+ '+++ .\t(revision 2)\n',
+ '\n',
+ 'Property changes on: .\n',
+ '___________________________________________________________________\n',
+ 'Added: k\n',
+ '## -0,0 +1 ##\n',
+ '+v\n',
+ '\ No newline at end of property\n'
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', sbox.repo_url + '/A', '-c', '2')
+
+ if is_ra_type_svn() or is_ra_type_dav():
+ write_authz_file(sbox, {"/" : "* =",
+ "/A/B/E" : "* = rw"})
+
+ # Diff the replacement
+ expected_output = [
+ 'Index: alpha\n',
+ '===================================================================\n',
+ '--- alpha\t(revision 3)\n',
+ '+++ alpha\t(nonexistent)\n',
+ '@@ -1 +0,0 @@\n',
+ '-This is the file \'alpha\'.\n',
+ 'Index: beta\n',
+ '===================================================================\n',
+ '--- beta\t(revision 3)\n',
+ '+++ beta\t(nonexistent)\n',
+ '@@ -1 +0,0 @@\n',
+ '-This is the file \'beta\'.\n',
+ 'Index: tau\n',
+ '===================================================================\n',
+ '--- tau\t(nonexistent)\n',
+ '+++ tau\t(revision 4)\n',
+ '@@ -0,0 +1 @@\n',
+ '+This is the file \'tau\'.\n',
+ 'Index: rho\n',
+ '===================================================================\n',
+ '--- rho\t(nonexistent)\n',
+ '+++ rho\t(revision 4)\n',
+ '@@ -0,0 +1 @@\n',
+ '+This is the file \'rho\'.\n',
+ 'Index: pi\n',
+ '===================================================================\n',
+ '--- pi\t(nonexistent)\n',
+ '+++ pi\t(revision 4)\n',
+ '@@ -0,0 +1 @@\n',
+ '+This is the file \'pi\'.\n',
+ ]
+
+ if is_ra_type_svn() or is_ra_type_dav():
+ # Because we can't anchor above C we see just a changed C, not a
+ # replacement
+ expected_output += [
+ 'Index: .\n',
+ '===================================================================\n',
+ '--- .\t(revision 3)\n',
+ '+++ .\t(revision 4)\n',
+ '\n',
+ 'Property changes on: .\n',
+ '___________________________________________________________________\n',
+ 'Modified: this-is\n',
+ '## -1 +1 ##\n',
+ '-E\n',
+ '\ No newline at end of property\n',
+ '+G\n',
+ '\ No newline at end of property\n',
+ ]
+ else:
+ # ### We should also see a property deletion here!
+ expected_output += [
+ 'Index: .\n',
+ '===================================================================\n',
+ '--- .\t(revision 3)\n',
+ '+++ .\t(nonexistent)\n',
+ '\n',
+ 'Property changes on: .\n',
+ '___________________________________________________________________\n',
+ 'Deleted: this-is\n',
+ '## -1 +0,0 ##\n',
+ '-E\n',
+ '\ No newline at end of property\n',
+ 'Index: .\n',
+ '===================================================================\n',
+ '--- .\t(nonexistent)\n',
+ '+++ .\t(revision 4)\n',
+ '\n',
+ 'Property changes on: .\n',
+ '___________________________________________________________________\n',
+ 'Added: this-is\n',
+ '## -0,0 +1 ##\n',
+ '+G\n',
+ '\ No newline at end of property\n',
+ ]
+
+ # Use two url diff, because 'svn diff url -c' uses copyfrom to diff against
+ expected_output = svntest.verify.UnorderedOutput(expected_output)
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', sbox.repo_url + '/A/B/E@3',
+ sbox.repo_url + '/A/B/E@4',
+ '--notice-ancestry')
+
+ # Do the same thing with summarize to really see directory deletes and adds
+ if is_ra_type_svn() or is_ra_type_dav():
+ # With no rights on the parent directory we just see a property change on E
+ expected_output = [
+ 'D %s/A/B/E/alpha\n' % sbox.repo_url,
+ 'D %s/A/B/E/beta\n' % sbox.repo_url,
+ 'A %s/A/B/E/tau\n' % sbox.repo_url,
+ 'A %s/A/B/E/rho\n' % sbox.repo_url,
+ 'A %s/A/B/E/pi\n' % sbox.repo_url,
+ ' M %s/A/B/E\n' % sbox.repo_url,
+ ]
+ else:
+ # But with rights on the parent we see a replacement of E
+ expected_output = [
+ 'D %s/A/B/E/alpha\n' % sbox.repo_url,
+ 'D %s/A/B/E/beta\n' % sbox.repo_url,
+ 'D %s/A/B/E\n' % sbox.repo_url,
+ 'A %s/A/B/E/tau\n' % sbox.repo_url,
+ 'A %s/A/B/E/rho\n' % sbox.repo_url,
+ 'A %s/A/B/E/pi\n' % sbox.repo_url,
+ 'A %s/A/B/E\n' % sbox.repo_url,
+ ]
+
+ expected_output = svntest.verify.UnorderedOutput(expected_output)
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', sbox.repo_url + '/A/B/E@3',
+ sbox.repo_url + '/A/B/E@4',
+ '--notice-ancestry', '--summarize')
+
########################################################################
# Run the tests
@@ -746,6 +914,7 @@ test_list = [ None,
mergeinfo_and_skipped_paths,
merge_fails_if_subtree_is_deleted_on_src,
reintegrate_fails_if_no_root_access,
+ diff_unauth_parent,
]
serial_only = True
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_reintegrate_tests.py Sun Mar 9 10:08:46 2014
@@ -1332,7 +1332,7 @@ def reintegrate_with_subtree_mergeinfo(s
#
# D) Synch merge the changes in C) from 'trunk' to 'branch' and commit in
# rev N+3. The renamed subtree on 'branch' now has additional explicit
- # mergeinfo decribing the synch merge from trunk@N+1 to trunk@N+2.
+ # mergeinfo describing the synch merge from trunk@N+1 to trunk@N+2.
#
# E) Reintegrate 'branch' to 'trunk'.
#
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_tests.py Sun Mar 9 10:08:46 2014
@@ -1327,7 +1327,7 @@ def merge_in_new_file_and_diff(sbox):
expected_output = [
"Index: " + url_branch_path + "/newfile\n",
"===================================================================\n",
- "--- "+ url_branch_path + "/newfile (revision 0)\n",
+ "--- "+ url_branch_path + "/newfile (nonexistent)\n",
"+++ "+ url_branch_path + "/newfile (working copy)\n",
"@@ -0,0 +1 @@\n",
"+newfile\n",
@@ -3223,7 +3223,7 @@ def merge_file_replace_to_mixed_rev_wc(s
# Normally we'd simply update the whole working copy, but since that would
# defeat the purpose of this test (see the comment below), instead we'll
# update only "." using --depth empty. This preserves the intent of the
- # orginal mixed-rev test for this issue, but allows the merge tracking
+ # original mixed-rev test for this issue, but allows the merge tracking
# logic to consider r3 as valid for reverse merging.
svntest.actions.run_and_verify_svn(None, None, [],
'up', '--depth', 'empty', wc_dir)
@@ -9563,7 +9563,7 @@ def new_subtrees_should_not_break_merge(
wc_status.tweak(wc_rev=9)
# Yet another test for issue #3067. Merge -rX:Y, where X>Y (reverse merge)
- # and the merge target has a subtree that came into existance at some rev
+ # and the merge target has a subtree that came into existence at some rev
# N where X < N < Y. This merge should simply delete the subtree.
#
# For this test merge -r9:2 to A_COPY. This should revert all the merges
@@ -11818,7 +11818,7 @@ def subtree_source_missing_in_requested_
psi_COPY_path : '/A/D/H/psi:3,8' })
# Now test a reverse merge where part of the requested range postdates
- # a subtree's existance. Merge -r12:1 to A_COPY. This should revert
+ # a subtree's existence. Merge -r12:1 to A_COPY. This should revert
# all of the merges done thus far. The fact that A/D/H/psi no longer
# exists after r7 shouldn't break the subtree merge into A_COPY/D/H/psi.
# A_COPY/D/H/psi should simply have r3 reverse merged. No paths under
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/prop_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/prop_tests.py Sun Mar 9 10:08:46 2014
@@ -2704,6 +2704,48 @@ def dir_prop_conflict_details(sbox):
svntest.actions.run_and_verify_info([expected_info], sbox.path('A'))
+def iprops_list_abspath(sbox):
+ "test listing iprops via abspath"
+
+ sbox.build()
+
+ sbox.simple_propset('im', 'root', '')
+ sbox.simple_commit()
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'switch', '^/A/D', sbox.ospath(''),
+ '--ignore-ancestry')
+
+ sbox.simple_propset('im', 'GammA', 'gamma')
+
+ expected_output = [
+ 'Inherited properties on \'%s\',\n' % sbox.ospath(''),
+ 'from \'%s\':\n' % sbox.repo_url,
+ ' im\n',
+ ' root\n',
+ 'Properties on \'%s\':\n' % sbox.ospath('gamma'),
+ ' im\n',
+ ' GammA\n'
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'pl', '-R',
+ '--show-inherited-props', '-v',
+ sbox.ospath(''))
+
+ expected_output = [
+ 'Inherited properties on \'%s\',\n' % os.path.abspath(sbox.ospath('')),
+ 'from \'%s\':\n' % sbox.repo_url,
+ ' im\n',
+ ' root\n',
+ 'Properties on \'%s\':\n' % os.path.abspath(sbox.ospath('gamma')),
+ ' im\n',
+ ' GammA\n'
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'pl', '-R',
+ '--show-inherited-props', '-v',
+ os.path.abspath(sbox.ospath('')))
+
########################################################################
# Run the tests
@@ -2751,6 +2793,7 @@ test_list = [ None,
peg_rev_base_working,
xml_unsafe_author,
dir_prop_conflict_details,
+ iprops_list_abspath,
]
if __name__ == '__main__':
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/revert_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/revert_tests.py Sun Mar 9 10:08:46 2014
@@ -1640,7 +1640,7 @@ def revert_obstructing_wc(sbox):
wc_dir, '--set-depth', 'infinity')
# Revert should do nothing (no local changes), and report the obstruction
- # (reporting the obstruction is nice for debuging, but not really required
+ # (reporting the obstruction is nice for debugging, but not really required
# in this specific case, as the node was not modified)
svntest.actions.run_and_verify_svn(None, "Skipped '.*A' -- .*obstruct.*", [],
'revert', '-R', wc_dir)
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/special_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/special_tests.py Sun Mar 9 10:08:46 2014
@@ -537,7 +537,7 @@ def diff_symlink_to_dir(sbox):
expected_output = [
"Index: link\n",
"===================================================================\n",
- "--- link\t(revision 0)\n",
+ "--- link\t(nonexistent)\n",
"+++ link\t(working copy)\n",
"@@ -0,0 +1 @@\n",
"+link A/D\n",
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py Sun Mar 9 10:08:46 2014
@@ -84,6 +84,14 @@ def check_hotcopy_fsfs_fsx(src, dst):
if src_file == 'rev-prop-atomics.mutex':
continue
+ # Ignore auto-created empty lock files as they may or may not
+ # be present and are neither required by nor do they harm to
+ # the destination repository.
+ if src_file == 'pack-lock':
+ continue
+ if src_file == 'write-lock':
+ continue
+
src_path = os.path.join(src_dirpath, src_file)
dst_path = os.path.join(dst_dirpath, src_file)
if not os.path.isfile(dst_path):
@@ -828,10 +836,14 @@ _0.0.t1-1 add false false /A/B/E/bravo
#----------------------------------------------------------------------
-@SkipUnless(svntest.main.is_fs_type_fsfs)
-def recover_fsfs(sbox):
- "recover a repository (FSFS only)"
- sbox.build()
+# Helper for two test functions.
+def corrupt_and_recover_db_current(sbox, minor_version=None):
+ """Build up a MINOR_VERSION sandbox and test different recovery scenarios
+ with missing, out-of-date or even corrupt db/current files. Recovery should
+ behave the same way with all values of MINOR_VERSION, hence this helper
+ containing the common code that allows us to check it."""
+
+ sbox.build(minor_version=minor_version)
current_path = os.path.join(sbox.repo_dir, 'db', 'current')
# Commit up to r3, so we can test various recovery scenarios.
@@ -906,6 +918,24 @@ def recover_fsfs(sbox):
"Contents of db/current is unexpected.",
'db/current', expected_current_contents, actual_current_contents)
+
+@SkipUnless(svntest.main.is_fs_type_fsfs)
+def fsfs_recover_db_current(sbox):
+ "fsfs recover db/current"
+ corrupt_and_recover_db_current(sbox)
+
+
+@SkipUnless(svntest.main.is_fs_type_fsfs)
+def fsfs_recover_old_db_current(sbox):
+ "fsfs recover db/current --compatible-version=1.3"
+
+ # Around trunk@1573728, 'svnadmin recover' wrongly errored out
+ # for the --compatible-version=1.3 repositories with missing or
+ # invalid db/current file:
+ # svnadmin: E160006: No such revision 1
+
+ corrupt_and_recover_db_current(sbox, minor_version=3)
+
#----------------------------------------------------------------------
@Issue(2983)
def load_with_parent_dir(sbox):
@@ -2273,6 +2303,27 @@ def load_ignore_dates(sbox):
" start_time: %s"
% (rev, str(rev_time), str(start_time)))
+
+@XFail()
+@SkipUnless(svntest.main.is_fs_type_fsfs)
+def fsfs_hotcopy_old_with_propchanges(sbox):
+ "hotcopy --compatible-version=1.3 with propchanges"
+
+ # Around trunk@1573728, running 'svnadmin hotcopy' for the
+ # --compatible-version=1.3 repository with property changes
+ # ended with mismatching db/current in source and destination:
+ # (source: "2 l 1", destination: "2 k 1").
+
+ sbox.build(create_wc=True, minor_version=3)
+ sbox.simple_propset('foo', 'bar', 'A/mu')
+ sbox.simple_commit()
+
+ backup_dir, backup_url = sbox.add_repo_path('backup')
+ svntest.actions.run_and_verify_svnadmin(None, None, [], "hotcopy",
+ sbox.repo_dir, backup_dir)
+
+ check_hotcopy_fsfs(sbox.repo_dir, backup_dir)
+
########################################################################
# Run the tests
@@ -2291,7 +2342,8 @@ test_list = [ None,
setrevprop,
verify_windows_paths_in_repos,
verify_incremental_fsfs,
- recover_fsfs,
+ fsfs_recover_db_current,
+ fsfs_recover_old_db_current,
load_with_parent_dir,
set_uuid,
reflect_dropped_renumbered_revs,
@@ -2315,6 +2367,7 @@ test_list = [ None,
fsfs_recover_old_non_empty,
fsfs_hotcopy_old_non_empty,
load_ignore_dates,
+ fsfs_hotcopy_old_with_propchanges,
]
if __name__ == '__main__':
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnauthz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnauthz_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnauthz_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnauthz_tests.py Sun Mar 9 10:08:46 2014
@@ -101,11 +101,11 @@ def svnauthz_validate_file_test(sbox):
svntest.actions.run_and_verify_svnauthz("Invalid authz file", None, None,
1, False, "validate", authz_path)
- # Non-existant authz file
+ # Non-existent authz file
# exit code 2, operational error since we can't test the file.
os.close(authz_fd)
os.remove(authz_path)
- svntest.actions.run_and_verify_svnauthz("Non-existant authz file", None,
+ svntest.actions.run_and_verify_svnauthz("Non-existent authz file", None,
None, 2, False, "validate",
authz_path)
@@ -143,9 +143,9 @@ def svnauthz_validate_repo_test(sbox):
svntest.actions.run_and_verify_svnauthz("Invalid authz url", None, None,
1, False, "validate", iota_url)
- # Non-existant authz url
+ # Non-existent authz url
# exit code 2, operational error since we can't test the file.
- svntest.actions.run_and_verify_svnauthz("Non-existant authz file", None,
+ svntest.actions.run_and_verify_svnauthz("Non-existent authz file", None,
None, 2, False, "validate",
repo_url + "/zilch")
@@ -854,7 +854,7 @@ def svnauthz_accessof_txn_test(sbox):
expected_data = svntest.verify.ExpectedOutput('Exit 3\n', match_all=False)
verify_logfile(logfilepath, expected_data)
- # break the authz file with a non-existant group and check for an exit 1.
+ # break the authz file with a non-existent group and check for an exit 1.
expected_status.tweak('A/authz', status=' ', wc_rev=4)
svntest.main.file_append(authz_path, "@friends = rw\n")
if svntest.actions.run_and_verify_commit(wc_dir, expected_output,
@@ -863,7 +863,7 @@ def svnauthz_accessof_txn_test(sbox):
expected_data = svntest.verify.ExpectedOutput('Exit 1\n', match_all=False)
verify_logfile(logfilepath, expected_data)
- # break the authz file with a non-existant gropu and check for an exit 2.
+ # break the authz file with a non-existent gropu and check for an exit 2.
expected_output = wc.State(wc_dir, {'A/authz' : Item(verb='Deleting')})
expected_status.remove('A/authz')
svntest.main.run_svn(None, 'rm', authz_path)
@@ -897,9 +897,9 @@ def svnauthz_compat_mode_file_test(sbox)
os.close(authz_fd)
os.remove(authz_path)
- # Check a non-existant file.
+ # Check a non-existent file.
svntest.actions.run_and_verify_svnauthz(
- "svnauthz-validate on non-existant file", None, None, 2, True,
+ "svnauthz-validate on non-existent file", None, None, 2, True,
authz_path
)
@@ -943,10 +943,10 @@ def svnauthz_compat_mode_repo_test(sbox)
None, None, 1, True,
authz_path)
- # Check a non-existant url.
+ # Check a non-existent url.
# Exit code really should be 2 since this is an operational error.
svntest.actions.run_and_verify_svnauthz(
- "svnauthz-validate on non-existant file", None, None, 2, True,
+ "svnauthz-validate on non-existent file", None, None, 2, True,
repo_url + "/zilch"
)
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/factory.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/factory.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/factory.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/factory.py Sun Mar 9 10:08:46 2014
@@ -308,7 +308,7 @@ class TestFactory:
# An optimized list kept up-to-date by variable additions
self.sorted_vars_by_pathlen = []
- # Wether we ever used the variables 'wc_dir' and 'url' (tiny tweak)
+ # Whether we ever used the variables 'wc_dir' and 'url' (tiny tweak)
self.used_wc_dir = False
self.used_abs_wc_dir = False
self.used_url = False
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py Sun Mar 9 10:08:46 2014
@@ -890,7 +890,7 @@ def create_repos(path, minor_version = N
exist, create it."""
if not os.path.exists(path):
- os.makedirs(path) # this creates all the intermediate dirs, if neccessary
+ os.makedirs(path) # this creates all the intermediate dirs, if necessary
opts = ("--bdb-txn-nosync",)
if minor_version is None or minor_version > options.server_minor_version:
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/sandbox.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/sandbox.py Sun Mar 9 10:08:46 2014
@@ -186,7 +186,11 @@ class Sandbox:
of this sbox, or relative to OS-style path WC_DIR if supplied."""
if wc_dir is None:
wc_dir = self.wc_dir
- return os.path.join(wc_dir, svntest.wc.to_ospath(relpath))
+
+ if relpath == '':
+ return wc_dir
+ else:
+ return os.path.join(wc_dir, svntest.wc.to_ospath(relpath))
def ospaths(self, relpaths, wc_dir=None):
"""Return a list of RELPATHS but with each path converted to an OS-style
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/verify.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/verify.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/verify.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/verify.py Sun Mar 9 10:08:46 2014
@@ -650,3 +650,184 @@ def compare_dump_files(message, label, e
raise svntest.Failure('\n' + '\n'.join(ndiff(
pprint.pformat(parsed_expected).splitlines(),
pprint.pformat(parsed_actual).splitlines())))
+
+##########################################################################################
+## diff verifications
+def is_absolute_url(target):
+ return (target.startswith('file://')
+ or target.startswith('http://')
+ or target.startswith('https://')
+ or target.startswith('svn://')
+ or target.startswith('svn+ssh://'))
+
+def make_diff_header(path, old_tag, new_tag, src_label=None, dst_label=None):
+ """Generate the expected diff header for file PATH, with its old and new
+ versions described in parentheses by OLD_TAG and NEW_TAG. SRC_LABEL and
+ DST_LABEL are paths or urls that are added to the diff labels if we're
+ diffing against the repository or diffing two arbitrary paths.
+ Return the header as an array of newline-terminated strings."""
+ if src_label:
+ src_label = src_label.replace('\\', '/')
+ if not is_absolute_url(src_label):
+ src_label = '.../' + src_label
+ src_label = '\t(' + src_label + ')'
+ else:
+ src_label = ''
+ if dst_label:
+ dst_label = dst_label.replace('\\', '/')
+ if not is_absolute_url(dst_label):
+ dst_label = '.../' + dst_label
+ dst_label = '\t(' + dst_label + ')'
+ else:
+ dst_label = ''
+ path_as_shown = path.replace('\\', '/')
+ return [
+ "Index: " + path_as_shown + "\n",
+ "===================================================================\n",
+ "--- " + path_as_shown + src_label + "\t(" + old_tag + ")\n",
+ "+++ " + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
+ ]
+
+def make_no_diff_deleted_header(path, old_tag, new_tag):
+ """Generate the expected diff header for a deleted file PATH when in
+ 'no-diff-deleted' mode. (In that mode, no further details appear after the
+ header.) Return the header as an array of newline-terminated strings."""
+ path_as_shown = path.replace('\\', '/')
+ return [
+ "Index: " + path_as_shown + " (deleted)\n",
+ "===================================================================\n",
+ ]
+
+def make_git_diff_header(target_path, repos_relpath,
+ old_tag, new_tag, add=False, src_label=None,
+ dst_label=None, delete=False, text_changes=True,
+ cp=False, mv=False, copyfrom_path=None,
+ copyfrom_rev=None):
+ """ Generate the expected 'git diff' header for file TARGET_PATH.
+ REPOS_RELPATH is the location of the path relative to the repository root.
+ The old and new versions ("revision X", or "working copy") must be
+ specified in OLD_TAG and NEW_TAG.
+ SRC_LABEL and DST_LABEL are paths or urls that are added to the diff
+ labels if we're diffing against the repository. ADD, DELETE, CP and MV
+ denotes the operations performed on the file. COPYFROM_PATH is the source
+ of a copy or move. Return the header as an array of newline-terminated
+ strings."""
+
+ path_as_shown = target_path.replace('\\', '/')
+ if src_label:
+ src_label = src_label.replace('\\', '/')
+ src_label = '\t(.../' + src_label + ')'
+ else:
+ src_label = ''
+ if dst_label:
+ dst_label = dst_label.replace('\\', '/')
+ dst_label = '\t(.../' + dst_label + ')'
+ else:
+ dst_label = ''
+
+ output = [
+ "Index: " + path_as_shown + "\n",
+ "===================================================================\n"
+ ]
+ if add:
+ output.extend([
+ "diff --git a/" + repos_relpath + " b/" + repos_relpath + "\n",
+ "new file mode 10644\n",
+ ])
+ if text_changes:
+ output.extend([
+ "--- /dev/null\t(" + old_tag + ")\n",
+ "+++ b/" + repos_relpath + dst_label + "\t(" + new_tag + ")\n"
+ ])
+ elif delete:
+ output.extend([
+ "diff --git a/" + repos_relpath + " b/" + repos_relpath + "\n",
+ "deleted file mode 10644\n",
+ ])
+ if text_changes:
+ output.extend([
+ "--- a/" + repos_relpath + src_label + "\t(" + old_tag + ")\n",
+ "+++ /dev/null\t(" + new_tag + ")\n"
+ ])
+ elif cp:
+ if copyfrom_rev:
+ copyfrom_rev = '@' + copyfrom_rev
+ else:
+ copyfrom_rev = ''
+ output.extend([
+ "diff --git a/" + copyfrom_path + " b/" + repos_relpath + "\n",
+ "copy from " + copyfrom_path + copyfrom_rev + "\n",
+ "copy to " + repos_relpath + "\n",
+ ])
+ if text_changes:
+ output.extend([
+ "--- a/" + copyfrom_path + src_label + "\t(" + old_tag + ")\n",
+ "+++ b/" + repos_relpath + "\t(" + new_tag + ")\n"
+ ])
+ elif mv:
+ output.extend([
+ "diff --git a/" + copyfrom_path + " b/" + path_as_shown + "\n",
+ "rename from " + copyfrom_path + "\n",
+ "rename to " + repos_relpath + "\n",
+ ])
+ if text_changes:
+ output.extend([
+ "--- a/" + copyfrom_path + src_label + "\t(" + old_tag + ")\n",
+ "+++ b/" + repos_relpath + "\t(" + new_tag + ")\n"
+ ])
+ else:
+ output.extend([
+ "diff --git a/" + repos_relpath + " b/" + repos_relpath + "\n",
+ "--- a/" + repos_relpath + src_label + "\t(" + old_tag + ")\n",
+ "+++ b/" + repos_relpath + dst_label + "\t(" + new_tag + ")\n",
+ ])
+ return output
+
+def make_diff_prop_header(path):
+ """Return a property diff sub-header, as a list of newline-terminated
+ strings."""
+ return [
+ "\n",
+ "Property changes on: " + path.replace('\\', '/') + "\n",
+ "___________________________________________________________________\n"
+ ]
+
+def make_diff_prop_val(plus_minus, pval):
+ "Return diff for prop value PVAL, with leading PLUS_MINUS (+ or -)."
+ if len(pval) > 0 and pval[-1] != '\n':
+ return [plus_minus + pval + "\n","\\ No newline at end of property\n"]
+ return [plus_minus + pval]
+
+def make_diff_prop_deleted(pname, pval):
+ """Return a property diff for deletion of property PNAME, old value PVAL.
+ PVAL is a single string with no embedded newlines. Return the result
+ as a list of newline-terminated strings."""
+ return [
+ "Deleted: " + pname + "\n",
+ "## -1 +0,0 ##\n"
+ ] + make_diff_prop_val("-", pval)
+
+def make_diff_prop_added(pname, pval):
+ """Return a property diff for addition of property PNAME, new value PVAL.
+ PVAL is a single string with no embedded newlines. Return the result
+ as a list of newline-terminated strings."""
+ return [
+ "Added: " + pname + "\n",
+ "## -0,0 +1 ##\n",
+ ] + make_diff_prop_val("+", pval)
+
+def make_diff_prop_modified(pname, pval1, pval2):
+ """Return a property diff for modification of property PNAME, old value
+ PVAL1, new value PVAL2.
+
+ PVAL is a single string with no embedded newlines. A newline at the
+ end is significant: without it, we add an extra line saying '\ No
+ newline at end of property'.
+
+ Return the result as a list of newline-terminated strings.
+ """
+ return [
+ "Modified: " + pname + "\n",
+ "## -1 +1 ##\n",
+ ] + make_diff_prop_val("-", pval1) + make_diff_prop_val("+", pval2)
+
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/tree_conflict_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/tree_conflict_tests.py Sun Mar 9 10:08:46 2014
@@ -1238,7 +1238,7 @@ def actual_only_node_behaviour(sbox):
# diff (di)
expected_stdout = None
- expected_stderr = ".*foo.*is not under version control.*"
+ expected_stderr = ".*E155.*foo.*was not found.*"
run_and_verify_svn(None, expected_stdout, expected_stderr,
"diff", foo_path)
# export
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/upgrade_tests.py?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/upgrade_tests.py Sun Mar 9 10:08:46 2014
@@ -1427,6 +1427,17 @@ def changelist_upgrade_1_6(sbox):
if paths != expected_paths:
raise svntest.Failure("changelist not matched")
+
+def upgrade_1_7_dir_external(sbox):
+ "upgrade from 1.7 with dir external"
+
+ sbox.build(create_wc = False)
+ replace_sbox_with_tarfile(sbox, 'upgrade_1_7_dir_external.tar.bz2')
+
+ # This fails for 'make check EXCLUSIVE_WC_LOCKS=1' giving an error:
+ # svn: warning: W200033: sqlite[S5]: database is locked
+ svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
+
########################################################################
# Run the tests
@@ -1482,6 +1493,7 @@ test_list = [ None,
iprops_upgrade,
iprops_upgrade1_6,
changelist_upgrade_1_6,
+ upgrade_1_7_dir_external,
]
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_client/client-test.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_client/client-test.c Sun Mar 9 10:08:46 2014
@@ -829,9 +829,9 @@ test_suggest_mergesources(const svn_test
/* ========================================================================== */
-int svn_test_max_threads = 3;
+static int max_threads = 3;
-struct svn_test_descriptor_t test_funcs[] =
+static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
SVN_TEST_PASS2(test_elide_mergeinfo_catalog,
@@ -850,3 +850,5 @@ struct svn_test_descriptor_t test_funcs[
"test svn_client_suggest_merge_sources"),
SVN_TEST_NULL
};
+
+SVN_TEST_MAIN
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_client/mtcc-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_client/mtcc-test.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_client/mtcc-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_client/mtcc-test.c Sun Mar 9 10:08:46 2014
@@ -71,7 +71,7 @@ verify_mtcc_commit(svn_client_mtcc_t *mt
SVN_TEST_ASSERT(vcb.commit_info->revision == expected_rev);
return SVN_NO_ERROR;
-};
+}
/* Constructs a greek tree as revision 1 in the repository at repos_url */
@@ -487,9 +487,9 @@ test_replace_tree(const svn_test_opts_t
/* ========================================================================== */
-int svn_test_max_threads = 3;
+static int max_threads = 3;
-struct svn_test_descriptor_t test_funcs[] =
+static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
SVN_TEST_OPTS_PASS(test_mkdir,
@@ -510,4 +510,5 @@ struct svn_test_descriptor_t test_funcs[
"test mtcc replace tree"),
SVN_TEST_NULL
};
-
+
+SVN_TEST_MAIN
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_delta/random-test.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_delta/random-test.c Sun Mar 9 10:08:46 2014
@@ -280,9 +280,10 @@ copy_tempfile(apr_file_t *fp, apr_pool_t
-/* Implements svn_test_driver_t. */
+/* (Note: *LAST_SEED is an output parameter.) */
static svn_error_t *
-random_test(apr_pool_t *pool)
+do_random_test(apr_pool_t *pool,
+ apr_uint32_t *last_seed)
{
apr_uint32_t seed, maxlen;
apr_size_t bytes_range;
@@ -297,7 +298,7 @@ random_test(apr_pool_t *pool)
for (i = 0; i < iterations; i++)
{
/* Generate source and target for the delta and its application. */
- apr_uint32_t subseed_base = svn_test_rand(&seed);
+ apr_uint32_t subseed_base = svn_test_rand((*last_seed = seed, &seed));
apr_file_t *source = generate_random_file(maxlen, subseed_base, &seed,
random_bytes, bytes_range,
dump_files, pool);
@@ -357,6 +358,17 @@ random_test(apr_pool_t *pool)
return SVN_NO_ERROR;
}
+/* Implements svn_test_driver_t. */
+static svn_error_t *
+random_test(apr_pool_t *pool)
+{
+ apr_uint32_t seed;
+ svn_error_t *err = do_random_test(pool, &seed);
+ if (err)
+ fprintf(stderr, "SEED: %lu\n", (unsigned long)seed);
+ return err;
+}
+
/* (Note: *LAST_SEED is an output parameter.) */
@@ -512,9 +524,9 @@ random_combine_test(apr_pool_t *pool)
/* The test table. */
-int svn_test_max_threads = 1;
+static int max_threads = 1;
-struct svn_test_descriptor_t test_funcs[] =
+static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
SVN_TEST_PASS2(random_test,
@@ -527,3 +539,5 @@ struct svn_test_descriptor_t test_funcs[
#endif
SVN_TEST_NULL
};
+
+SVN_TEST_MAIN
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_delta/window-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_delta/window-test.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_delta/window-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_delta/window-test.c Sun Mar 9 10:08:46 2014
@@ -100,12 +100,14 @@ stream_window_test(apr_pool_t *pool)
/* The test table. */
-int svn_test_max_threads = 1;
+static int max_threads = 1;
-struct svn_test_descriptor_t test_funcs[] =
+static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
SVN_TEST_PASS2(stream_window_test,
"txdelta stream and windows test"),
SVN_TEST_NULL
};
+
+SVN_TEST_MAIN
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_diff/diff-diff3-test.c Sun Mar 9 10:08:46 2014
@@ -2951,9 +2951,9 @@ two_way_issue_3362_v2(apr_pool_t *pool)
/* ========================================================================== */
-int svn_test_max_threads = 4;
+static int max_threads = 4;
-struct svn_test_descriptor_t test_funcs[] =
+static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
SVN_TEST_PASS2(dump_core,
@@ -2992,3 +2992,5 @@ struct svn_test_descriptor_t test_funcs[
"2-way issue #3362 test v2"),
SVN_TEST_NULL
};
+
+SVN_TEST_MAIN
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_diff/parse-diff-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_diff/parse-diff-test.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_diff/parse-diff-test.c Sun Mar 9 10:08:46 2014
@@ -962,9 +962,9 @@ test_parse_unidiff_lacking_trailing_eol(
/* ========================================================================== */
-int svn_test_max_threads = 1;
+static int max_threads = 1;
-struct svn_test_descriptor_t test_funcs[] =
+static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
SVN_TEST_PASS2(test_parse_unidiff,
@@ -987,3 +987,5 @@ struct svn_test_descriptor_t test_funcs[
"test parsing unidiffs lacking trailing eol"),
SVN_TEST_NULL
};
+
+SVN_TEST_MAIN
Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c Sun Mar 9 10:08:46 2014
@@ -5313,9 +5313,9 @@ dir_prop_merge(const svn_test_opts_t *op
/* The test table. */
-int svn_test_max_threads = 8;
+static int max_threads = 8;
-struct svn_test_descriptor_t test_funcs[] =
+static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
SVN_TEST_OPTS_PASS(trivial_transaction,
@@ -5405,3 +5405,5 @@ struct svn_test_descriptor_t test_funcs[
"test merge directory properties"),
SVN_TEST_NULL
};
+
+SVN_TEST_MAIN