You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2013/01/06 03:33:39 UTC
svn commit: r1429457 [18/21] - in /subversion/branches/tree-read-api: ./
build/ build/ac-macros/ build/generator/templates/ build/win32/
contrib/server-side/svncutter/ doc/ subversion/bindings/cxxhl/include/
subversion/bindings/cxxhl/include/svncxxhl/ ...
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/revert_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/revert_tests.py Sun Jan 6 02:33:34 2013
@@ -788,34 +788,22 @@ def status_of_missing_dir_after_revert(s
svntest.actions.run_and_verify_svn(None, expected_output, [], "revert",
A_D_G_path)
- deletes = [
- "D " + os.path.join(A_D_G_path, "pi") + "\n",
- "D " + os.path.join(A_D_G_path, "rho") + "\n",
- "D " + os.path.join(A_D_G_path, "tau") + "\n"
- ]
- expected_output = svntest.verify.UnorderedOutput(deletes)
- svntest.actions.run_and_verify_svn(None, expected_output, [],
- "status", wc_dir)
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau',
+ status='D ')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
svntest.main.safe_rmtree(A_D_G_path)
-
- expected_output = ["! " + A_D_G_path + "\n"]
-
- if svntest.main.wc_is_singledb(wc_dir):
- expected_output.extend(deletes)
-
- expected_output = svntest.verify.UnorderedOutput(expected_output)
-
- svntest.actions.run_and_verify_svn(None, expected_output, [], "status",
- wc_dir)
+ expected_status.tweak('A/D/G', status='! ')
+
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
# When using single-db, we can get back to the virginal state.
- if svntest.main.wc_is_singledb(wc_dir):
- svntest.actions.run_and_verify_svn(None, None, [], "revert",
- "-R", A_D_G_path)
+ svntest.actions.run_and_verify_svn(None, None, [], "revert",
+ "-R", A_D_G_path)
- expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
#----------------------------------------------------------------------
# Test for issue #2804 with replaced directory
@@ -910,14 +898,10 @@ def status_of_missing_dir_after_revert_r
svntest.main.safe_rmtree(G_path)
- if svntest.main.wc_is_singledb(wc_dir):
- expected_output = svntest.verify.UnorderedOutput(
+ expected_output = svntest.verify.UnorderedOutput(
["! " + G_path + "\n",
"! " + os.path.join(G_path, "alpha") + "\n",
"! " + os.path.join(G_path, "beta") + "\n"])
- else:
- expected_output = svntest.verify.UnorderedOutput(
- ["! " + G_path + "\n"])
svntest.actions.run_and_verify_svn(None, expected_output, [], "status",
wc_dir)
@@ -961,17 +945,17 @@ def revert_tree_conflicts_in_updated_fil
svntest.actions.build_greek_tree_conflicts(sbox)
wc_dir = sbox.wc_dir
G = os.path.join(wc_dir, 'A', 'D', 'G')
- G_pi = os.path.join(G, 'pi');
- G_rho = os.path.join(G, 'rho');
- G_tau = os.path.join(G, 'tau');
+ G_pi = os.path.join(G, 'pi')
+ G_rho = os.path.join(G, 'rho')
+ G_tau = os.path.join(G, 'tau')
# Duplicate wc for tests
wc_dir_2 = sbox.add_wc_path('2')
svntest.actions.duplicate_dir(wc_dir, wc_dir_2)
G2 = os.path.join(wc_dir_2, 'A', 'D', 'G')
- G2_pi = os.path.join(G2, 'pi');
- G2_rho = os.path.join(G2, 'rho');
- G2_tau = os.path.join(G2, 'tau');
+ G2_pi = os.path.join(G2, 'pi')
+ G2_rho = os.path.join(G2, 'rho')
+ G2_tau = os.path.join(G2, 'tau')
# Expectations
expected_output = svntest.verify.UnorderedOutput(
@@ -1159,7 +1143,7 @@ def revert_permissions_only(sbox):
check_executability(path, False)
- os.chmod(sbox.ospath('A/B/E/alpha'), 0444); # read-only
+ os.chmod(sbox.ospath('A/B/E/alpha'), 0444) # read-only
is_readonly(sbox.ospath('A/B/E/alpha'))
expected_output = ["Reverted '%s'\n" % sbox.ospath('A/B/E/alpha')]
svntest.actions.run_and_verify_svn(None, expected_output, [],
@@ -1167,7 +1151,7 @@ def revert_permissions_only(sbox):
is_writable(sbox.ospath('A/B/E/alpha'))
if svntest.main.is_posix_os():
- os.chmod(sbox.ospath('A/B/E/beta'), 0777); # executable
+ os.chmod(sbox.ospath('A/B/E/beta'), 0777) # executable
is_executable(sbox.ospath('A/B/E/beta'))
expected_output = ["Reverted '%s'\n" % sbox.ospath('A/B/E/beta')]
svntest.actions.run_and_verify_svn(None, expected_output, [],
@@ -1193,7 +1177,7 @@ def revert_permissions_only(sbox):
expected_status,
None, wc_dir)
- os.chmod(sbox.ospath('A/B/E/alpha'), 0666); # not read-only
+ os.chmod(sbox.ospath('A/B/E/alpha'), 0666) # not read-only
is_writable(sbox.ospath('A/B/E/alpha'))
expected_output = ["Reverted '%s'\n" % sbox.ospath('A/B/E/alpha')]
svntest.actions.run_and_verify_svn(None, expected_output, [],
@@ -1201,7 +1185,7 @@ def revert_permissions_only(sbox):
is_readonly(sbox.ospath('A/B/E/alpha'))
if svntest.main.is_posix_os():
- os.chmod(sbox.ospath('A/B/E/beta'), 0666); # not executable
+ os.chmod(sbox.ospath('A/B/E/beta'), 0666) # not executable
is_non_executable(sbox.ospath('A/B/E/beta'))
expected_output = ["Reverted '%s'\n" % sbox.ospath('A/B/E/beta')]
svntest.actions.run_and_verify_svn(None, expected_output, [],
@@ -1617,6 +1601,52 @@ def revert_nonexistent(sbox):
svntest.actions.run_and_verify_svn(None, 'Skipped.*nonexistent', [],
'revert', '-R', sbox.ospath('nonexistent'))
+@Issue(4168)
+def revert_obstructing_wc(sbox):
+ "revert with an obstructing working copy"
+
+ sbox.build(create_wc=False, read_only=True)
+ wc_dir = sbox.wc_dir
+
+ expected_output = svntest.wc.State(wc_dir, {})
+ expected_disk = svntest.wc.State(wc_dir, {})
+
+ # Checkout wc as depth empty
+ svntest.actions.run_and_verify_checkout(sbox.repo_url, wc_dir,
+ expected_output, expected_disk,
+ None, None, None, None,
+ '--depth', 'empty')
+
+ # And create an obstructing working copy as A
+ svntest.actions.run_and_verify_checkout(sbox.repo_url, wc_dir + '/A',
+ expected_output, expected_disk,
+ None, None, None, None,
+ '--depth', 'empty')
+
+ # Now try to fetch the entire wc, which will find an obstruction
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A' : Item(verb='Skipped'),
+ 'iota' : Item(status='A '),
+ })
+ expected_status = svntest.wc.State(wc_dir, {
+ '' : Item(status=' ', wc_rev='1'),
+ 'iota' : Item(status=' ', wc_rev='1'),
+ # A is not versioned but exists
+ })
+
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output, None, expected_status,
+ None, None, None,
+ None, None, None,
+ 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
+ # in this specific case, as the node was not modified)
+ svntest.actions.run_and_verify_svn(None, "Skipped '.*A' -- .*obstruct.*", [],
+ 'revert', '-R', wc_dir)
+
+
########################################################################
# Run the tests
@@ -1656,6 +1686,7 @@ test_list = [ None,
revert_no_text_change_conflict_recursive,
revert_with_unversioned_targets,
revert_nonexistent,
+ revert_obstructing_wc
]
if __name__ == '__main__':
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py Sun Jan 6 02:33:34 2013
@@ -302,8 +302,8 @@ def replace_symlink_with_file(sbox):
# Now replace the symlink with a normal file and try to commit, we
# should get an error
- os.remove(newfile_path);
- svntest.main.file_append(newfile_path, "text of actual file");
+ os.remove(newfile_path)
+ svntest.main.file_append(newfile_path, "text of actual file")
# Does status show the obstruction?
was_cwd = os.getcwd()
@@ -589,8 +589,8 @@ def replace_symlink_with_dir(sbox):
# Now replace the symlink with a directory and try to commit, we
# should get an error
- os.remove(from_path);
- os.mkdir(from_path);
+ os.remove(from_path)
+ os.mkdir(from_path)
# Does status show the obstruction?
was_cwd = os.getcwd()
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/stat_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/stat_tests.py Sun Jan 6 02:33:34 2013
@@ -179,7 +179,6 @@ def status_type_change(sbox):
sbox.build(read_only = True)
wc_dir = sbox.wc_dir
- single_db = svntest.main.wc_is_singledb(wc_dir)
os.chdir(wc_dir)
@@ -189,8 +188,7 @@ def status_type_change(sbox):
os.rename('A', 'iota')
os.rename('was_iota', 'A')
- if single_db:
- expected_output = [
+ expected_output = [
'~ A\n',
'! A/mu\n',
'! A/B\n',
@@ -211,14 +209,9 @@ def status_type_change(sbox):
'! A/D/H/omega\n',
'! A/D/H/psi\n',
'~ iota\n',
- ]
+ ]
- expected_output = [s.replace('/', os.path.sep) for s in expected_output]
- else:
- expected_output = [
- '~ A\n',
- '~ iota\n',
- ]
+ expected_output = [s.replace('/', os.path.sep) for s in expected_output]
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
[], 'status')
@@ -228,10 +221,9 @@ def status_type_change(sbox):
os.remove('A')
os.mkdir('A')
- if single_db:
- # A is a directory again, so it is no longer missing, but it's
- # descendants are
- expected_output = [
+ # A is a directory again, so it is no longer missing, but it's
+ # descendants are
+ expected_output = [
'! A/mu\n',
'! A/B\n',
'! A/B/lambda\n',
@@ -251,15 +243,9 @@ def status_type_change(sbox):
'! A/D/H/omega\n',
'! A/D/H/psi\n',
'~ iota\n',
- ]
- # Fix separator for Windows
- expected_output = [s.replace('/', os.path.sep) for s in expected_output]
- else:
- # A misses its administrative area, so it is missing
- expected_output = [
- '~ A\n',
- '~ iota\n',
- ]
+ ]
+ # Fix separator for Windows
+ expected_output = [s.replace('/', os.path.sep) for s in expected_output]
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
[], 'status')
@@ -269,14 +255,6 @@ def status_type_change(sbox):
svntest.main.safe_rmtree('iota')
os.mkdir('iota')
- if not svntest.main.wc_is_singledb('.'):
- # A misses its administrative area, so it is still missing and
- # iota is still obstructed
- expected_output = [
- '~ A\n',
- '~ iota\n',
- ]
-
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
[], 'status')
@@ -287,7 +265,6 @@ def status_type_change_to_symlink(sbox):
sbox.build(read_only = True)
wc_dir = sbox.wc_dir
- single_db = svntest.main.wc_is_singledb(wc_dir)
os.chdir(wc_dir)
@@ -297,8 +274,7 @@ def status_type_change_to_symlink(sbox):
svntest.main.safe_rmtree('A/D')
os.symlink('bar', 'A/D')
- if single_db:
- expected_output = [
+ expected_output = [
'~ A/D\n',
'! A/D/gamma\n',
'! A/D/G\n',
@@ -310,12 +286,7 @@ def status_type_change_to_symlink(sbox):
'! A/D/H/omega\n',
'! A/D/H/psi\n',
'~ iota\n',
- ]
- else:
- expected_output = [
- '~ A/D\n',
- '~ iota\n',
- ]
+ ]
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
[], 'status')
@@ -1011,53 +982,40 @@ def status_missing_dir(sbox):
# ok, blow away the A/D/G directory
svntest.main.safe_rmtree(a_d_g)
- if svntest.main.wc_is_singledb(wc_dir):
- expected = [
+ expected = [
'! A/D/G\n',
'! A/D/G/rho\n',
'! A/D/G/pi\n',
'! A/D/G/tau\n',
- ]
- expected = [ s.replace('A/D/G', a_d_g).replace('/', os.path.sep)
- for s in expected ]
- else:
- expected = ["! " + a_d_g + "\n"]
+ ]
+ expected = [ s.replace('A/D/G', a_d_g).replace('/', os.path.sep)
+ for s in expected ]
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected), [],
"status", wc_dir)
- if svntest.main.wc_is_singledb(wc_dir):
- expected = [
+ expected = [
"! 1 " + a_d_g + "\n",
"! 1 " + os.path.join(a_d_g, "rho") + "\n",
"! 1 " + os.path.join(a_d_g, "pi") + "\n",
"! 1 " + os.path.join(a_d_g, "tau") + "\n",
- "Status against revision: 1\n" ]
- else:
- expected = [
- " * " + os.path.join(a_d_g, "pi") + "\n",
- " * " + os.path.join(a_d_g, "rho") + "\n",
- " * " + os.path.join(a_d_g, "tau") + "\n",
- "! * ? " + a_d_g + "\n",
- " * 1 " + sbox.ospath('A/D') + "\n",
- "Status against revision: 1\n" ]
+ "Status against revision: 1\n"
+ ]
# now run status -u, we should be able to do this without crashing
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected), [],
"status", "-u", wc_dir)
# Finally run an explicit status request directly on the missing directory.
- if svntest.main.wc_is_singledb(wc_dir):
- expected = [
+ expected = [
"! A/D/G\n",
"! A/D/G/rho\n",
"! A/D/G/pi\n",
"! A/D/G/tau\n",
]
- expected = [ s.replace('A/D/G', a_d_g).replace('/', os.path.sep)
- for s in expected ]
- else:
- expected = ["! " + a_d_g + "\n"]
+ expected = [ s.replace('A/D/G', a_d_g).replace('/', os.path.sep)
+ for s in expected ]
+
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected), [],
"status", a_d_g)
@@ -1731,8 +1689,7 @@ def status_dash_u_type_change(sbox):
svntest.main.safe_rmtree('A')
os.mkdir('A')
- if svntest.main.wc_is_singledb('.'):
- output =[
+ output = [
"! 1 A/mu\n",
"! 1 A/B\n",
"! 1 A/B/lambda\n",
@@ -1753,16 +1710,11 @@ def status_dash_u_type_change(sbox):
"! 1 A/D/H/psi\n",
"~ 1 iota\n",
"Status against revision: 1\n"
- ]
+ ]
- expected = svntest.verify.UnorderedOutput(
+ expected = svntest.verify.UnorderedOutput(
[s.replace('/', os.path.sep)
for s in output])
- else:
- expected = svntest.verify.UnorderedOutput(
- ["~ 1 iota\n",
- "~ ? A\n",
- "Status against revision: 1\n" ])
svntest.actions.run_and_verify_svn(None,
expected,
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svnadmin_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svnadmin_tests.py Sun Jan 6 02:33:34 2013
@@ -741,7 +741,7 @@ def recover_fsfs(sbox):
# Move aside the current file for r3.
os.rename(os.path.join(sbox.repo_dir, 'db','current'),
- os.path.join(sbox.repo_dir, 'db','was_current'));
+ os.path.join(sbox.repo_dir, 'db','was_current'))
# Run 'svnadmin recover' and check that the current file is recreated.
exit_code, output, errput = svntest.main.run_svnadmin("recover",
@@ -1817,9 +1817,9 @@ def mergeinfo_race(sbox):
t2 = threading.Thread(None, makethread(wc2_dir))
# t2 will trigger the issue #4129 sanity check in fs_fs.c
- t1.start(); t2.start();
+ t1.start(); t2.start()
- t1.join(); t2.join();
+ t1.join(); t2.join()
# Crude attempt to make sure everything worked.
# TODO: better way to catch exceptions in the thread
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svnlook_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svnlook_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svnlook_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svnlook_tests.py Sun Jan 6 02:33:34 2013
@@ -696,6 +696,7 @@ fp.close()"""
# Now check the logfile
expected_data = [ 'bogus_val\n',
'bogus_rev_val\n',
+ "Properties on '/A':\n",
' bogus_prop\n',
' svn:log\n', ' svn:author\n',
' svn:check-locks\n', # internal prop, not really expected
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py Sun Jan 6 02:33:34 2013
@@ -45,6 +45,7 @@ def reject_bogus_mergeinfo(sbox):
# validate the mergeinfo up front then it will only test the client
svntest.actions.run_and_verify_svnmucc(None, [], expected_error,
'propset', 'svn:mergeinfo', '/B:0',
+ '-m', 'log msg',
sbox.repo_url + '/A')
_svnmucc_re = re.compile('^(r[0-9]+) committed by jrandom at (.*)$')
@@ -111,12 +112,14 @@ def basic_svnmucc(sbox):
test_svnmucc(sbox.repo_url,
['A /foo'
], # ---------
+ '-m', 'log msg',
'mkdir', 'foo')
# revision 3
test_svnmucc(sbox.repo_url,
['A /z.c',
], # ---------
+ '-m', 'log msg',
'put', empty_file, 'z.c')
# revision 4
@@ -124,6 +127,7 @@ def basic_svnmucc(sbox):
['A /foo/z.c (from /z.c:3)',
'A /foo/bar (from /foo:3)',
], # ---------
+ '-m', 'log msg',
'cp', '3', 'z.c', 'foo/z.c',
'cp', '3', 'foo', 'foo/bar')
@@ -134,6 +138,7 @@ def basic_svnmucc(sbox):
'D /foo',
'A /zig/zag (from /foo:4)',
], # ---------
+ '-m', 'log msg',
'cp', '4', 'foo', 'zig',
'rm', 'zig/bar',
'mv', 'foo', 'zig/zag')
@@ -144,6 +149,7 @@ def basic_svnmucc(sbox):
'A /zig/zag/bar/y.c (from /z.c:5)',
'A /zig/zag/bar/x.c (from /z.c:3)',
], # ---------
+ '-m', 'log msg',
'mv', 'z.c', 'zig/zag/bar/y.c',
'cp', '3', 'z.c', 'zig/zag/bar/x.c')
@@ -153,6 +159,7 @@ def basic_svnmucc(sbox):
'A /zig/zag/bar/y y.c (from /zig/zag/bar/y.c:6)',
'A /zig/zag/bar/y%20y.c (from /zig/zag/bar/y.c:6)',
], # ---------
+ '-m', 'log msg',
'mv', 'zig/zag/bar/y.c', 'zig/zag/bar/y%20y.c',
'cp', 'HEAD', 'zig/zag/bar/y.c', 'zig/zag/bar/y%2520y.c')
@@ -163,6 +170,7 @@ def basic_svnmucc(sbox):
'A /zig/zag/bar/z%20z.c (from /zig/zag/bar/y%20y.c:7)',
'A /zig/zag/bar/z z2.c (from /zig/zag/bar/y y.c:7)',
], #---------
+ '-m', 'log msg',
'mv', 'zig/zag/bar/y%20y.c', 'zig/zag/bar/z z1.c',
'cp', 'HEAD', 'zig/zag/bar/y%2520y.c', 'zig/zag/bar/z%2520z.c',
'cp', 'HEAD', 'zig/zag/bar/y y.c', 'zig/zag/bar/z z2.c')
@@ -176,6 +184,7 @@ def basic_svnmucc(sbox):
'D /zig/foo/bar/z z2.c',
'R /zig/foo/bar/z z1.c (from /zig/zag/bar/x.c:6)',
], #---------
+ '-m', 'log msg',
'mv', 'zig/zag', 'zig/foo',
'rm', 'zig/foo/bar/z z1.c',
'rm', 'zig/foo/bar/z%20z2.c',
@@ -186,6 +195,7 @@ def basic_svnmucc(sbox):
test_svnmucc(sbox.repo_url,
['R /zig/foo/bar (from /zig/z.c:9)',
], #---------
+ '-m', 'log msg',
'rm', 'zig/foo/bar',
'cp', '9', 'zig/z.c', 'zig/foo/bar')
@@ -194,6 +204,7 @@ def basic_svnmucc(sbox):
['R /zig/foo/bar (from /zig/foo/bar:9)',
'D /zig/foo/bar/z z1.c',
], #---------
+ '-m', 'log msg',
'rm', 'zig/foo/bar',
'cp', '9', 'zig/foo/bar', 'zig/foo/bar',
'rm', 'zig/foo/bar/z%20z1.c')
@@ -202,6 +213,7 @@ def basic_svnmucc(sbox):
test_svnmucc(sbox.repo_url,
['R /zig/foo (from /zig/foo/bar:11)',
], #---------
+ '-m', 'log msg',
'rm', 'zig/foo',
'cp', 'head', 'zig/foo/bar', 'zig/foo')
@@ -214,6 +226,7 @@ def basic_svnmucc(sbox):
'D /foo/foo/bar',
'R /foo/foo/foo/bar (from /foo:4)',
], #---------
+ '-m', 'log msg',
'rm', 'zig',
'cp', '4', 'foo', 'foo',
'cp', '4', 'foo', 'foo/foo',
@@ -228,6 +241,7 @@ def basic_svnmucc(sbox):
'A /boozle/buz',
'A /boozle/buz/nuz',
], #---------
+ '-m', 'log msg',
'cp', '4', 'foo', 'boozle',
'mkdir', 'boozle/buz',
'mkdir', 'boozle/buz/nuz')
@@ -238,6 +252,7 @@ def basic_svnmucc(sbox):
'A /boozle/guz (from /boozle/buz:14)',
'A /boozle/guz/svnmucc-test.py',
], #---------
+ '-m', 'log msg',
'put', empty_file, 'boozle/buz/svnmucc-test.py',
'cp', '14', 'boozle/buz', 'boozle/guz',
'put', empty_file, 'boozle/guz/svnmucc-test.py')
@@ -247,20 +262,25 @@ def basic_svnmucc(sbox):
['M /boozle/buz/svnmucc-test.py',
'R /boozle/guz/svnmucc-test.py',
], #---------
+ '-m', 'log msg',
'put', empty_file, 'boozle/buz/svnmucc-test.py',
'rm', 'boozle/guz/svnmucc-test.py',
'put', empty_file, 'boozle/guz/svnmucc-test.py')
# revision 17
test_svnmucc(sbox.repo_url,
- ['R /foo/bar (from /foo/foo:16)'], #---------
+ ['R /foo/bar (from /foo/foo:16)'
+ ], #---------
+ '-m', 'log msg',
'rm', 'foo/bar',
'cp', '16', 'foo/foo', 'foo/bar',
'propset', 'testprop', 'true', 'foo/bar')
# revision 18
test_svnmucc(sbox.repo_url,
- ['M /foo/bar'], #---------
+ ['M /foo/bar'
+ ], #---------
+ '-m', 'log msg',
'propdel', 'testprop', 'foo/bar')
# revision 19
@@ -268,6 +288,7 @@ def basic_svnmucc(sbox):
['M /foo/z.c',
'M /foo/foo',
], #---------
+ '-m', 'log msg',
'propset', 'testprop', 'true', 'foo/z.c',
'propset', 'testprop', 'true', 'foo/foo')
@@ -276,6 +297,7 @@ def basic_svnmucc(sbox):
['M /foo/z.c',
'M /foo/foo',
], #---------
+ '-m', 'log msg',
'propsetf', 'testprop', empty_file, 'foo/z.c',
'propsetf', 'testprop', empty_file, 'foo/foo')
@@ -283,6 +305,7 @@ def basic_svnmucc(sbox):
xtest_svnmucc(sbox.repo_url,
["svnmucc: E200004: 'a' is not a revision"
], #---------
+ '-m', 'log msg',
'cp', 'a', 'b')
# Expected cannot be younger error
@@ -290,18 +313,21 @@ def basic_svnmucc(sbox):
['svnmucc: E205000: Copy source revision cannot be younger ' +
'than base revision',
], #---------
+ '-m', 'log msg',
'cp', '42', 'a', 'b')
# Expected already exists error
xtest_svnmucc(sbox.repo_url,
["svnmucc: E125002: 'foo' already exists",
], #---------
+ '-m', 'log msg',
'cp', '17', 'a', 'foo')
# Expected copy_src already exists error
xtest_svnmucc(sbox.repo_url,
["svnmucc: E125002: 'a/bar' (from 'foo/bar:17') already exists",
], #---------
+ '-m', 'log msg',
'cp', '17', 'foo', 'a',
'cp', '17', 'foo/foo', 'a/bar')
@@ -309,12 +335,14 @@ def basic_svnmucc(sbox):
xtest_svnmucc(sbox.repo_url,
["svnmucc: E125002: 'a' not found",
], #---------
+ '-m', 'log msg',
'cp', '17', 'a', 'b')
def propset_root_internal(sbox, target):
## propset on ^/
svntest.actions.run_and_verify_svnmucc(None, None, [],
+ '-m', 'log msg',
'propset', 'foo', 'bar',
target)
svntest.actions.run_and_verify_svn(None, 'bar', [],
@@ -323,6 +351,7 @@ def propset_root_internal(sbox, target):
## propdel on ^/
svntest.actions.run_and_verify_svnmucc(None, None, [],
+ '-m', 'log msg',
'propdel', 'foo',
target)
svntest.actions.run_and_verify_svn(None, [], [],
@@ -338,12 +367,58 @@ def propset_root(sbox):
propset_root_internal(sbox, sbox.repo_url + '/iota')
+def too_many_log_messages(sbox):
+ "test log message mutual exclusivity checks"
+
+ sbox.build() # would use read-only=True, but need a place to stuff msg_file
+ msg_file = sbox.ospath('svnmucc_msg')
+ svntest.main.file_append(msg_file, 'some log message')
+ err_msg = ["svnmucc: E205000: --message (-m), --file (-F), and "
+ "--with-revprop=svn:log are mutually exclusive"]
+
+ xtest_svnmucc(sbox.repo_url, err_msg,
+ '--non-interactive',
+ '-m', 'log msg',
+ '-F', msg_file,
+ 'mkdir', 'A/subdir')
+ xtest_svnmucc(sbox.repo_url, err_msg,
+ '--non-interactive',
+ '-m', 'log msg',
+ '--with-revprop', 'svn:log=proppy log message',
+ 'mkdir', 'A/subdir')
+ xtest_svnmucc(sbox.repo_url, err_msg,
+ '--non-interactive',
+ '-F', msg_file,
+ '--with-revprop', 'svn:log=proppy log message',
+ 'mkdir', 'A/subdir')
+ xtest_svnmucc(sbox.repo_url, err_msg,
+ '--non-interactive',
+ '-m', 'log msg',
+ '-F', msg_file,
+ '--with-revprop', 'svn:log=proppy log message',
+ 'mkdir', 'A/subdir')
+
+@Issues(3418)
+def no_log_msg_non_interactive(sbox):
+ "test non-interactive without a log message"
+
+ sbox.build(create_wc=False)
+ xtest_svnmucc(sbox.repo_url,
+ ["svnmucc: E205001: Cannot invoke editor to get log message "
+ "when non-interactive"
+ ], #---------
+ '--non-interactive',
+ 'mkdir', 'A/subdir')
+
+
######################################################################
test_list = [ None,
reject_bogus_mergeinfo,
basic_svnmucc,
propset_root,
+ too_many_log_messages,
+ no_log_msg_non_interactive,
]
if __name__ == '__main__':
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svnrdump_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svnrdump_tests.py Sun Jan 6 02:33:34 2013
@@ -94,11 +94,13 @@ def compare_repos_dumps(svnrdump_sbox, s
def run_dump_test(sbox, dumpfile_name, expected_dumpfile_name = None,
subdir = None, bypass_prop_validation = False,
- ignore_base_checksums = False):
+ ignore_base_checksums = False, extra_options = []):
+
"""Load a dumpfile using 'svnadmin load', dump it with 'svnrdump
dump' and check that the same dumpfile is produced or that
expected_dumpfile_name is produced if provided. Additionally, the
- subdir argument appends itself to the URL"""
+ subdir argument appends itself to the URL. EXTRA_OPTIONS is an
+ array of optional additional options to pass to 'svnrdump dump'."""
# Create an empty sandbox repository
build_repos(sbox)
@@ -121,10 +123,10 @@ def run_dump_test(sbox, dumpfile_name, e
repo_url = repo_url + subdir
# Create a dump file using svnrdump
+ opts = extra_options + ['-q', 'dump', repo_url]
svnrdump_dumpfile = \
svntest.actions.run_and_verify_svnrdump(None, svntest.verify.AnyOutput,
- [], 0, '-q', 'dump',
- repo_url)
+ [], 0, *opts)
if expected_dumpfile_name:
svnadmin_dumpfile = open(os.path.join(svnrdump_tests_dir,
@@ -335,7 +337,7 @@ def copy_revprops_load(sbox):
def only_trunk_dump(sbox):
"dump: subdirectory"
run_dump_test(sbox, "trunk-only.dump", subdir="/trunk",
- expected_dumpfile_name="trunk-only.expected.dump",)
+ expected_dumpfile_name="trunk-only.expected.dump")
def only_trunk_A_with_changes_dump(sbox):
"dump: subdirectory with changes on root"
@@ -356,6 +358,12 @@ def copy_bad_line_endings_dump(sbox):
expected_dumpfile_name="copy-bad-line-endings.expected.dump",
bypass_prop_validation=True)
+@Issue(4263)
+def copy_bad_line_endings_load(sbox):
+ "load: inconsistent line endings in svn:* props"
+ run_load_test(sbox, "copy-bad-line-endings.dump",
+ expected_dumpfile_name="copy-bad-line-endings.expected.dump")
+
def copy_bad_line_endings2_dump(sbox):
"dump: non-LF line endings in svn:* props"
run_dump_test(sbox, "copy-bad-line-endings2.dump",
@@ -731,7 +739,34 @@ def svnrdump_load_partial_incremental_du
svntest.verify.AnyOutput,
[], 0, 'load', sbox.repo_url)
- ########################################################################
+
+#----------------------------------------------------------------------
+@Issue(4101)
+def range_dump(sbox):
+ "dump: using -rX:Y"
+ run_dump_test(sbox, "trunk-only.dump",
+ expected_dumpfile_name="root-range.expected.dump",
+ extra_options=['-r2:HEAD'])
+
+@Issue(4101)
+def only_trunk_range_dump(sbox):
+ "dump: subdirectory using -rX:Y"
+ run_dump_test(sbox, "trunk-only.dump", subdir="/trunk",
+ expected_dumpfile_name="trunk-only-range.expected.dump",
+ extra_options=['-r1:HEAD'])
+
+@Issue(4101)
+def only_trunk_A_range_dump(sbox):
+ "dump: deeper subdirectory using -rX:Y"
+ run_dump_test(sbox, "trunk-only.dump", subdir="/trunk/A",
+ expected_dumpfile_name="trunk-A-range.expected.dump",
+ extra_options=['-r2:HEAD'])
+
+
+#----------------------------------------------------------------------
+
+
+########################################################################
# Run the tests
@@ -771,6 +806,7 @@ test_list = [ None,
move_and_modify_in_the_same_revision_dump,
move_and_modify_in_the_same_revision_load,
copy_bad_line_endings_dump,
+ copy_bad_line_endings_load,
copy_bad_line_endings2_dump,
commit_a_copy_of_root_dump,
commit_a_copy_of_root_load,
@@ -781,6 +817,9 @@ test_list = [ None,
reflect_dropped_renumbered_revs,
dont_drop_valid_mergeinfo_during_incremental_svnrdump_loads,
svnrdump_load_partial_incremental_dump,
+ range_dump,
+ only_trunk_range_dump,
+ only_trunk_A_range_dump,
]
if __name__ == '__main__':
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svnserveautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svnserveautocheck.sh?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svnserveautocheck.sh (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svnserveautocheck.sh Sun Jan 6 02:33:34 2013
@@ -21,16 +21,16 @@
#
# -*- mode: shell-script; -*-
-# This script simplifies the preparation of the environment for a Subversion client
-# communicating with an svnserve server.
+# This script simplifies the preparation of the environment for a Subversion
+# client communicating with an svnserve server.
#
-# The script runs svnserve, runs "make check", and kills the svnserve afterwards.
-# It makes sure to kill the svnserve even if the test run dies.
+# The script runs svnserve, runs "make check", and kills the svnserve
+# afterwards. It makes sure to kill the svnserve even if the test run dies.
#
# This script should be run from the top level of the Subversion
-# distribution; it's easiest to just run it as "make
-# svnserveautocheck". Like "make check", you can specify further options
-# like "make svnserveautocheck FS_TYPE=bdb TESTS=subversion/tests/cmdline/basic.py".
+# distribution; it's easiest to just run it as "make svnserveautocheck".
+# Like "make check", you can specify further options like
+# "make svnserveautocheck FS_TYPE=bdb TESTS=subversion/tests/cmdline/basic.py".
PYTHON=${PYTHON:-python}
@@ -80,8 +80,6 @@ fi
# for it and "make check-clean".
SVNSERVE_PID=$ABS_BUILDDIR/subversion/tests/svnserveautocheck.pid
-export LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
-
SERVER_CMD="$ABS_BUILDDIR/subversion/svnserve/svnserve"
rm -f $SVNSERVE_PID
@@ -94,6 +92,12 @@ random_port() {
fi
}
+if type time > /dev/null; then
+ TIME_CMD=time
+else
+ TIME_CMD=""
+fi
+
SVNSERVE_PORT=$(random_port)
while netstat -an | grep $SVNSERVE_PORT | grep 'LISTEN'; do
SVNSERVE_PORT=$(random_port)
@@ -115,13 +119,13 @@ fi
BASE_URL=svn://127.0.0.1:$SVNSERVE_PORT
if [ $# = 0 ]; then
- time make check "BASE_URL=$BASE_URL"
+ $TIME_CMD make check "BASE_URL=$BASE_URL"
r=$?
else
cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
TEST="$1"
shift
- time "./${TEST}_tests.py" "--url=$BASE_URL" $*
+ $TIME_CMD "./${TEST}_tests.py" "--url=$BASE_URL" $*
r=$?
cd - > /dev/null
fi
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py Sun Jan 6 02:33:34 2013
@@ -651,13 +651,6 @@ def _with_auth(args):
else:
return args + ('--username', wc_author )
-def _with_log_message(args):
-
- if '-m' in args or '--message' in args or '-F' in args:
- return args
- else:
- return args + ('--message', 'default log message')
-
# For running subversion and returning the output
def run_svn(error_expected, *varargs):
"""Run svn with VARARGS; return exit code as int; stdout, stderr as
@@ -705,7 +698,7 @@ def run_svnmucc(*varargs):
"""Run svnmucc with VARARGS, returns exit code as int; stdout, stderr as
list of lines (including line terminators). Use binary mode for output."""
return run_command(svnmucc_binary, 1, 1,
- *(_with_auth(_with_config_dir(_with_log_message(varargs)))))
+ *(_with_auth(_with_config_dir(varargs))))
def run_entriesdump(path):
"""Run the entries-dump helper, returning a dict of Entry objects."""
@@ -1234,6 +1227,17 @@ def server_enforces_date_syntax():
def server_has_atomic_revprop():
return options.server_minor_version >= 7
+def is_plaintext_password_storage_disabled():
+ try:
+ predicate = re.compile("^WARNING: Plaintext password storage is enabled!")
+ code, out, err = run_svn(False, "--version")
+ for line in out:
+ if predicate.match(line):
+ return False
+ except:
+ return False
+ return True
+
######################################################################
@@ -1296,13 +1300,6 @@ class TestSpawningThread(threading.Threa
*args)
self.results.append((index, result, stdout_lines, stderr_lines))
- if result != 1:
- sys.stdout.write('.')
- else:
- sys.stdout.write('F')
-
- sys.stdout.flush()
-
class TestRunner:
"""Encapsulate a single test case (predicate), including logic for
runing the test and test list output."""
@@ -1542,9 +1539,6 @@ def _internal_run_tests(test_list, testn
results += t.results
results.sort()
- # terminate the line of dots
- print("")
-
# all tests are finished, find out the result and print the logs.
for (index, result, stdout_lines, stderr_lines) in results:
if stdout_lines:
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py Sun Jan 6 02:33:34 2013
@@ -94,7 +94,7 @@ _re_parse_status = re.compile('^([?!MACD
'((?P<wc_rev>\d+|-|\?) +(\d|-|\?)+ +(\S+) +)?'
'(?P<path>.+)$')
-_re_parse_skipped = re.compile("^Skipped[^']* '(.+)'( --.*)?\n")
+_re_parse_skipped = re.compile("^(Skipped[^']*) '(.+)'( --.*)?\n")
_re_parse_summarize = re.compile("^([MAD ][M ]) (.+)\n")
@@ -444,7 +444,8 @@ class State:
match = _re_parse_skipped.search(line)
if match:
- desc[to_relpath(match.group(1))] = StateItem()
+ desc[to_relpath(match.group(2))] = StateItem(
+ verb=(match.group(1).strip(':')))
return cls('', desc)
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/switch_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/switch_tests.py Sun Jan 6 02:33:34 2013
@@ -2328,10 +2328,9 @@ def tree_conflicts_on_switch_1_1(sbox):
})
expected_disk = disk_empty_dirs.copy()
- if svntest.main.wc_is_singledb(sbox.wc_dir):
- expected_disk.remove('D/D1', 'DF/D1', 'DD/D1', 'DD/D1/D2',
- 'DDF/D1', 'DDF/D1/D2',
- 'DDD/D1', 'DDD/D1/D2', 'DDD/D1/D2/D3')
+ expected_disk.remove('D/D1', 'DF/D1', 'DD/D1', 'DD/D1/D2',
+ 'DDF/D1', 'DDF/D1/D2',
+ 'DDD/D1', 'DDD/D1/D2', 'DDD/D1/D2/D3')
# The files delta, epsilon, and zeta are incoming additions, but since
# they are all within locally deleted trees they should also be schedule
@@ -2441,10 +2440,9 @@ def tree_conflicts_on_switch_1_2(sbox):
expected_disk.remove('D/D1',
'DD/D1/D2',
'DDD/D1/D2/D3')
- if svntest.main.wc_is_singledb(sbox.wc_dir):
- expected_disk.remove('DF/D1', 'DD/D1',
- 'DDF/D1', 'DDF/D1/D2',
- 'DDD/D1', 'DDD/D1/D2')
+ expected_disk.remove('DF/D1', 'DD/D1',
+ 'DDF/D1', 'DDF/D1/D2',
+ 'DDD/D1', 'DDD/D1/D2')
expected_info = {
'F/alpha' : {
@@ -2785,7 +2783,7 @@ def copy_with_switched_subdir(sbox):
'--ignore-ancestry', E_url, G)
state.tweak('A/D/G', switched='S')
- state.remove('A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau');
+ state.remove('A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau')
state.add({
'A/D/G/alpha' : Item(status=' ', wc_rev=1),
'A/D/G/beta' : Item(status=' ', wc_rev=1),
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/update_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/update_tests.py Sun Jan 6 02:33:34 2013
@@ -417,10 +417,7 @@ def update_missing(sbox):
svntest.main.safe_rmtree(H_path)
# In single-db mode all missing items will just be restored
- if svntest.main.wc_is_singledb(wc_dir):
- A_or_Restored = Item(verb='Restored')
- else:
- A_or_Restored = Item(status='A ')
+ A_or_Restored = Item(verb='Restored')
# Create expected output tree for an update of the missing items by name
expected_output = svntest.wc.State(wc_dir, {
@@ -1172,15 +1169,14 @@ def update_deleted_missing_dir(sbox):
})
# In single-db mode the missing items are restored before the update
- if svntest.main.wc_is_singledb(wc_dir):
- expected_output.add({
+ expected_output.add({
'A/D/H/psi' : Item(verb='Restored'),
'A/D/H/omega' : Item(verb='Restored'),
'A/D/H/chi' : Item(verb='Restored'),
'A/B/E/beta' : Item(verb='Restored'),
'A/B/E/alpha' : Item(verb='Restored')
# A/B/E and A/D/H are also restored, but are then overriden by the delete
- })
+ })
# Create expected disk tree for the update.
expected_disk = svntest.main.greek_state.copy()
@@ -1260,20 +1256,14 @@ def another_hudson_problem(sbox):
# Update missing directory to receive the delete, this should mark G
# as 'deleted' and should not alter gamma's entry.
- if not svntest.main.wc_is_singledb(wc_dir):
- expected_output = ["Updating '%s' ...\n" % (G_path),
- 'D '+G_path+'\n',
- 'Updated to revision 3.\n',
- ]
- else:
- expected_output = ["Updating '%s':\n" % (G_path),
- 'Restored \'' + G_path + '\'\n',
- 'Restored \'' + G_path + os.path.sep + 'pi\'\n',
- 'Restored \'' + G_path + os.path.sep + 'rho\'\n',
- 'Restored \'' + G_path + os.path.sep + 'tau\'\n',
- 'D '+G_path+'\n',
- 'Updated to revision 3.\n',
- ]
+ expected_output = ["Updating '%s':\n" % (G_path),
+ 'Restored \'' + G_path + '\'\n',
+ 'Restored \'' + G_path + os.path.sep + 'pi\'\n',
+ 'Restored \'' + G_path + os.path.sep + 'rho\'\n',
+ 'Restored \'' + G_path + os.path.sep + 'tau\'\n',
+ 'D '+G_path+'\n',
+ 'Updated to revision 3.\n',
+ ]
# Sigh, I can't get run_and_verify_update to work (but not because
# of issue 919 as far as I can tell)
@@ -1675,105 +1665,7 @@ def update_to_future_add(sbox):
expected_disk,
None, None,
None, None, None, None, 0,
- A_path);
-
-#----------------------------------------------------------------------
-
-def nested_in_read_only(sbox):
- "update a nested wc in a read-only wc"
-
- sbox.build()
- wc_dir = sbox.wc_dir
-
- if svntest.main.wc_is_singledb(wc_dir):
- raise svntest.Skip('Unsupported in single-db')
-
- # Delete/commit a file
- alpha_path = sbox.ospath('A/B/E/alpha')
- svntest.actions.run_and_verify_svn(None, None, [], 'rm', alpha_path)
-
- expected_output = svntest.wc.State(wc_dir, {
- 'A/B/E/alpha' : Item(verb='Deleting'),
- })
-
- expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- expected_status.remove('A/B/E/alpha')
-
- svntest.actions.run_and_verify_commit(wc_dir, expected_output,
- expected_status, None, wc_dir)
-
- svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
-
- expected_status.tweak(wc_rev=2)
-
- svntest.actions.run_and_verify_status(wc_dir, expected_status)
-
- # Delete/commit a directory that used to contain the deleted file
- B_path = sbox.ospath('A/B')
- svntest.actions.run_and_verify_svn(None, None, [], 'rm', B_path)
-
- expected_output = svntest.wc.State(wc_dir, {
- 'A/B' : Item(verb='Deleting'),
- })
-
- expected_status.remove('A/B', 'A/B/lambda', 'A/B/E', 'A/B/E/beta', 'A/B/F')
-
- svntest.actions.run_and_verify_commit(wc_dir, expected_output,
- expected_status, None, wc_dir)
-
- svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
-
- expected_status.tweak(wc_rev=3)
-
- svntest.actions.run_and_verify_status(wc_dir, expected_status)
-
- # Replace the deleted directory with a new checkout of an old
- # version of the directory, this gives it a "plausible" URL that
- # could be part of the containing wc
- B_url = sbox.repo_url + '/A/B'
- svntest.actions.run_and_verify_svn(None, None, [],
- 'checkout', '-r', '1', B_url + "@1",
- B_path)
-
- expected_status = svntest.wc.State(B_path, {
- '' : Item(),
- 'lambda' : Item(),
- 'E' : Item(),
- 'E/alpha' : Item(),
- 'E/beta' : Item(),
- 'F' : Item(),
- })
- expected_status.tweak(wc_rev=1, status=' ')
-
- svntest.actions.run_and_verify_status(B_path, expected_status)
-
- # Make enclosing wc read only
- os.chmod(os.path.join(wc_dir, 'A', svntest.main.get_admin_name()), 0555)
-
- try:
- # Update of nested wc should still work
- expected_output = svntest.wc.State(B_path, {
- 'E/alpha' : Item(status='D '),
- })
-
- expected_disk = wc.State('', {
- 'lambda' : wc.StateItem("This is the file 'lambda'.\n"),
- 'E' : wc.StateItem(),
- 'E/beta' : wc.StateItem("This is the file 'beta'.\n"),
- 'F' : wc.StateItem(),
- })
-
- expected_status.remove('E/alpha')
- expected_status.tweak(wc_rev=2)
-
- svntest.actions.run_and_verify_update(B_path,
- expected_output,
- expected_disk,
- expected_status,
- None, None, None, None, None, 0,
- '-r', '2', B_path)
- finally:
- os.chmod(os.path.join(wc_dir, 'A', svntest.main.get_admin_name()), 0777)
+ A_path)
#----------------------------------------------------------------------
@@ -3966,6 +3858,7 @@ def update_accept_conflicts(sbox):
% (pi_path_backup)],
"system(.*) returned.*", 0,
'update', '--accept=edit',
+ '--force-interactive',
pi_path_backup)
# rho: --accept=launch
@@ -3978,6 +3871,7 @@ def update_accept_conflicts(sbox):
' Text conflicts: 1\n'],
[],
'update', '--accept=launch',
+ '--force-interactive',
rho_path_backup)
# Set the expected disk contents for the test
@@ -4108,7 +4002,8 @@ interactive-conflicts = true
svntest.actions.run_and_verify_update(wc_dir, None, None, None,
"Can't read stdin: End of file found",
None, None, None, None, 1,
- wc_dir, '--config-dir', config_dir)
+ wc_dir, '--force-interactive',
+ '--config-dir', config_dir)
# Now update -r1 again. Hopefully we don't get a checksum error!
expected_output = svntest.wc.State(wc_dir, {
@@ -4328,10 +4223,9 @@ def tree_conflicts_on_update_1_1(sbox):
})
expected_disk = disk_empty_dirs.copy()
- if svntest.main.wc_is_singledb(sbox.wc_dir):
- expected_disk.remove('D/D1', 'DF/D1', 'DD/D1', 'DD/D1/D2',
- 'DDF/D1', 'DDF/D1/D2',
- 'DDD/D1', 'DDD/D1/D2', 'DDD/D1/D2/D3')
+ expected_disk.remove('D/D1', 'DF/D1', 'DD/D1', 'DD/D1/D2',
+ 'DDF/D1', 'DDF/D1/D2',
+ 'DDD/D1', 'DDD/D1/D2', 'DDD/D1/D2/D3')
# The files delta, epsilon, and zeta are incoming additions, but since
# they are all within locally deleted trees they should also be schedule
@@ -4438,11 +4332,10 @@ def tree_conflicts_on_update_1_2(sbox):
### Why does the deep trees state not include files?
expected_disk.remove('D/D1',
'DD/D1/D2',
- 'DDD/D1/D2/D3')
- if svntest.main.wc_is_singledb(sbox.wc_dir):
- expected_disk.remove('DF/D1', 'DD/D1',
- 'DDF/D1', 'DDF/D1/D2',
- 'DDD/D1', 'DDD/D1/D2')
+ 'DDD/D1/D2/D3',
+ 'DF/D1', 'DD/D1',
+ 'DDF/D1', 'DDF/D1/D2',
+ 'DDD/D1', 'DDD/D1/D2')
expected_info = {
'F/alpha' : {
@@ -5650,7 +5543,6 @@ def update_moved_dir_file_add(sbox):
None, None, None,
None, None, 1)
-@XFail()
def update_moved_dir_dir_add(sbox):
"update locally moved dir with incoming dir"
sbox.build()
@@ -5669,8 +5561,9 @@ def update_moved_dir_dir_add(sbox):
# the incoming file should auto-merge
expected_output = svntest.wc.State(wc_dir, {
- 'A/B/E2/foo' : Item(status='A '),
- 'A/B/E2/foo/bar' : Item(status='A '),
+ 'A/B/E' : Item(status=' ', treeconflict='C'),
+ 'A/B/E/foo' : Item(status=' ', treeconflict='A'),
+ 'A/B/E/foo/bar' : Item(status=' ', treeconflict='A'),
})
expected_disk = svntest.main.greek_state.copy()
expected_disk.remove('A/B/E/alpha', 'A/B/E/beta', 'A/B/E')
@@ -5678,19 +5571,16 @@ def update_moved_dir_dir_add(sbox):
'A/B/E2' : Item(),
'A/B/E2/alpha' : Item(contents="This is the file 'alpha'.\n"),
'A/B/E2/beta' : Item(contents="This is the file 'beta'.\n"),
- 'A/B/E2/foo' : Item(),
- 'A/B/E2/foo/bar' : Item(contents=bar_content),
})
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
expected_status.tweak('A/B/E', 'A/B/E/alpha', 'A/B/E/beta', status='D ')
+ expected_status.tweak('A/B/E', treeconflict='C')
expected_status.add({
'A/B/E/foo' : Item(status='D ', wc_rev='2'),
'A/B/E/foo/bar' : Item(status='D ', wc_rev='2'),
'A/B/E2' : Item(status='A ', copied='+', wc_rev='-'),
'A/B/E2/beta' : Item(status=' ', copied='+', wc_rev='-'),
'A/B/E2/alpha' : Item(status=' ', copied='+', wc_rev='-'),
- 'A/B/E2/foo' : Item(status='A ', copied='+', wc_rev='-'),
- 'A/B/E2/foo/bar' : Item(status='A ', copied='+', wc_rev='-'),
})
svntest.actions.run_and_verify_update(wc_dir,
expected_output,
@@ -5698,6 +5588,16 @@ def update_moved_dir_dir_add(sbox):
expected_status,
None, None, None,
None, None, 1)
+ svntest.actions.run_and_verify_svn("resolve failed", None, [],
+ 'resolve',
+ '--recursive',
+ '--accept=mine-conflict', wc_dir)
+ expected_status.tweak(treeconflict=None)
+ expected_status.add({
+ 'A/B/E2/foo' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/E2/foo/bar' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
@XFail()
@Issue(4037)
@@ -5926,7 +5826,6 @@ test_list = [ None,
update_deletion_inside_out,
update_schedule_add_dir,
update_to_future_add,
- nested_in_read_only,
obstructed_update_alters_wc_props,
update_xml_unsafe_dir,
conflict_markers_matching_eol,
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/upgrade_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/upgrade_tests.py Sun Jan 6 02:33:34 2013
@@ -1143,18 +1143,21 @@ def upgrade_file_externals(sbox):
expected_output = svntest.verify.RegexOutput('r2 committed.*')
svntest.actions.run_and_verify_svnmucc(None, expected_output, [],
+ '-m', 'r2',
'propset', 'svn:externals',
'^/A/B/E EX\n^/A/mu muX',
sbox.repo_url + '/A/B/F')
expected_output = svntest.verify.RegexOutput('r3 committed.*')
svntest.actions.run_and_verify_svnmucc(None, expected_output, [],
+ '-m', 'r3',
'propset', 'svn:externals',
'^/A/B/F FX\n^/A/B/lambda lambdaX',
sbox.repo_url + '/A/C')
expected_output = svntest.verify.RegexOutput('r4 committed.*')
svntest.actions.run_and_verify_svnmucc(None, expected_output, [],
+ '-m', 'r4',
'propset', 'pname1', 'pvalue1',
sbox.repo_url + '/A/mu',
'propset', 'pname2', 'pvalue2',
Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/wc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/wc_tests.py?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/wc_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/wc_tests.py Sun Jan 6 02:33:34 2013
@@ -25,6 +25,7 @@
######################################################################
# General modules
+from __future__ import with_statement
import shutil, stat, re, os, logging
logger = logging.getLogger()
@@ -117,6 +118,78 @@ def add_with_symlink_in_path(sbox):
sbox.simple_append('A/B/kappa', 'xyz', True)
sbox.simple_add('Z/B/kappa')
+@Issue(4118)
+@SkipUnless(svntest.main.is_posix_os)
+def status_with_inaccessible_wc_db(sbox):
+ """inaccessible .svn/wc.db"""
+
+ sbox.build(read_only = True)
+ os.chmod(sbox.ospath(".svn/wc.db"), 0)
+ svntest.actions.run_and_verify_svn(
+ "Status when wc.db is not accessible", None,
+ r"[^ ]+ E155016: The working copy database at '.*' is corrupt",
+ "st", sbox.wc_dir)
+
+@Issue(4118)
+def status_with_corrupt_wc_db(sbox):
+ """corrupt .svn/wc.db"""
+
+ sbox.build(read_only = True)
+ with open(sbox.ospath(".svn/wc.db"), 'wb') as fd:
+ fd.write('\0' * 17)
+ svntest.actions.run_and_verify_svn(
+ "Status when wc.db is corrupt", None,
+ r"[^ ]+ E155016: The working copy database at '.*' is corrupt",
+ "st", sbox.wc_dir)
+
+@Issue(4118)
+def status_with_zero_length_wc_db(sbox):
+ """zero-length .svn/wc.db"""
+
+ sbox.build(read_only = True)
+ os.close(os.open(sbox.ospath(".svn/wc.db"), os.O_RDWR | os.O_TRUNC))
+ svntest.actions.run_and_verify_svn(
+ "Status when wc.db has zero length", None,
+ r"[^ ]+ E200030:", # SVN_ERR_SQLITE_ERROR
+ "st", sbox.wc_dir)
+
+@Issue(4118)
+def status_without_wc_db(sbox):
+ """missing .svn/wc.db"""
+
+ sbox.build(read_only = True)
+ os.remove(sbox.ospath(".svn/wc.db"))
+ svntest.actions.run_and_verify_svn(
+ "Status when wc.db is missing", None,
+ r"[^ ]+ E155016: The working copy database at '.*' is missing",
+ "st", sbox.wc_dir)
+
+@Issue(4118)
+@Skip() # FIXME: Test fails in-tree because it finds the source WC root
+def status_without_wc_db_and_entries(sbox):
+ """missing .svn/wc.db and .svn/entries"""
+
+ sbox.build(read_only = True)
+ os.remove(sbox.ospath(".svn/wc.db"))
+ os.remove(sbox.ospath(".svn/entries"))
+ svntest.actions.run_and_verify_svn2(
+ "Status when wc.db and entries are missing", None,
+ r"[^ ]+ warning: W155007: '.*' is not a working copy",
+ 0, "st", sbox.wc_dir)
+
+@Issue(4118)
+def status_with_missing_wc_db_and_maybe_valid_entries(sbox):
+ """missing .svn/wc.db, maybe valid .svn/entries"""
+
+ sbox.build(read_only = True)
+ with open(sbox.ospath(".svn/entries"), 'ab') as fd:
+ fd.write('something\n')
+ os.remove(sbox.ospath(".svn/wc.db"))
+ svntest.actions.run_and_verify_svn(
+ "Status when wc.db is missing and .svn/entries might be valid", None,
+ r"[^ ]+ E155036:", # SVN_ERR_WC_UPGRADE_REQUIRED
+ "st", sbox.wc_dir)
+
########################################################################
# Run the tests
@@ -129,6 +202,12 @@ test_list = [ None,
add_through_unversioned_symlink,
add_through_versioned_symlink,
add_with_symlink_in_path,
+ status_with_inaccessible_wc_db,
+ status_with_corrupt_wc_db,
+ status_with_zero_length_wc_db,
+ status_without_wc_db,
+ status_without_wc_db_and_entries,
+ status_with_missing_wc_db_and_maybe_valid_entries,
]
if __name__ == '__main__':
Modified: subversion/branches/tree-read-api/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/branches/tree-read-api/subversion/tests/libsvn_diff/diff-diff3-test.c Sun Jan 6 02:33:34 2013
@@ -2394,37 +2394,225 @@ merge_adjacent_changes(apr_pool_t *pool)
return SVN_NO_ERROR;
}
-/* Issue #4133, '"diff -x -w" showing wrong change'.
+/* Issue #4133, 'When sequences of whitespace characters at head of line
+ strides chunk boundary, "diff -x -w" showing wrong change'.
The magic number used in this test, 1<<17, is
CHUNK_SIZE from ../../libsvn_diff/diff_file.c
*/
static svn_error_t *
-test_wrap(apr_pool_t *pool)
+test_norm_offset(apr_pool_t *pool)
{
- char ldata[(1<<17) + 4+4+3+1];
- char rdata[(1<<17) + 4+3+3+1];
- svn_string_t left, right;
+ apr_size_t chunk_size = 1 << 17;
+ const char *pattern1 = " \n";
+ const char *pattern2 = "\n\n\n\n\n\n\n\n";
+ const char *pattern3 = " @@@@@@@\n";
+ const char *pattern4 = " \n";
+ svn_stringbuf_t *original, *modified;
svn_diff_file_options_t *diff_opts = svn_diff_file_options_create(pool);
- diff_opts->ignore_space = svn_diff_file_ignore_space_change;
- /* Two long lines. */
- memset(ldata, '@', 1<<17);
- memset(rdata, '@', 1<<17);
- strcpy(&ldata[1<<17], "foo\n" "ba \n" "x \n");
- strcpy(&rdata[1<<17], "foo\n" "ba\n" "x\t\n");
-
- /* Cast them to svn_string_t. */
- left.data = ldata;
- right.data = rdata;
- left.len = sizeof(ldata)-1;
- right.len = sizeof(rdata)-1;
+ /* The original contents become like this
+
+ $ hexdump -C norm-offset-original
+ 00000000 20 20 20 20 20 20 20 0a 0a 0a 0a 0a 0a 0a 0a 0a | .........|
+ 00000010 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
+ *
+ 0001fff0 0a 0a 0a 0a 0a 0a 0a 0a 20 20 20 20 20 20 20 20 |........ |
+ 00020000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
+ 00020010 40 40 40 40 40 40 40 0a 0a 0a 0a 0a 0a 0a 0a 0a |@@@@@@@.........|
+ 00020020 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
+ *
+ 000203f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a | .|
+ 00020400
+ */
+ original = svn_stringbuf_create_ensure(chunk_size + 1024, pool);
+ svn_stringbuf_appendcstr(original, pattern1);
+ while (original->len < chunk_size - 8)
+ {
+ svn_stringbuf_appendcstr(original, pattern2);
+ }
+ svn_stringbuf_appendcstr(original, pattern3);
+ while (original->len < chunk_size +1024 - 16)
+ {
+ svn_stringbuf_appendcstr(original, pattern2);
+ }
+ svn_stringbuf_appendcstr(original, pattern4);
+
+ /* The modified contents become like this.
+
+ $ hexdump -C norm-offset-modified
+ 00000000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a | .|
+ 00000010 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
+ *
+ 00020000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
+ 00020010 20 20 20 20 20 20 20 20 40 40 40 40 40 40 40 0a | @@@@@@@.|
+ 00020020 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
+ *
+ 000203f0 0a 0a 0a 0a 0a 0a 0a 0a 20 20 20 20 20 20 20 0a |........ .|
+ 00020400
+ */
+ modified = svn_stringbuf_create_ensure(chunk_size + 1024, pool);
+ svn_stringbuf_appendcstr(modified, pattern4);
+ while (modified->len < chunk_size)
+ {
+ svn_stringbuf_appendcstr(modified, pattern2);
+ }
+ svn_stringbuf_appendcstr(modified, pattern3);
+ while (modified->len < chunk_size +1024 - 8)
+ {
+ svn_stringbuf_appendcstr(modified, pattern2);
+ }
+ svn_stringbuf_appendcstr(modified, pattern1);
/* Diff them. Modulo whitespace, they are identical. */
- {
- svn_diff_t *diff;
- SVN_ERR(svn_diff_mem_string_diff(&diff, &left, &right, diff_opts, pool));
- SVN_TEST_ASSERT(FALSE == svn_diff_contains_diffs(diff));
- }
+ diff_opts->ignore_space = svn_diff_file_ignore_space_all;
+ SVN_ERR(two_way_diff("norm-offset-original", "norm-offset-modified",
+ original->data, modified->data, "",
+ diff_opts, pool));
+
+ return SVN_NO_ERROR;
+}
+
+/* Issue #4283, 'When identical suffix started at a chunk boundary,
+ incorrect diff was generated'.
+ The magic number used in this test, (1<<17) and 50 are CHUNK_SIZE
+ and SUFFIX_LINES_TO_KEEP from ../../libsvn_diff/diff_file.c, respectively.
+ */
+#define ORIGINAL_CONTENTS_PATTERN "0123456789abcde\n"
+#define INSERTED_LINE "0123456789ABCDE\n"
+static svn_error_t *
+test_identical_suffix(apr_pool_t *pool)
+{
+ apr_size_t lines_in_chunk = (1 << 17)
+ / (sizeof(ORIGINAL_CONTENTS_PATTERN) - 1);
+ /* To let identical suffix start at a chunk boundary,
+ insert a line at before (SUFFIX_LINES_TO_KEEP + 1) lines
+ from tail of the previous chunk. */
+ apr_size_t insert_pos = lines_in_chunk
+#ifdef SUFFIX_LINES_TO_KEEP
+ - SUFFIX_LINES_TO_KEEP
+#else
+ - 50
+#endif
+ - 1;
+ apr_size_t i;
+ svn_stringbuf_t *original, *modified;
+
+ /* The original contents become like this.
+
+ $ hexdump -C identical-suffix-original
+ 00000000 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 0a |0123456789abcde.|
+ *
+ 00020400
+ */
+ original = svn_stringbuf_create_ensure((1 << 17) + 1024, pool);
+ for (i = 0; i < lines_in_chunk + 64; i++)
+ {
+ svn_stringbuf_appendbytes(original, ORIGINAL_CONTENTS_PATTERN,
+ sizeof(ORIGINAL_CONTENTS_PATTERN) - 1);
+ }
+
+ /* The modified contents become like this.
+
+ $ hexdump -C identical-suffix-modified
+ 00000000 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 0a |0123456789abcde.|
+ *
+ 00000400 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 0a |0123456789ABCDE.|
+ 00000410 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 0a |0123456789abcde.|
+ *
+ 0001fcd0 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 0a |0123456789ABCDE.|
+ 0001fce0 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 0a |0123456789abcde.|
+ *
+ 00020420
+ */
+ modified = svn_stringbuf_dup(original, pool);
+ svn_stringbuf_insert(modified,
+ 64 * (sizeof(ORIGINAL_CONTENTS_PATTERN) - 1),
+ INSERTED_LINE, sizeof(INSERTED_LINE) - 1);
+ svn_stringbuf_insert(modified,
+ insert_pos * (sizeof(ORIGINAL_CONTENTS_PATTERN) - 1),
+ INSERTED_LINE, sizeof(INSERTED_LINE) - 1);
+
+ SVN_ERR(two_way_diff("identical-suffix-original",
+ "identical-suffix-modified",
+ original->data, modified->data,
+ apr_psprintf(pool,
+ "--- identical-suffix-original" NL
+ "+++ identical-suffix-modified" NL
+ "@@ -62,6 +62,7 @@" NL
+ " " ORIGINAL_CONTENTS_PATTERN
+ " " ORIGINAL_CONTENTS_PATTERN
+ " " ORIGINAL_CONTENTS_PATTERN
+ "+" INSERTED_LINE
+ " " ORIGINAL_CONTENTS_PATTERN
+ " " ORIGINAL_CONTENTS_PATTERN
+ " " ORIGINAL_CONTENTS_PATTERN
+ "@@ -%u,6 +%u,7 @@" NL
+ " " ORIGINAL_CONTENTS_PATTERN
+ " " ORIGINAL_CONTENTS_PATTERN
+ " " ORIGINAL_CONTENTS_PATTERN
+ "+" INSERTED_LINE
+ " " ORIGINAL_CONTENTS_PATTERN
+ " " ORIGINAL_CONTENTS_PATTERN
+ " " ORIGINAL_CONTENTS_PATTERN,
+ 1 + (unsigned int)insert_pos - 3 - 1,
+ 1 + (unsigned int)insert_pos - 3),
+ NULL, pool));
+
+ return SVN_NO_ERROR;
+}
+#undef ORIGINAL_CONTENTS_PATTERN
+#undef INSERTED_LINE
+
+/* The magic number used in this test, 1<<17, is
+ CHUNK_SIZE from ../../libsvn_diff/diff_file.c
+ */
+static svn_error_t *
+test_token_compare(apr_pool_t *pool)
+{
+ apr_size_t chunk_size = 1 << 17;
+ const char *pattern = "\n\n\n\n\n\n\n\n";
+ svn_stringbuf_t *original, *modified;
+ svn_diff_file_options_t *diff_opts = svn_diff_file_options_create(pool);
+
+ diff_opts->ignore_space = svn_diff_file_ignore_space_all;
+
+ original = svn_stringbuf_create_ensure(chunk_size, pool);
+ while (original->len < chunk_size - 8)
+ {
+ svn_stringbuf_appendcstr(original, pattern);
+ }
+ svn_stringbuf_appendcstr(original, " @@@\n");
+
+ modified = svn_stringbuf_create_ensure(chunk_size, pool);
+ while (modified->len < chunk_size - 8)
+ {
+ svn_stringbuf_appendcstr(modified, pattern);
+ }
+ svn_stringbuf_appendcstr(modified, " @@@\n");
+
+ /* regression test for reading exceeding the file size */
+ SVN_ERR(two_way_diff("token-compare-original1", "token-compare-modified1",
+ original->data, modified->data, "",
+ diff_opts, pool));
+
+ svn_stringbuf_appendcstr(original, "aaaaaaa\n");
+ svn_stringbuf_appendcstr(modified, "bbbbbbb\n");
+
+ /* regression test for comparison beyond the end-of-line */
+ SVN_ERR(two_way_diff("token-compare-original2", "token-compare-modified2",
+ original->data, modified->data,
+ apr_psprintf(pool,
+ "--- token-compare-original2" NL
+ "+++ token-compare-modified2" NL
+ "@@ -%u,4 +%u,4 @@" NL
+ " \n"
+ " \n"
+ " @@@\n"
+ "-aaaaaaa\n"
+ "+bbbbbbb\n",
+ 1 +(unsigned int)chunk_size - 8 + 1 - 3,
+ 1 +(unsigned int)chunk_size - 8 + 1 - 3),
+ diff_opts, pool));
return SVN_NO_ERROR;
}
@@ -2458,7 +2646,11 @@ struct svn_test_descriptor_t test_funcs[
"3-way merge with conflict styles"),
SVN_TEST_PASS2(test_diff4,
"4-way merge; see variance-adjusted-patching.html"),
- SVN_TEST_XFAIL2(test_wrap,
- "difference at the start of a 128KB window"),
+ SVN_TEST_PASS2(test_norm_offset,
+ "offset of the normalized token"),
+ SVN_TEST_PASS2(test_identical_suffix,
+ "identical suffix starts at the boundary of a chunk"),
+ SVN_TEST_PASS2(test_token_compare,
+ "compare tokes at the chunk boundary"),
SVN_TEST_NULL
};
Modified: subversion/branches/tree-read-api/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/libsvn_fs/fs-test.c?rev=1429457&r1=1429456&r2=1429457&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/tree-read-api/subversion/tests/libsvn_fs/fs-test.c Sun Jan 6 02:33:34 2013
@@ -1566,6 +1566,7 @@ merging_commit(const svn_test_opts_t *op
/* (5) E doesn't exist in ANCESTOR, and has been added to A. */
{
+ svn_revnum_t failed_rev;
/* (1) E doesn't exist in ANCESTOR, and has been added to B.
Conflict. */
SVN_ERR(svn_fs_begin_txn(&txn, fs, revisions[4], pool));
@@ -1573,7 +1574,7 @@ merging_commit(const svn_test_opts_t *op
SVN_ERR(svn_fs_make_file(txn_root, "theta", pool));
SVN_ERR(svn_test__set_file_contents
(txn_root, "theta", "This is another file 'theta'.\n", pool));
- SVN_ERR(test_commit_txn(&after_rev, txn, "/theta", pool));
+ SVN_ERR(test_commit_txn(&failed_rev, txn, "/theta", pool));
SVN_ERR(svn_fs_abort_txn(txn, pool));
/* (1) E exists in ANCESTOR, but has been deleted from B. Can't
@@ -1581,6 +1582,8 @@ merging_commit(const svn_test_opts_t *op
/* (3) E exists in both ANCESTOR and B. Can't occur, by assumption
that E doesn't exist in ANCESTOR. */
+
+ SVN_TEST_ASSERT(failed_rev == SVN_INVALID_REVNUM);
}
/* (4) E exists in ANCESTOR, but has been deleted from A */
@@ -1594,15 +1597,16 @@ merging_commit(const svn_test_opts_t *op
SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
SVN_ERR(svn_fs_delete(txn_root, "A/D/H", pool));
- /* ### FIXME: It is at this point that our test stops being valid,
- ### hence its expected failure. The following call will now
- ### conflict on /A/D/H, causing revision 6 *not* to be created,
- ### and the remainer of this test (which was written long ago)
- ### to suffer from a shift in the expected state and behavior
- ### of the filesystem as a result of this commit not happening.
- */
+ /* We used to create the revision like this before fixing issue
+ #2751 -- Directory prop mods reverted in overlapping commits scenario.
- SVN_ERR(test_commit_txn(&after_rev, txn, NULL, pool));
+ But we now expect that to fail as out of date */
+ {
+ svn_revnum_t failed_rev;
+ SVN_ERR(test_commit_txn(&failed_rev, txn, "/A/D/H", pool));
+
+ SVN_TEST_ASSERT(failed_rev == SVN_INVALID_REVNUM);
+ }
/*********************************************************************/
/* REVISION 6 */
/*********************************************************************/
@@ -1640,18 +1644,22 @@ merging_commit(const svn_test_opts_t *op
/* Try deleting a file F inside a subtree S where S does not exist
in the most recent revision, but does exist in the ancestor
tree. This should conflict. */
- SVN_ERR(svn_fs_begin_txn(&txn, fs, revisions[1], pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
- SVN_ERR(svn_fs_delete(txn_root, "A/D/H/omega", pool));
- SVN_ERR(test_commit_txn(&after_rev, txn, "/A/D/H", pool));
- SVN_ERR(svn_fs_abort_txn(txn, pool));
+ {
+ svn_revnum_t failed_rev;
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, revisions[1], pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_delete(txn_root, "A/D/H/omega", pool));
+ SVN_ERR(test_commit_txn(&failed_rev, txn, "/A/D/H", pool));
+ SVN_ERR(svn_fs_abort_txn(txn, pool));
+
+ SVN_TEST_ASSERT(failed_rev == SVN_INVALID_REVNUM);
+ }
/* E exists in both ANCESTOR and B ... */
{
/* (1) but refers to different nodes. Conflict. */
- SVN_ERR(svn_fs_begin_txn(&txn, fs, revisions[1], pool));
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, after_rev, pool));
SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
- SVN_ERR(svn_fs_delete(txn_root, "A/D/H", pool));
SVN_ERR(svn_fs_make_dir(txn_root, "A/D/H", pool));
SVN_ERR(test_commit_txn(&after_rev, txn, NULL, pool));
revisions[revision_count++] = after_rev;
@@ -4969,10 +4977,7 @@ struct svn_test_descriptor_t test_funcs[
"basic commit"),
SVN_TEST_OPTS_PASS(test_tree_node_validation,
"testing tree validation helper"),
- SVN_TEST_OPTS_WIMP(merging_commit,
- "merging commit",
- "needs to be written to match new"
- " merge() algorithm expectations"),
+ SVN_TEST_OPTS_PASS(merging_commit, "merging commit"),
SVN_TEST_OPTS_PASS(copy_test,
"copying and tracking copy history"),
SVN_TEST_OPTS_PASS(commit_date,
Propchange: subversion/branches/tree-read-api/subversion/tests/libsvn_ra/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jan 6 02:33:34 2013
@@ -0,0 +1,4 @@
+*.lo
+.libs
+ra-test
+test-repo-*