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 2010/09/15 21:32:38 UTC
svn commit: r997472 [35/41] - in /subversion/branches/py-tests-as-modules:
./ build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/server-side/ notes/ notes/tree-conflicts/ notes/wc-ng/
subversion/bindings/javahl/native/ subversi...
Modified: subversion/branches/py-tests-as-modules/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/cmdline/diff_tests.py?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/cmdline/diff_tests.py Wed Sep 15 19:32:26 2010
@@ -52,71 +52,91 @@ def make_diff_header(path, old_tag, new_
"+++ " + path_as_shown + "\t(" + new_tag + ")\n",
]
-def make_git_diff_header(path, old_tag, new_tag, add=False, src_label=None,
- dst_label=None, delete=False, cp=False, mv=False,
- copyfrom=None):
- """ Generate the expected 'git diff' header for file PATH, with its old
- and new versions described in parentheses by OLD_TAG and NEW_TAG.
+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):
+ """ 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 is the source of a
- copy or move. Return the header as an array of newline-terminated
+ 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 = path.replace('\\', '/')
- if copyfrom:
- copyfrom_as_shown = copyfrom.replace('\\', '/')
+ 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 = ''
if add:
- return [
+ output = [
"Index: " + path_as_shown + "\n",
"===================================================================\n",
- "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
+ "diff --git a/" + repos_relpath + " b/" + repos_relpath + "\n",
"new file mode 10644\n",
- "--- /dev/null\t(" + old_tag + ")\n",
- "+++ b/" + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
]
+ if text_changes:
+ output.extend([
+ "--- /dev/null\t(" + old_tag + ")\n",
+ "+++ b/" + repos_relpath + dst_label + "\t(" + new_tag + ")\n"
+ ])
elif delete:
- return [
+ output = [
"Index: " + path_as_shown + "\n",
"===================================================================\n",
- "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
+ "diff --git a/" + repos_relpath + " b/" + repos_relpath + "\n",
"deleted file mode 10644\n",
- "--- a/" + path_as_shown + src_label + "\t(" + old_tag + ")\n",
- "+++ /dev/null\t(" + new_tag + ")\n",
]
+ if text_changes:
+ output.extend([
+ "--- a/" + repos_relpath + src_label + "\t(" + old_tag + ")\n",
+ "+++ /dev/null\t(" + new_tag + ")\n"
+ ])
elif cp:
- return [
+ output = [
"Index: " + path_as_shown + "\n",
"===================================================================\n",
- "diff --git a/" + copyfrom_as_shown + " b/" + path_as_shown + "\n",
- "copy from " + copyfrom_as_shown + "\n",
- "copy to " + path_as_shown + "\n",
+ "diff --git a/" + copyfrom_path + " b/" + repos_relpath + "\n",
+ "copy from " + copyfrom_path + "\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:
return [
"Index: " + path_as_shown + "\n",
"===================================================================\n",
- "diff --git a/" + copyfrom_as_shown + " b/" + path_as_shown + "\n",
- "rename from " + copyfrom_as_shown + "\n",
- "rename to " + path_as_shown + "\n",
+ "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:
- return [
+ output = [
"Index: " + path_as_shown + "\n",
"===================================================================\n",
- "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
- "--- a/" + path_as_shown + src_label + "\t(" + old_tag + ")\n",
- "+++ b/" + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
+ "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
######################################################################
@@ -546,8 +566,7 @@ def diff_multiple_reverse(sbox):
repo_diff(wc_dir, 4, 1, check_add_a_file_in_a_subdir)
repo_diff(wc_dir, 4, 1, check_add_a_file)
repo_diff(wc_dir, 1, 4, check_update_a_file)
-### TODO: directory delete doesn't work yet
-# repo_diff(wc_dir, 1, 4, check_add_a_file_in_a_subdir_reverse)
+ repo_diff(wc_dir, 1, 4, check_add_a_file_in_a_subdir_reverse)
repo_diff(wc_dir, 1, 4, check_add_a_file_reverse)
# test 6
@@ -711,6 +730,10 @@ def diff_only_property_change(sbox):
wc_dir = sbox.wc_dir
expected_output = [
+ "Index: iota\n",
+ "===================================================================\n",
+ "--- iota\t(revision 1)\n",
+ "+++ iota\t(revision 2)\n",
"\n",
"Property changes on: iota\n",
"___________________________________________________________________\n",
@@ -719,11 +742,16 @@ def diff_only_property_change(sbox):
"+native\n" ]
expected_reverse_output = list(expected_output)
- expected_reverse_output[3] = expected_reverse_output[3].replace("Added",
+ expected_reverse_output[2] = expected_reverse_output[2].replace("1", "2")
+ expected_reverse_output[3] = expected_reverse_output[3].replace("2", "1")
+ expected_reverse_output[7] = expected_reverse_output[7].replace("Added",
"Deleted")
- expected_reverse_output[4] = "## -1 +0,0 ##\n"
- expected_reverse_output[5] = "-native\n"
+ expected_reverse_output[8] = "## -1 +0,0 ##\n"
+ expected_reverse_output[9] = "-native\n"
+ expected_rev1_output = list(expected_output)
+ expected_rev1_output[3] = expected_rev1_output[3].replace("revision 2",
+ "working copy")
os.chdir(sbox.wc_dir)
svntest.actions.run_and_verify_svn(None, None, [],
@@ -745,10 +773,10 @@ def diff_only_property_change(sbox):
svntest.actions.run_and_verify_svn(None, expected_reverse_output, [],
'diff', '-c', '-2')
- svntest.actions.run_and_verify_svn(None, expected_output, [],
+ svntest.actions.run_and_verify_svn(None, expected_rev1_output, [],
'diff', '-r', '1')
- svntest.actions.run_and_verify_svn(None, expected_output, [],
+ svntest.actions.run_and_verify_svn(None, expected_rev1_output, [],
'diff', '-r', 'PREV', 'iota')
@@ -1893,6 +1921,7 @@ def diff_renamed_dir(sbox):
'A') :
raise svntest.Failure
+ # Commit
svntest.actions.run_and_verify_svn(None, None, [],
'ci', '-m', 'log msg')
@@ -1921,20 +1950,62 @@ def diff_renamed_dir(sbox):
'A') :
raise svntest.Failure
- # Test the diff while within the moved directory
- os.chdir(os.path.join('A','D','I'))
+ # repos->repos with explicit URL arg
+ exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
+ '-r', '1:2',
+ '^/A')
+ if check_diff_output(diff_output,
+ os.path.join('D', 'G', 'pi'),
+ 'D') :
+ raise svntest.Failure
+ if check_diff_output(diff_output,
+ os.path.join('D', 'I', 'pi'),
+ 'A') :
+ raise svntest.Failure
+
+ # Go to the parent of the moved directory
+ os.chdir(os.path.join('A','D'))
+ # repos->wc diff in the parent
exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
'-r', '1')
- if check_diff_output(diff_output, 'pi', 'A') :
+ if check_diff_output(diff_output,
+ os.path.join('G', 'pi'),
+ 'D') :
+ raise svntest.Failure
+ if check_diff_output(diff_output,
+ os.path.join('I', 'pi'),
+ 'A') :
raise svntest.Failure
- # Test a repos->repos diff while within the moved directory
+ # repos->repos diff in the parent
exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
'-r', '1:2')
- if check_diff_output(diff_output, 'pi', 'A') :
+ if check_diff_output(diff_output,
+ os.path.join('G', 'pi'),
+ 'D') :
+ raise svntest.Failure
+ if check_diff_output(diff_output,
+ os.path.join('I', 'pi'),
+ 'A') :
+ raise svntest.Failure
+
+ # Go to the move target directory
+ os.chdir('I')
+
+ # repos->wc diff while within the moved directory (should be empty)
+ exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
+ '-r', '1')
+ if diff_output:
+ raise svntest.Failure
+
+ # repos->repos diff while within the moved directory (should be empty)
+ exit_code, diff_output, err_output = svntest.main.run_svn(None, 'diff',
+ '-r', '1:2')
+
+ if diff_output:
raise svntest.Failure
@@ -1945,7 +2016,8 @@ def diff_property_changes_to_base(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- expected_output_r1_r2 = [
+
+ add_diff = [
"\n",
"Property changes on: A\n",
"___________________________________________________________________\n",
@@ -1959,17 +2031,46 @@ def diff_property_changes_to_base(sbox):
"## -0,0 +1 ##\n",
"+r2value\n"]
-
- expected_output_r2_r1 = list(expected_output_r1_r2)
- expected_output_r2_r1[3] = expected_output_r2_r1[3].replace("Added",
- "Deleted")
- expected_output_r2_r1[4] = "## -1 +0,0 ##\n"
- expected_output_r2_r1[5] = "-r2value\n"
- expected_output_r2_r1[9] = expected_output_r2_r1[9].replace("Added",
- "Deleted")
- expected_output_r2_r1[10] = "## -1 +0,0 ##\n"
- expected_output_r2_r1[11] = "-r2value\n"
-
+ del_diff = [
+ "\n",
+ "Property changes on: A\n",
+ "___________________________________________________________________\n",
+ "Deleted: dirprop\n",
+ "## -1 +0,0 ##\n",
+ "-r2value\n",
+ "\n",
+ "Property changes on: iota\n",
+ "___________________________________________________________________\n",
+ "Deleted: fileprop\n",
+ "## -1 +0,0 ##\n",
+ "-r2value\n"]
+
+
+ expected_output_r1_r2 = list(make_diff_header('A', 'revision 1', 'revision 2')
+ + add_diff[:6]
+ + make_diff_header('iota', 'revision 1',
+ 'revision 2')
+ + add_diff[7:])
+
+ expected_output_r2_r1 = list(make_diff_header('A', 'revision 2',
+ 'revision 1')
+ + del_diff[:6]
+ + make_diff_header('iota', 'revision 2',
+ 'revision 1')
+ + del_diff[7:])
+
+ expected_output_r1 = list(make_diff_header('A', 'revision 1',
+ 'working copy')
+ + add_diff[:6]
+ + make_diff_header('iota', 'revision 1',
+ 'working copy')
+ + add_diff[7:])
+ expected_output_base_r1 = list(make_diff_header('A', 'working copy',
+ 'revision 1')
+ + del_diff[:6]
+ + make_diff_header('iota', 'working copy',
+ 'revision 1')
+ + del_diff[7:])
os.chdir(sbox.wc_dir)
@@ -1996,14 +2097,14 @@ def diff_property_changes_to_base(sbox):
# Now check repos->WORKING, repos->BASE, and BASE->repos.
# (BASE is r1, and WORKING has no local mods, so this should produce
# the same output as above).
- expected = svntest.verify.UnorderedOutput(expected_output_r1_r2)
+ expected = svntest.verify.UnorderedOutput(expected_output_r1)
svntest.actions.run_and_verify_svn(None, expected, [],
'diff', '-r', '1')
svntest.actions.run_and_verify_svn(None, expected, [],
'diff', '-r', '1:BASE')
- expected = svntest.verify.UnorderedOutput(expected_output_r2_r1)
+ expected = svntest.verify.UnorderedOutput(expected_output_base_r1)
svntest.actions.run_and_verify_svn(None, expected, [],
'diff', '-r', 'BASE:1')
@@ -2021,12 +2122,12 @@ def diff_property_changes_to_base(sbox):
'fileprop', 'workingvalue', 'A/mu')
# Check that the earlier diffs against BASE are unaffected by the
- # presence of local mods.
- expected = svntest.verify.UnorderedOutput(expected_output_r1_r2)
+ # presence of local mods (with the exception of diff header changes).
+ expected = svntest.verify.UnorderedOutput(expected_output_r1)
svntest.actions.run_and_verify_svn(None, expected, [],
'diff', '-r', '1:BASE')
- expected = svntest.verify.UnorderedOutput(expected_output_r2_r1)
+ expected = svntest.verify.UnorderedOutput(expected_output_base_r1)
svntest.actions.run_and_verify_svn(None, expected, [],
'diff', '-r', 'BASE:1')
@@ -2179,6 +2280,10 @@ def diff_prop_change_local_propmod(sbox)
sbox.build()
expected_output_r2_wc = [
+ "Index: A\n",
+ "===================================================================\n",
+ "--- A\t(revision 2)\n",
+ "+++ A\t(working copy)\n",
"\n",
"Property changes on: A\n",
"___________________________________________________________________\n",
@@ -2189,6 +2294,10 @@ def diff_prop_change_local_propmod(sbox)
"Added: newdirprop\n",
"## -0,0 +1 ##\n",
"+newworkingvalue\n",
+ "Index: iota\n",
+ "===================================================================\n",
+ "--- iota\t(revision 2)\n",
+ "+++ iota\t(working copy)\n",
"\n",
"Property changes on: iota\n",
"___________________________________________________________________\n",
@@ -2280,15 +2389,19 @@ def diff_repos_wc_add_with_props(sbox):
"@@ -0,0 +1 @@\n",
"+content\n",
"\n",
- "Property changes on: " + os.path.join('X', 'bar') + "\n",
+ "Property changes on: X/bar\n",
"___________________________________________________________________\n",
"Added: propname\n",
"## -0,0 +1 ##\n",
"+propvalue\n",
]
+ diff_X_r1_base = make_diff_header("X", "revision 1",
+ "working copy") + diff_X
+ diff_X_base_r3 = make_diff_header("X", "working copy",
+ "revision 3") + diff_X
diff_foo_r1_base = make_diff_header("foo", "revision 0",
- "revision 3") + diff_foo
+ "revision 3") + diff_foo
diff_foo_base_r3 = make_diff_header("foo", "revision 0",
"revision 3") + diff_foo
diff_X_bar_r1_base = make_diff_header("X/bar", "revision 0",
@@ -2296,8 +2409,8 @@ def diff_repos_wc_add_with_props(sbox):
diff_X_bar_base_r3 = make_diff_header("X/bar", "revision 0",
"revision 3") + diff_X_bar
- expected_output_r1_base = diff_X + diff_X_bar_r1_base + diff_foo_r1_base
- expected_output_base_r3 = diff_foo_base_r3 + diff_X_bar_base_r3 + diff_X
+ expected_output_r1_base = diff_X_r1_base + diff_X_bar_r1_base + diff_foo_r1_base
+ expected_output_base_r3 = diff_foo_base_r3 + diff_X_bar_base_r3 + diff_X_base_r3
os.chdir(sbox.wc_dir)
@@ -2464,66 +2577,112 @@ def basic_diff_summarize(sbox):
sbox.build()
wc_dir = sbox.wc_dir
+ p = sbox.ospath
- # A content modification.
- svntest.main.file_append(os.path.join(wc_dir, "A", "mu"), "New mu content")
-
- # A prop modification.
- svntest.main.run_svn(None,
- "propset", "prop", "val",
- os.path.join(wc_dir, 'iota'))
-
- # Both content and prop mods.
- tau_path = os.path.join(wc_dir, "A", "D", "G", "tau")
- svntest.main.file_append(tau_path, "tautau")
- svntest.main.run_svn(None,
- "propset", "prop", "val", tau_path)
+ # Add props to some items that will be deleted, and commit.
+ sbox.simple_propset('prop', 'val',
+ p('A/C'),
+ p('A/D/gamma'),
+ p('A/D/H/chi'))
+ sbox.simple_commit() # r2
+ sbox.simple_update()
- # A file addition.
- newfile_path = os.path.join(wc_dir, 'newfile')
- svntest.main.file_append(newfile_path, 'newfile')
- svntest.main.run_svn(None, 'add', newfile_path)
+ # Content modification.
+ svntest.main.file_append(p('A/mu'), 'new text\n')
- # A file deletion.
- svntest.main.run_svn(None, "delete", os.path.join(wc_dir, 'A', 'B',
- 'lambda'))
+ # Prop modification.
+ sbox.simple_propset('prop', 'val', p('iota'))
- expected_output = svntest.wc.State(wc_dir, {
- 'A/mu': Item(verb='Sending'),
- 'iota': Item(verb='Sending'),
- 'newfile': Item(verb='Adding'),
- 'A/D/G/tau': Item(verb='Sending'),
- 'A/B/lambda': Item(verb='Deleting'),
- })
- expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- expected_status.add({
- 'newfile': Item(status=' ', wc_rev=2),
- })
- expected_status.tweak("A/mu", "iota", "A/D/G/tau", 'newfile', wc_rev=2)
- expected_status.remove("A/B/lambda")
+ # Both content and prop mods.
+ svntest.main.file_append(p('A/D/G/tau'), 'new text\n')
+ sbox.simple_propset('prop', 'val', p('A/D/G/tau'))
- svntest.actions.run_and_verify_commit(wc_dir, expected_output,
- expected_status, None, wc_dir)
+ # File addition.
+ svntest.main.file_append(p('newfile'), 'new text\n')
+ svntest.main.file_append(p('newfile2'), 'new text\n')
+ sbox.simple_add(p('newfile'),
+ p('newfile2'))
+ sbox.simple_propset('prop', 'val', p('newfile'))
+
+ # File deletion.
+ sbox.simple_rm(p('A/B/lambda'),
+ p('A/D/gamma'))
+
+ # Directory addition.
+ os.makedirs(p('P'))
+ os.makedirs(p('Q/R'))
+ svntest.main.file_append(p('Q/newfile'), 'new text\n')
+ svntest.main.file_append(p('Q/R/newfile'), 'new text\n')
+ sbox.simple_add(p('P'),
+ p('Q'))
+ sbox.simple_propset('prop', 'val',
+ p('P'),
+ p('Q/newfile'))
+
+ # Directory deletion.
+ sbox.simple_rm(p('A/D/H'),
+ p('A/C'))
+
+ # Commit, because diff-summarize handles repos-repos only.
+ #svntest.main.run_svn(False, 'st', wc_dir)
+ sbox.simple_commit() # r3
# Get the differences between two versions of a file.
expected_diff = svntest.wc.State(wc_dir, {
'iota': Item(status=' M'),
})
svntest.actions.run_and_verify_diff_summarize(expected_diff,
- os.path.join(wc_dir, 'iota'),
- '-c2')
+ p('iota'), '-c3')
+ svntest.actions.run_and_verify_diff_summarize(expected_diff,
+ p('iota'), '-c-3')
- # Get the differences between two versions of an entire directory.
+ # wc-wc diff summary for a directory.
expected_diff = svntest.wc.State(wc_dir, {
- 'A/mu': Item(status='M '),
- 'iota': Item(status=' M'),
- 'A/D/G/tau': Item(status='MM'),
- 'newfile': Item(status='A '),
- 'A/B/lambda': Item(status='D '),
+ 'A/mu': Item(status='M '),
+ 'iota': Item(status=' M'),
+ 'A/D/G/tau': Item(status='MM'),
+ 'newfile': Item(status='A '),
+ 'newfile2': Item(status='A '),
+ 'P': Item(status='A '),
+ 'Q': Item(status='A '),
+ 'Q/newfile': Item(status='A '),
+ 'Q/R': Item(status='A '),
+ 'Q/R/newfile': Item(status='A '),
+ 'A/B/lambda': Item(status='D '),
+ 'A/C': Item(status='D '),
+ 'A/D/gamma': Item(status='D '),
+ 'A/D/H': Item(status='D '),
+ 'A/D/H/chi': Item(status='D '),
+ 'A/D/H/psi': Item(status='D '),
+ 'A/D/H/omega': Item(status='D '),
+ })
+
+ expected_reverse_diff = svntest.wc.State(wc_dir, {
+ 'A/mu': Item(status='M '),
+ 'iota': Item(status=' M'),
+ 'A/D/G/tau': Item(status='MM'),
+ 'newfile': Item(status='D '),
+ 'newfile2': Item(status='D '),
+ 'P': Item(status='D '),
+ 'Q': Item(status='D '),
+ 'Q/newfile': Item(status='D '),
+ 'Q/R': Item(status='D '),
+ 'Q/R/newfile': Item(status='D '),
+ 'A/B/lambda': Item(status='A '),
+ 'A/C': Item(status='A '),
+ 'A/D/gamma': Item(status='A '),
+ 'A/D/H': Item(status='A '),
+ 'A/D/H/chi': Item(status='A '),
+ 'A/D/H/psi': Item(status='A '),
+ 'A/D/H/omega': Item(status='A '),
})
+
svntest.actions.run_and_verify_diff_summarize(expected_diff,
- wc_dir, '-r1:2')
+ wc_dir, '-c3')
+ svntest.actions.run_and_verify_diff_summarize(expected_reverse_diff,
+ wc_dir, '-c-3')
+#----------------------------------------------------------------------
def diff_weird_author(sbox):
"diff with svn:author that has < in it"
@@ -2701,6 +2860,7 @@ def diff_with_depth(sbox):
"test diffs at various depths"
sbox.build()
+ B_path = os.path.join('A', 'B')
diff = [
"\n",
@@ -2722,17 +2882,29 @@ def diff_with_depth(sbox):
"## -0,0 +1 ##\n",
"+bar3\n",
"\n",
- "Property changes on: " + os.path.join('A', 'B') + "\n",
+ "Property changes on: A/B\n",
"___________________________________________________________________\n",
"Added: foo4\n",
"## -0,0 +1 ##\n",
"+bar4\n"]
- expected_empty = svntest.verify.UnorderedOutput(diff[:6])
- expected_files = svntest.verify.UnorderedOutput(diff[:12])
- expected_immediates = svntest.verify.UnorderedOutput(diff[:18])
- expected_infinity = svntest.verify.UnorderedOutput(diff[:6]
- + diff[12:] + diff[6:12])
+ dot_header = make_diff_header(".", "revision 1", "working copy")
+ iota_header = make_diff_header('iota', "revision 1", "working copy")
+ A_header = make_diff_header('A', "revision 1", "working copy")
+ B_header = make_diff_header(B_path, "revision 1", "working copy")
+
+ expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
+ expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ + iota_header + diff[7:12])
+ expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ + iota_header
+ + diff[7:12]
+ + A_header + diff[8:18])
+ expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ + iota_header
+ + diff[7:12]
+ + A_header + diff[8:18]
+ + B_header + diff[12:])
os.chdir(sbox.wc_dir)
@@ -2763,7 +2935,25 @@ def diff_with_depth(sbox):
svntest.actions.run_and_verify_svn(None, None, [],
'ci', '-m', '')
- # Test repos-repos diff. Reuse the expected outputs from above.
+ dot_header = make_diff_header(".", "revision 1", "revision 2")
+ iota_header = make_diff_header('iota', "revision 1", "revision 2")
+ A_header = make_diff_header('A', "revision 1", "revision 2")
+ B_header = make_diff_header(B_path, "revision 1", "revision 2")
+
+ expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
+ expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ + iota_header + diff[7:12])
+ expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ + iota_header
+ + diff[7:12]
+ + A_header + diff[8:18])
+ expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ + iota_header
+ + diff[7:12]
+ + A_header + diff[8:18]
+ + B_header + diff[12:])
+
+ # Test repos-repos diff.
svntest.actions.run_and_verify_svn(None, expected_empty, [],
'diff', '-c2', '--depth', 'empty')
svntest.actions.run_and_verify_svn(None, expected_files, [],
@@ -2774,13 +2964,21 @@ def diff_with_depth(sbox):
'diff', '-c2', '--depth', 'infinity')
diff_wc_repos = [
+ "Index: A/B\n",
+ "===================================================================\n",
+ "--- A/B\t(revision 2)\n",
+ "+++ A/B\t(working copy)\n",
"\n",
- "Property changes on: " + os.path.join('A', 'B') + "\n",
+ "Property changes on: A/B\n",
"___________________________________________________________________\n",
"Modified: foo4\n",
"## -1 +1 ##\n",
"-bar4\n",
"+baz4\n",
+ "Index: A\n",
+ "===================================================================\n",
+ "--- A\t(revision 2)\n",
+ "+++ A\t(working copy)\n",
"\n",
"Property changes on: A\n",
"___________________________________________________________________\n",
@@ -2809,6 +3007,10 @@ def diff_with_depth(sbox):
"## -1 +1 ##\n",
"-bar2\n",
"+baz2\n",
+ "Index: .\n",
+ "===================================================================\n",
+ "--- .\t(revision 2)\n",
+ "+++ .\t(working copy)\n",
"\n",
"Property changes on: .\n",
"___________________________________________________________________\n",
@@ -2817,10 +3019,10 @@ def diff_with_depth(sbox):
"-bar1\n",
"+baz1\n" ]
- expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[35:])
- expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[21:])
- expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[7:14]
- +diff_wc_repos[21:])
+ expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[43:])
+ expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[29:])
+ expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[11:22]
+ +diff_wc_repos[29:])
expected_infinity = svntest.verify.UnorderedOutput(diff_wc_repos[:])
svntest.actions.run_and_verify_svn(None, None, [],
@@ -3131,11 +3333,11 @@ def diff_url_against_local_mods(sbox):
#----------------------------------------------------------------------
-# Diff rev against working copy of a removed and locally re-added file.
-# This is issue #1675 ("svn diff -rN added-file" has odd behavior).
+# Diff against old revision of the parent directory of a removed and
+# locally re-added file.
def diff_preexisting_rev_against_local_add(sbox):
- "diff -r1 of removed file to its local addition"
+ "diff -r1 of dir with removed-then-readded file"
sbox.build()
os.chdir(sbox.wc_dir)
@@ -3157,7 +3359,6 @@ def diff_preexisting_rev_against_local_a
verify_expected_output(diff_output, "-This is the file 'beta'.")
verify_expected_output(diff_output, "+Re-created file beta.")
-# Passes with SVN_EXPERIMENTAL_PATCH defined
def diff_git_format_wc_wc(sbox):
"create a diff in git unidiff format for wc-wc"
sbox.build()
@@ -3165,33 +3366,54 @@ def diff_git_format_wc_wc(sbox):
iota_path = os.path.join(wc_dir, 'iota')
mu_path = os.path.join(wc_dir, 'A', 'mu')
new_path = os.path.join(wc_dir, 'new')
+ lambda_path = os.path.join(wc_dir, 'A', 'B', 'lambda')
+ lambda_copied_path = os.path.join(wc_dir, 'A', 'B', 'lambda_copied')
+ alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
+ alpha_copied_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha_copied')
+
svntest.main.file_append(iota_path, "Changed 'iota'.\n")
svntest.main.file_append(new_path, "This is the file 'new'.\n")
svntest.main.run_svn(None, 'add', new_path)
svntest.main.run_svn(None, 'rm', mu_path)
-
- ### We're not testing copied or moved paths
-
- expected_output = make_git_diff_header(mu_path, "revision 1",
+ svntest.main.run_svn(None, 'cp', lambda_path, lambda_copied_path)
+ svntest.main.run_svn(None, 'cp', alpha_path, alpha_copied_path)
+ svntest.main.file_append(alpha_copied_path, "This is a copy of 'alpha'.\n")
+
+ ### We're not testing moved paths
+
+ expected_output = make_git_diff_header(lambda_copied_path,
+ "A/B/lambda_copied",
+ "revision 1", "working copy",
+ copyfrom_path="A/B/lambda", cp=True,
+ text_changes=False) \
+ + make_git_diff_header(alpha_copied_path, "A/B/E/alpha_copied",
+ "revision 0", "working copy",
+ copyfrom_path="A/B/E/alpha", cp=True,
+ text_changes=True) + [
+ "@@ -1 +1,2 @@\n",
+ " This is the file 'alpha'.\n",
+ "+This is a copy of 'alpha'.\n",
+ ] + make_git_diff_header(mu_path, "A/mu", "revision 1",
"working copy",
delete=True) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'mu'.\n",
- ] + make_git_diff_header(new_path, "revision 0", "working copy",
- add=True) + [
+ ] + make_git_diff_header(new_path, "new", "revision 0",
+ "working copy", add=True) + [
"@@ -0,0 +1 @@\n",
"+This is the file 'new'.\n",
- ] + make_git_diff_header(iota_path, "revision 1",
+ ] + make_git_diff_header(iota_path, "iota", "revision 1",
"working copy") + [
"@@ -1 +1,2 @@\n",
" This is the file 'iota'.\n",
"+Changed 'iota'.\n",
]
- svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
- wc_dir)
+ expected = svntest.verify.UnorderedOutput(expected_output)
+
+ svntest.actions.run_and_verify_svn(None, expected, [], 'diff',
+ '--git', wc_dir)
-# Passes with SVN_EXPERIMENTAL_PATCH defined
def diff_git_format_url_wc(sbox):
"create a diff in git unidiff format for url-wc"
sbox.build()
@@ -3210,29 +3432,28 @@ 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, "revision 0", "revision 2",
- dst_label=wc_dir, add=True) + [
+ expected_output = make_git_diff_header(new_path, "new", "revision 0",
+ "revision 2", add=True) + [
"@@ -0,0 +1 @@\n",
"+This is the file 'new'.\n",
- ] + make_git_diff_header(mu_path, "revision 1",
- "working copy",
- src_label=repo_url,
+ ] + make_git_diff_header(mu_path, "A/mu", "revision 1", "working copy",
delete=True) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'mu'.\n",
- ] + make_git_diff_header(iota_path, "revision 1",
- "working copy", src_label=repo_url,
- dst_label=wc_dir) + [
+ ] + make_git_diff_header(iota_path, "iota", "revision 1",
+ "working copy") + [
"@@ -1 +1,2 @@\n",
" This is the file 'iota'.\n",
"+Changed 'iota'.\n",
]
- svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
+ expected = svntest.verify.UnorderedOutput(expected_output)
+
+ svntest.actions.run_and_verify_svn(None, expected, [], 'diff',
+ '--git',
'--old', repo_url + '@1', '--new',
wc_dir)
-# Passes with SVN_EXPERIMENTAL_PATCH defined
def diff_git_format_url_url(sbox):
"create a diff in git unidiff format for url-url"
sbox.build()
@@ -3252,26 +3473,242 @@ def diff_git_format_url_url(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("A/mu", "revision 1",
+ expected_output = make_git_diff_header("A/mu", "A/mu", "revision 1",
"revision 2",
delete=True) + [
"@@ -1 +0,0 @@\n",
"-This is the file 'mu'.\n",
- ] + make_git_diff_header("new", "revision 0", "revision 2",
- add=True) + [
+ ] + make_git_diff_header("new", "new", "revision 0", "revision 2",
+ add=True) + [
"@@ -0,0 +1 @@\n",
"+This is the file 'new'.\n",
- ] + make_git_diff_header("iota", "revision 1",
+ ] + make_git_diff_header("iota", "iota", "revision 1",
"revision 2") + [
"@@ -1 +1,2 @@\n",
" This is the file 'iota'.\n",
"+Changed 'iota'.\n",
]
- svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
+ expected = svntest.verify.UnorderedOutput(expected_output)
+
+ svntest.actions.run_and_verify_svn(None, expected, [], 'diff',
+ '--git',
'--old', repo_url + '@1', '--new',
repo_url + '@2')
+# Regression test for an off-by-one error when printing intermediate context
+# lines.
+def diff_prop_missing_context(sbox):
+ "diff for property has missing context"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ iota_path = os.path.join(wc_dir, 'iota')
+ prop_val = "".join([
+ "line 1\n",
+ "line 2\n",
+ "line 3\n",
+ "line 4\n",
+ "line 5\n",
+ "line 6\n",
+ "line 7\n",
+ ])
+ svntest.main.run_svn(None,
+ "propset", "prop", prop_val, iota_path)
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'iota' : Item(verb='Sending'),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('iota', wc_rev=2)
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ prop_val = "".join([
+ "line 3\n",
+ "line 4\n",
+ "line 5\n",
+ "line 6\n",
+ ])
+ svntest.main.run_svn(None,
+ "propset", "prop", prop_val, iota_path)
+ expected_output = make_diff_header(iota_path, 'revision 2',
+ 'working copy') + [
+ "\n",
+ "Property changes on: %s\n" % iota_path.replace('\\', '/'),
+ "___________________________________________________________________\n",
+ "Modified: prop\n",
+ "## -1,7 +1,4 ##\n",
+ "-line 1\n",
+ "-line 2\n",
+ " line 3\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ "-line 7\n",
+ ]
+
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', iota_path)
+
+def diff_prop_multiple_hunks(sbox):
+ "diff for property with multiple hunks"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ iota_path = os.path.join(wc_dir, 'iota')
+ prop_val = "".join([
+ "line 1\n",
+ "line 2\n",
+ "line 3\n",
+ "line 4\n",
+ "line 5\n",
+ "line 6\n",
+ "line 7\n",
+ "line 8\n",
+ "line 9\n",
+ "line 10\n",
+ "line 11\n",
+ "line 12\n",
+ "line 13\n",
+ ])
+ svntest.main.run_svn(None,
+ "propset", "prop", prop_val, iota_path)
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'iota' : Item(verb='Sending'),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('iota', wc_rev=2)
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ prop_val = "".join([
+ "line 1\n",
+ "line 2\n",
+ "line 3\n",
+ "Add a line here\n",
+ "line 4\n",
+ "line 5\n",
+ "line 6\n",
+ "line 7\n",
+ "line 8\n",
+ "line 9\n",
+ "line 10\n",
+ "And add a line here\n",
+ "line 11\n",
+ "line 12\n",
+ "line 13\n",
+ ])
+ svntest.main.run_svn(None,
+ "propset", "prop", prop_val, iota_path)
+ expected_output = make_diff_header(iota_path, 'revision 2',
+ 'working copy') + [
+ "\n",
+ "Property changes on: %s\n" % iota_path.replace('\\', '/'),
+ "___________________________________________________________________\n",
+ "Modified: prop\n",
+ "## -1,6 +1,7 ##\n",
+ " line 1\n",
+ " line 2\n",
+ " line 3\n",
+ "+Add a line here\n",
+ " line 4\n",
+ " line 5\n",
+ " line 6\n",
+ "## -8,6 +9,7 ##\n",
+ " line 8\n",
+ " line 9\n",
+ " line 10\n",
+ "+And add a line here\n",
+ " line 11\n",
+ " line 12\n",
+ " line 13\n",
+ ]
+
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', iota_path)
+def diff_git_empty_files(sbox):
+ "create a diff in git format for empty files"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ iota_path = os.path.join(wc_dir, 'iota')
+ new_path = os.path.join(wc_dir, 'new')
+ svntest.main.file_write(iota_path, "")
+
+ # Now commit the local mod, creating rev 2.
+ expected_output = svntest.wc.State(wc_dir, {
+ 'iota' : Item(verb='Sending'),
+ })
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'iota' : Item(status=' ', wc_rev=2),
+ })
+
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ svntest.main.file_write(new_path, "")
+ 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",
+ "working copy",
+ add=True, text_changes=False) + [
+ ] + make_git_diff_header(iota_path, "iota", "revision 2", "working copy",
+ delete=True, text_changes=False)
+
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
+ '--git', wc_dir)
+
+def diff_git_with_props(sbox):
+ "create a diff in git format showing prop changes"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ iota_path = os.path.join(wc_dir, 'iota')
+ new_path = os.path.join(wc_dir, 'new')
+ svntest.main.file_write(iota_path, "")
+
+ # Now commit the local mod, creating rev 2.
+ expected_output = svntest.wc.State(wc_dir, {
+ 'iota' : Item(verb='Sending'),
+ })
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'iota' : Item(status=' ', wc_rev=2),
+ })
+
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ svntest.main.file_write(new_path, "")
+ svntest.main.run_svn(None, 'add', new_path)
+ svntest.main.run_svn(None, 'propset', 'svn:eol-style', 'native', new_path)
+ svntest.main.run_svn(None, 'propset', 'svn:keywords', 'Id', iota_path)
+
+ expected_output = make_git_diff_header(new_path, "new", "revision 0",
+ "working copy",
+ add=True, text_changes=False) + [
+ "\n",
+ "Property changes on: new\n",
+ "___________________________________________________________________\n",
+ "Added: svn:eol-style\n",
+ "## -0,0 +1 ##\n",
+ "+native\n",
+ ] + make_git_diff_header(iota_path, "iota", "revision 1", "working copy",
+ text_changes=False) + [
+ "\n",
+ "Property changes on: iota\n",
+ "___________________________________________________________________\n",
+ "Added: svn:keywords\n",
+ "## -0,0 +1 ##\n",
+ "+Id\n",
+ ]
+
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
+ '--git', wc_dir)
########################################################################
#Run the tests
@@ -3305,7 +3742,7 @@ test_list = [ None,
diff_keywords,
diff_force,
diff_schedule_delete,
- XFail(diff_renamed_dir),
+ diff_renamed_dir,
diff_property_changes_to_base,
diff_mime_type_changes,
diff_prop_change_local_propmod,
@@ -3328,9 +3765,13 @@ test_list = [ None,
diff_external_diffcmd,
XFail(diff_url_against_local_mods),
XFail(diff_preexisting_rev_against_local_add),
- XFail(diff_git_format_wc_wc),
- XFail(diff_git_format_url_wc),
- XFail(diff_git_format_url_url),
+ diff_git_format_wc_wc,
+ diff_git_format_url_wc,
+ diff_git_format_url_url,
+ diff_prop_missing_context,
+ diff_prop_multiple_hunks,
+ diff_git_empty_files,
+ diff_git_with_props,
]
if __name__ == '__main__':
Modified: subversion/branches/py-tests-as-modules/subversion/tests/cmdline/entries-dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/cmdline/entries-dump.c?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/cmdline/entries-dump.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/cmdline/entries-dump.c Wed Sep 15 19:32:26 2010
@@ -1,5 +1,5 @@
/*
- * db-test.c : test the wc_db subsystem
+ * entries-dump.c : dump pre-1.6 svn_wc_* output for python
*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
@@ -32,6 +32,7 @@
#include "svn_wc.h"
#include "svn_dirent_uri.h"
+#include "private/svn_wc_private.h"
static void
str_value(const char *name, const char *value)
@@ -131,6 +132,59 @@ entries_dump(const char *dir_path, apr_p
}
+/* baton for print_dir */
+struct directory_walk_baton
+{
+ svn_wc_context_t *wc_ctx;
+ const char *root_abspath;
+ const char *prefix_path;
+};
+
+/* svn_wc__node_found_func_t implementation for directory_dump */
+static svn_error_t *
+print_dir(const char *local_abspath,
+ void *walk_baton,
+ apr_pool_t *scratch_pool)
+{
+ struct directory_walk_baton *bt = walk_baton;
+ svn_node_kind_t kind;
+
+ SVN_ERR(svn_wc_read_kind(&kind, bt->wc_ctx, local_abspath, FALSE,
+ scratch_pool));
+
+ if (kind != svn_node_dir)
+ return SVN_NO_ERROR;
+
+ printf("%s\n",
+ svn_dirent_local_style(
+ svn_dirent_join(bt->prefix_path,
+ svn_dirent_skip_ancestor(bt->root_abspath,
+ local_abspath),
+ scratch_pool),
+ scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+/* Print all not-hidden subdirectories in the working copy, starting by path */
+static svn_error_t *
+directory_dump(const char *path,
+ apr_pool_t *scratch_pool)
+{
+ struct directory_walk_baton bt;
+
+ SVN_ERR(svn_wc_context_create(&bt.wc_ctx, NULL, scratch_pool, scratch_pool));
+ SVN_ERR(svn_dirent_get_absolute(&bt.root_abspath, path, scratch_pool));
+
+ bt.prefix_path = path;
+
+ SVN_ERR(svn_wc__node_walk_children(bt.wc_ctx, bt.root_abspath, FALSE,
+ print_dir, &bt, svn_depth_infinity,
+ NULL, NULL, scratch_pool));
+
+ return svn_error_return(svn_wc_context_destroy(bt.wc_ctx));
+}
+
int
main(int argc, const char *argv[])
{
@@ -138,24 +192,38 @@ main(int argc, const char *argv[])
int exit_code = EXIT_SUCCESS;
svn_error_t *err;
const char *path;
+ const char *cmd;
- if (argc != 2)
+ if (argc < 2 || argc > 4)
{
- printf("USAGE: entries-dump DIR_PATH\n");
+ fprintf(stderr, "USAGE: entries-dump [--entries|--subdirs] DIR_PATH\n");
exit(1);
}
if (apr_initialize() != APR_SUCCESS)
{
- printf("apr_initialize() failed.\n");
+ fprintf(stderr, "apr_initialize() failed.\n");
exit(1);
}
/* set up the global pool */
pool = svn_pool_create(NULL);
- path = svn_dirent_internal_style(argv[1], pool);
- err = entries_dump(path, pool);
+ path = svn_dirent_internal_style(argv[argc-1], pool);
+
+ if (argc > 2)
+ cmd = argv[1];
+ else
+ cmd = NULL;
+
+ if (!cmd || !strcmp(cmd, "--entries"))
+ err = entries_dump(path, pool);
+ else if (!strcmp(cmd, "--subdirs"))
+ err = directory_dump(path, pool);
+ else
+ err = svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
+ "Invalid command '%s'",
+ cmd);
if (err)
{
svn_handle_error2(err, stderr, FALSE, "entries-dump: ");
@@ -167,6 +235,5 @@ main(int argc, const char *argv[])
svn_pool_destroy(pool);
apr_terminate();
- exit(exit_code);
return exit_code;
}
Modified: subversion/branches/py-tests-as-modules/subversion/tests/cmdline/entries_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/cmdline/entries_tests.py?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/cmdline/entries_tests.py (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/cmdline/entries_tests.py Wed Sep 15 19:32:26 2010
@@ -182,7 +182,12 @@ def obstructed_entries(sbox):
entries = svntest.main.run_entriesdump(D_path)
check_names(entries, 'H')
- validate(entries['H'], revision=-1)
+
+ if svntest.main.wc_is_singledb(wc_dir):
+ # Data is not missing in single-db
+ validate(entries['H'], revision=1)
+ else:
+ validate(entries['H'], revision=-1)
### need to get svn_wc__db_read_info() to generate obstructed_add
Modified: subversion/branches/py-tests-as-modules/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/cmdline/export_tests.py?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/cmdline/export_tests.py Wed Sep 15 19:32:26 2010
@@ -26,6 +26,7 @@
# General modules
import os
+import tempfile
# Our testing module
import svntest
@@ -268,20 +269,28 @@ def export_working_copy_at_base_revision
wc_dir = sbox.wc_dir
mu_path = os.path.join(wc_dir, 'A', 'mu')
+ C_path = os.path.join(wc_dir, 'A', 'C')
kappa_path = os.path.join(wc_dir, 'kappa')
+ K_path = os.path.join(wc_dir, 'K')
gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
E_path = os.path.join(wc_dir, 'A', 'B', 'E')
+ rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
- # Appends some text to A/mu, and add a new file
- # called kappa. These modifications should *not*
- # get exported at the base revision.
+ # Make some local modifications: modify mu and C, add kappa and K, delete
+ # gamma and E, and replace rho. (Directories can't yet be replaced.)
+ # These modifications should *not* get exported at the base revision.
svntest.main.file_append(mu_path, 'Appended text')
+ svntest.main.run_svn(None, 'propset', 'p', 'v', mu_path, C_path)
svntest.main.file_append(kappa_path, "This is the file 'kappa'.")
svntest.main.run_svn(None, 'add', kappa_path)
+ svntest.main.run_svn(None, 'mkdir', K_path)
svntest.main.run_svn(None, 'rm', E_path, gamma_path)
+ svntest.main.run_svn(None, 'rm', rho_path)
+ svntest.main.file_append(rho_path, "Replacement file 'rho'.")
+ svntest.main.run_svn(None, 'add', rho_path)
# Note that we don't tweak the expected disk tree at all,
- # since the appended text and kappa should not be present.
+ # since the modifications should not be present.
expected_disk = svntest.main.greek_state.copy()
export_target = sbox.add_wc_path('export')
@@ -483,6 +492,135 @@ def export_working_copy_ignoring_keyword
expected_disk,
"--ignore-keywords")
+# This is test for issue #3683 - 'Escape unsafe charaters in a URL during
+# export'
+def export_with_url_unsafe_characters(sbox):
+ "export file with URL unsafe characters"
+
+ ## See http://subversion.tigris.org/issues/show_bug.cgi?id=3683 ##
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Define the paths
+ url_unsafe_path = os.path.join(wc_dir, 'A', 'test- @#$&.txt')
+ url_unsafe_path_url = sbox.repo_url + '/A/test- @#$&.txt@'
+ export_target = os.path.join(wc_dir, 'test- @#$&.txt')
+
+ # Create the file with special name and commit it.
+ svntest.main.file_write(url_unsafe_path, 'This is URL unsafe path file.')
+ svntest.main.run_svn(None, 'add', url_unsafe_path + '@')
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', 'log msg',
+ '--quiet', wc_dir)
+
+ # Export the file and verify it.
+ svntest.actions.run_and_verify_svn(None, None, [], 'export',
+ url_unsafe_path_url, export_target + '@')
+
+ if not os.path.exists(export_target):
+ raise svntest.Failure("export did not fetch file with URL unsafe path")
+
+def export_working_copy_with_depths(sbox):
+ "export working copy with different depths"
+ sbox.build(read_only = True)
+
+ expected_disk = svntest.wc.State('', {
+ 'A': Item(),
+ 'iota': Item(contents="This is the file 'iota'.\n"),
+ })
+ export_target = sbox.add_wc_path('immediates')
+ svntest.actions.run_and_verify_export(sbox.wc_dir,
+ export_target,
+ svntest.wc.State(sbox.wc_dir, {}),
+ expected_disk,
+ '--depth=immediates')
+
+ expected_disk.remove('A')
+ export_target = sbox.add_wc_path('files')
+ svntest.actions.run_and_verify_export(sbox.wc_dir,
+ export_target,
+ svntest.wc.State(sbox.wc_dir, {}),
+ expected_disk,
+ '--depth=files')
+
+ expected_disk.remove('iota')
+ export_target = sbox.add_wc_path('empty')
+ svntest.actions.run_and_verify_export(sbox.wc_dir,
+ export_target,
+ svntest.wc.State(sbox.wc_dir, {}),
+ expected_disk,
+ '--depth=empty')
+
+def export_externals_with_native_eol(sbox):
+ "export externals with eol translation"
+ sbox.build()
+
+ wc_dir = sbox.wc_dir
+
+ # Set svn:eol-style to 'native' to see if it's applied correctly to
+ # externals in the export operation
+ alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
+ svntest.main.run_svn(None, 'ps', 'svn:eol-style', 'native', alpha_path)
+ svntest.main.run_svn(None, 'ci',
+ '-m', 'Added eol-style prop to alpha', alpha_path)
+
+ # Set 'svn:externals' property in 'A/C' to 'A/B/E/alpha'(file external),
+ # 'A/B/E'(directory external) & commit the property
+ C_path = os.path.join(wc_dir, 'A', 'C')
+ externals_prop = """^/A/B/E/alpha exfile_alpha
+ ^/A/B/E exdir_E"""
+
+ tmp_f = sbox.get_tempname('props')
+ 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 all changes(file external and
+ # directroy external changes) from repository
+ svntest.main.run_svn(None, 'up', wc_dir)
+
+ # After export, expected_disk will have all those present in standard
+ # greek tree and new externals we added above.
+ # Update the expected disk tree to include all those externals.
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({
+ 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\n"),
+ 'A/C/exdir_E' : Item(),
+ 'A/C/exdir_E/alpha' : Item("This is the file 'alpha'.\n"),
+ 'A/C/exdir_E/beta' : Item("This is the file 'beta'.\n")
+ })
+
+ # We are exporting with '--native-eol CR' option.
+ # So change the contents of files under *expected_disk* tree
+ # which have svn:eol-style property set to 'native' to verify
+ # with the exported tree.
+ # Here A/B/E/alpha and its external manifestations A/C/exfile_alpha
+ # and A/C/exdir_E/alpha needs a tweak.
+ new_contents = expected_disk.desc['A/C/exfile_alpha'].contents.replace("\n",
+ "\r")
+ expected_disk.tweak('A/C/exfile_alpha', 'A/B/E/alpha','A/C/exdir_E/alpha',
+ contents=new_contents)
+
+ expected_output = svntest.main.greek_state.copy()
+ expected_output.add({
+ 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\r"),
+ 'A/C/exdir_E' : Item(),
+ 'A/C/exdir_E/alpha' : Item("This is the file 'alpha'.\r"),
+ 'A/C/exdir_E/beta' : Item("This is the file 'beta'.\n")
+ })
+
+ # Export the repository with '--native-eol CR' option
+ export_target = sbox.add_wc_path('export')
+ 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,
+ '--native-eol', 'CR')
+
########################################################################
# Run the tests
@@ -499,7 +637,7 @@ test_list = [ None,
export_eol_translation,
export_working_copy_with_keyword_translation,
export_working_copy_with_property_mods,
- export_working_copy_at_base_revision,
+ XFail(export_working_copy_at_base_revision),
export_native_eol_option,
export_nonexistent_file,
export_unversioned_file,
@@ -509,6 +647,9 @@ test_list = [ None,
export_to_explicit_cwd,
export_ignoring_keyword_translation,
export_working_copy_ignoring_keyword_translation,
+ export_with_url_unsafe_characters,
+ XFail(export_working_copy_with_depths),
+ export_externals_with_native_eol,
]
if __name__ == '__main__':
Modified: subversion/branches/py-tests-as-modules/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/cmdline/externals_tests.py?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/cmdline/externals_tests.py Wed Sep 15 19:32:26 2010
@@ -1471,6 +1471,104 @@ def wc_repos_file_externals(sbox):
None, None, None, None, None,
True)
+#----------------------------------------------------------------------
+def merge_target_with_externals(sbox):
+ "merge target with externals"
+
+ # Test for a problem the plagued Subversion in the pre-1.7-single-DB world:
+ # Externals in a merge target would get meaningless explicit mergeinfo set
+ # on them. See http://svn.haxx.se/dev/archive-2010-08/0088.shtml
+ externals_test_setup(sbox)
+ wc_dir = sbox.wc_dir
+ repo_url = sbox.repo_url
+
+ # Some paths we'll care about
+ A_path = os.path.join(wc_dir, "A")
+ A_branch_path = os.path.join(wc_dir, "A-branch")
+ A_gamma_branch_path = os.path.join(wc_dir, "A-branch", "D", "gamma")
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'checkout',
+ repo_url, wc_dir)
+
+ # Branch A@1 to A-branch and make a simple text change on the latter in r8.
+ svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_path + '@1',
+ A_branch_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci',
+ '-m', 'make a copy', wc_dir)
+ svntest.main.file_write(A_gamma_branch_path, "The new gamma!\n")
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci',
+ '-m', 'branch edit', wc_dir)
+ svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+ # Merge r8 from A-branch back to A. There should be explicit mergeinfo
+ # only at the root of A; the externals should not get any.
+ svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c8',
+ repo_url + '/A-branch', A_path)
+ svntest.actions.run_and_verify_svn(
+ "Unexpected subtree mergeinfo created",
+ ["Properties on '" + A_path + "':\n",
+ " svn:mergeinfo\n",
+ " /A-branch:8\n"],
+ [], 'pg', svntest.main.SVN_PROP_MERGEINFO, '-vR', wc_dir)
+
+def update_modify_file_external(sbox):
+ "update that modifies a file external"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Setup A/external as file external to A/mu
+ externals_prop = "^/A/mu external\n"
+ change_external(sbox.ospath('A'), externals_prop)
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/external' : Item(status='E '),
+ })
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({
+ 'A' : Item(props={'svn:externals':externals_prop}),
+ 'A/external' : Item("This is the file 'mu'.\n"),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.add({
+ 'A/external' : Item(status=' ', wc_rev='2', switched='X'),
+ })
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None,
+ True)
+
+ # Modify A/mu
+ svntest.main.file_append(sbox.ospath('A/mu'), 'appended mu text')
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/mu' : Item(verb='Sending'),
+ })
+ expected_status.tweak('A/mu', wc_rev=3)
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ wc_dir)
+
+ # Update to modify the file external, this asserts in update_editor.c
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/external' : Item(status='U '),
+ })
+ expected_disk.tweak('A/mu', 'A/external',
+ contents=expected_disk.desc['A/mu'].contents
+ + 'appended mu text')
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
+ expected_status.add({
+ 'A/external' : Item(status=' ', wc_rev='3', switched='X'),
+ })
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None,
+ True)
########################################################################
# Run the tests
@@ -1501,6 +1599,8 @@ test_list = [ None,
export_sparse_wc_with_externals,
relegate_external,
wc_repos_file_externals,
+ merge_target_with_externals,
+ update_modify_file_external,
]
if __name__ == '__main__':
Modified: subversion/branches/py-tests-as-modules/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Wed Sep 15 19:32:26 2010
@@ -1,12 +1,15 @@
-log: Show the log messages for a set of revision(s) and/or file(s).
-usage: 1. log [PATH]
+log: Show the log messages for a set of revision(s) and/or path(s).
+usage: 1. log [PATH][@REV]
2. log URL[@REV] [PATH...]
- 1. Print the log messages for a local PATH (default: '.').
- The default revision range is BASE:1.
+ 1. Print the log messages for the URL corresponding to PATH
+ (default: '.'). If specified, REV is the revision in which the
+ URL is first looked up, and the default revision range is REV:1.
+ If REV is not specified, the default revision range is BASE:1,
+ since the URL might not exist in the HEAD revision.
2. Print the log messages for the PATHs (default: '.') under URL.
- If specified, REV determines in which revision the URL is first
+ If specified, REV is the revision in which the URL is first
looked up, and the default revision range is REV:1; otherwise,
the URL is looked up in HEAD, and the default revision range is
HEAD:1.
@@ -27,8 +30,10 @@ usage: 1. log [PATH]
Examples:
svn log
svn log foo.c
+ svn log bar.c@42
svn log http://www.example.com/repo/project/foo.c
svn log http://www.example.com/repo/project foo.c bar.c
+ svn log http://www.example.com/repo/project@50 foo.c bar.c
Valid options:
-r [--revision] ARG : ARG (some commands also take ARG1:ARG2 range)
Modified: subversion/branches/py-tests-as-modules/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/cmdline/lock_tests.py?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/cmdline/lock_tests.py Wed Sep 15 19:32:26 2010
@@ -858,7 +858,15 @@ def lock_switched_files(sbox):
gamma_path, lambda_path)
expected_status.tweak('A/D/gamma', 'A/B/lambda', writelocked='K')
- expected_status.tweak('A/B/E/alpha', 'iota', writelocked='O')
+
+ # In WC-NG locks are kept per working copy, not per file
+ if svntest.main.wc_is_singledb(wc_dir):
+ # In single-db you see these files are locked locally
+ expected_status.tweak('A/B/E/alpha', 'iota', writelocked='K')
+ else:
+ # In multi-db you see these files are not locked in the right dir
+ expected_status.tweak('A/B/E/alpha', 'iota', writelocked='O')
+
svntest.actions.run_and_verify_status(wc_dir, expected_status)
svntest.actions.run_and_verify_svn(None, ".*unlocked", [], 'unlock',
@@ -1428,9 +1436,15 @@ def lock_twice_in_one_wc(sbox):
os.chmod(mu2_path, 0700)
svntest.main.file_append(mu2_path, "Updated text")
- # Commit should fail because it is locked in the other location
- svntest.actions.run_and_verify_svn(None, None,
- '.*(([Nn]o)|(Server)).*[lL]ock.*',
+ if svntest.main.wc_is_singledb(wc_dir):
+ # Commit will just succeed as the DB owns the lock. It's a user decision
+ # to commit the other target instead of the one originally locked
+ expected_err = []
+ else:
+ # Commit should fail because it is locked in the other location
+ expected_err = '.*(([Nn]o)|(Server)).*[lL]ock.*'
+
+ svntest.actions.run_and_verify_svn(None, None, expected_err,
'commit', mu2_path, '-m', '')
#----------------------------------------------------------------------
@@ -1472,6 +1486,7 @@ def lock_path_not_in_head(sbox):
svntest.actions.run_and_verify_svn2(None, None, expected_lock_fail_err_re,
0, 'lock', lambda_path)
+#----------------------------------------------------------------------
def verify_path_escaping(sbox):
"verify escaping of lock paths"
@@ -1509,6 +1524,55 @@ def verify_path_escaping(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
+#----------------------------------------------------------------------
+# Issue #3674: Replace + propset of locked file fails over DAV
+def replace_and_propset_locked_path(sbox):
+ "test replace + propset of locked file"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
+ G_path = os.path.join(wc_dir, 'A', 'D', 'G')
+ rho_path = os.path.join(G_path, 'rho')
+
+ # Lock mu and A/D/G/rho.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'lock', mu_path, rho_path,
+ '-m', 'Locked')
+
+ # Now replace and propset on mu.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'rm', '--keep-local', mu_path)
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'add', mu_path)
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'propset', 'foo', 'bar', mu_path)
+
+ # Commit mu.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'commit', '-m', '', mu_path)
+
+ # Let's try this again where directories are involved, shall we?
+ # Replace A/D/G and A/D/G/rho, propset on A/D/G/rho.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'rm', G_path)
+ # Recreate path for single-db
+ if not os.path.exists(G_path):
+ os.mkdir(G_path)
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'add', G_path)
+ svntest.main.file_append(rho_path, "This is the new file 'rho'.\n")
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'add', rho_path)
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'propset', 'foo', 'bar', rho_path)
+
+ # And commit G.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'commit', '-m', '', G_path)
+
+
########################################################################
# Run the tests
@@ -1553,6 +1617,8 @@ test_list = [ None,
lock_twice_in_one_wc,
lock_path_not_in_head,
verify_path_escaping,
+ XFail(replace_and_propset_locked_path,
+ svntest.main.is_ra_type_dav),
]
if __name__ == '__main__':
Modified: subversion/branches/py-tests-as-modules/subversion/tests/cmdline/merge_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/cmdline/merge_authz_tests.py?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/cmdline/merge_authz_tests.py (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/cmdline/merge_authz_tests.py Wed Sep 15 19:32:26 2010
@@ -82,13 +82,6 @@ def mergeinfo_and_skipped_paths(sbox):
# 2) Destination of merge is inaccessible due to authz restrictions.
# 3) Source *and* destination of merge is inaccessible due to authz
# restrictions.
- # 4) File path is versioned but is missing from disk due to OS deletion.
- # This isn't technically part of issue #2893 but we handle this case
- # and it didn't warrant its own test).
- #
- # Eventually we should also test(?):
- #
- # 5) Dir path is versioned but is missing from disk due to an OS deletion.
sbox.build()
wc_dir = sbox.wc_dir
@@ -122,27 +115,20 @@ def mergeinfo_and_skipped_paths(sbox):
omega_path = os.path.join(wc_restricted, "A_COPY", "D", "H", "omega")
zeta_path = os.path.join(wc_dir, "A", "D", "H", "zeta")
- # Restrict access to some more of the merge destination the
- # old fashioned way, delete it via the OS.
- ### TODO: Delete a versioned directory?
- os.remove(omega_path)
-
# Merge r4:8 into the restricted WC's A_COPY.
#
# We expect A_COPY/B/E to be skipped because we can't access the source
# and A_COPY/D/H/omega because it is missing. Since we have A_COPY/B/E
# we should override it's inherited mergeinfo, giving it just what it
- # inherited from A_COPY before the merge. omega is missing, but since
- # it is a file we can record the fact that it is missing in its parent
- # directory A_COPY/D/H.
+ # inherited from A_COPY before the merge.
expected_output = wc.State(A_COPY_path, {
'D/G/rho' : Item(status='U '),
'D/H/psi' : Item(status='U '),
+ 'D/H/omega' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_COPY_path, {
'' : Item(status=' U'),
'B/E' : Item(status=' U'),
- 'D/H/omega' : Item(status=' U'),
})
expected_elision_output = wc.State(A_COPY_path, {
})
@@ -150,7 +136,7 @@ def mergeinfo_and_skipped_paths(sbox):
'' : Item(status=' M', wc_rev=8),
'D/H/chi' : Item(status=' ', wc_rev=8),
'D/H/psi' : Item(status='M ', wc_rev=8),
- 'D/H/omega' : Item(status='!M', wc_rev=8),
+ 'D/H/omega' : Item(status='M ', wc_rev=8),
'D/H' : Item(status=' ', wc_rev=8),
'D/G/pi' : Item(status=' ', wc_rev=8),
'D/G/rho' : Item(status='M ', wc_rev=8),
@@ -171,9 +157,7 @@ def mergeinfo_and_skipped_paths(sbox):
'' : Item(props={SVN_PROP_MERGEINFO : '/A:5-8'}),
'D/H/psi' : Item("New content"),
'D/H/chi' : Item("This is the file 'chi'.\n"),
- # 'D/H/omega' : run_and_verify_merge() doesn't support checking
- # the props on a missing path, so we do that
- # manually (see below).
+ 'D/H/omega' : Item("New content"),
'D/H' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
@@ -192,9 +176,7 @@ def mergeinfo_and_skipped_paths(sbox):
})
expected_skip = wc.State(A_COPY_path, {
'B/E' : Item(),
- 'D/H/omega' : Item(),
})
- saved_cwd = os.getcwd()
svntest.actions.run_and_verify_merge(A_COPY_path, '4', '8',
sbox.repo_url + '/A', None,
expected_output,
@@ -206,10 +188,6 @@ def mergeinfo_and_skipped_paths(sbox):
None, None, None, None,
None, 1)
- # Manually check the props on A_COPY/D/H/omega.
- svntest.actions.run_and_verify_svn(None, ['\n'], [],
- 'pg', SVN_PROP_MERGEINFO, omega_path)
-
# Merge r4:8 into the restricted WC's A_COPY_2.
#
# As before we expect A_COPY_2/B/E to be skipped because we can't access the
@@ -273,7 +251,6 @@ def mergeinfo_and_skipped_paths(sbox):
'D/G' : Item(),
'D/H/psi' : Item(),
})
- saved_cwd = os.getcwd()
svntest.actions.run_and_verify_merge(A_COPY_2_path, '4', '8',
sbox.repo_url + '/A', None,
expected_output,
@@ -338,7 +315,6 @@ def mergeinfo_and_skipped_paths(sbox):
'C' : Item(),
})
expected_skip = wc.State(A_COPY_3_path, {'B/E' : Item()})
- saved_cwd = os.getcwd()
svntest.actions.run_and_verify_merge(A_COPY_3_path, '5', '7',
sbox.repo_url + '/A', None,
expected_output,
@@ -378,7 +354,6 @@ def mergeinfo_and_skipped_paths(sbox):
expected_skip = wc.State(A_COPY_2_H_path, {
'psi' : Item(),
})
- saved_cwd = os.getcwd()
# Note we don't bother checking expected mergeinfo output because the
# multiple merges being performed here, -c5 and -c8, will result in
# first ' U' and then ' G' mergeinfo notifications. Our expected
@@ -393,7 +368,8 @@ def mergeinfo_and_skipped_paths(sbox):
expected_status,
expected_skip,
None, None, None, None,
- None, 1, 0, '-c5', '-c8')
+ None, 1, 0, '-c5', '-c8',
+ A_COPY_2_H_path)
# Test issue #2829 'Improve handling for skipped paths encountered
# during a merge'
@@ -441,8 +417,6 @@ def mergeinfo_and_skipped_paths(sbox):
props={SVN_PROP_MERGEINFO : '/A/D/H/zeta:8-9'}),
})
expected_skip = wc.State(A_COPY_2_H_path, {})
- saved_cwd = os.getcwd()
- #raise svntest.Failure("PTB")
svntest.actions.run_and_verify_merge(A_COPY_2_H_path, '7', '9',
sbox.repo_url + '/A/D/H', None,
expected_output,
@@ -641,7 +615,7 @@ def reintegrate_fails_if_no_root_access(
'mu' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_path, {
- '' : Item(status=' G'),
+ '' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
@@ -698,7 +672,7 @@ def reintegrate_fails_if_no_root_access(
expected_skip,
None, None, None, None,
None, True, True,
- '--reintegrate')
+ '--reintegrate', A_path)
########################################################################
# Run the tests