You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/12/31 21:35:20 UTC
svn commit: r1427238 [2/2] - in /subversion/branches/ev2-export: ./
build/generator/templates/ subversion/bindings/cxxhl/include/svncxxhl/
subversion/bindings/cxxhl/src/ subversion/bindings/cxxhl/tests/
subversion/include/ subversion/libsvn_client/ sub...
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py Mon Dec 31 20:35:19 2012
@@ -1735,8 +1735,6 @@ def merge_into_missing(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- single_db = svntest.main.wc_is_singledb(wc_dir)
-
F_path = sbox.ospath('A/B/F')
F_url = sbox.repo_url + '/A/B/F'
Q_path = os.path.join(F_path, 'Q')
@@ -1798,23 +1796,17 @@ def merge_into_missing(sbox):
expected_status = wc.State(F_path, {
'' : Item(status=' ', wc_rev=1),
'foo' : Item(status='! ', wc_rev=2),
- 'Q' : Item(status='! ', wc_rev='?'),
- })
+ 'Q' : Item(status='! ', wc_rev=2),
+ # Missing data still available
+ 'Q/R' : Item(status='! ', wc_rev=3),
+ 'Q/R/bar' : Item(status='! ', wc_rev=3),
+ 'Q/baz' : Item(status='! ', wc_rev=3),
+ })
expected_skip = wc.State(F_path, {
'Q' : Item(),
'foo' : Item(),
})
- if single_db:
- # Revision not lost
- expected_status.tweak('Q', wc_rev=2)
- # Missing data still available
- expected_status.add({
- 'Q/R' : Item(status='! ', wc_rev='3'),
- 'Q/R/bar' : Item(status='! ', wc_rev='3'),
- 'Q/baz' : Item(status='! ', wc_rev='3'),
- })
-
# Use --ignore-ancestry because merge tracking aware merges raise an
# error when the merge target is missing subtrees due to OS-level
# deletes.
@@ -1837,20 +1829,15 @@ def merge_into_missing(sbox):
expected_status = wc.State(F_path, {
'' : Item(status=' ', wc_rev=1),
'foo' : Item(status='! ', wc_rev=2),
- 'Q' : Item(status='! ', wc_rev='?'),
- })
- expected_mergeinfo_output = wc.State(F_path, {
- })
-
- if single_db:
+ 'Q' : Item(status='! ', entry_rev='?', wc_rev='2'),
# Revision is known and we can record mergeinfo
- expected_status.tweak('Q', wc_rev='2', entry_rev='?')
- expected_status.add({
- 'Q/R' : Item(status='! ', wc_rev='3'),
- 'Q/R/bar' : Item(status='! ', wc_rev='3'),
- 'Q/baz' : Item(status='! ', wc_rev='3'),
+ 'Q/R' : Item(status='! ', wc_rev='3'),
+ 'Q/R/bar' : Item(status='! ', wc_rev='3'),
+ 'Q/baz' : Item(status='! ', wc_rev='3'),
+ })
+ expected_mergeinfo_output = wc.State(F_path, {
})
-
+
svntest.actions.run_and_verify_merge(F_path, '1', '2', F_url, None,
expected_output,
expected_mergeinfo_output,
@@ -1879,18 +1866,11 @@ def merge_into_missing(sbox):
expected_status.add({
'A/B/F' : Item(status=' ', wc_rev=1),
'A/B/F/foo' : Item(status='! ', wc_rev=2),
- 'A/B/F/Q' : Item(status='! ', wc_rev='?'),
- })
- if single_db:
- # Revision known and mergeinfo recorded
- expected_status.tweak('A/B/F/Q', wc_rev='2')
- # Missing data still available
- expected_status.add({
- 'A/B/F/Q' : Item(status='! ', wc_rev='2'),
- 'A/B/F/Q/baz' : Item(status='! ', wc_rev='3'),
- 'A/B/F/Q/R' : Item(status='! ', wc_rev='3'),
- 'A/B/F/Q/R/bar' : Item(status='! ', wc_rev='3'),
- })
+ 'A/B/F/Q' : Item(status='! ', wc_rev=2),
+ 'A/B/F/Q/baz' : Item(status='! ', wc_rev='3'),
+ 'A/B/F/Q/R' : Item(status='! ', wc_rev='3'),
+ 'A/B/F/Q/R/bar' : Item(status='! ', wc_rev='3'),
+ })
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@@ -4941,56 +4921,54 @@ def mergeinfo_inheritance(sbox):
# In single-db mode you can't create a disconnected working copy by just
# copying a subdir
- if svntest.main.wc_is_singledb(wc_dir):
- return
- # Copy the subtree A_COPY/B/E from the working copy, making the
- # disconnected WC E_only.
- other_wc = sbox.add_wc_path('E_only')
- svntest.actions.duplicate_dir(E_COPY_path, other_wc)
-
- # Update the disconnected WC it so it will get the most recent mergeinfo
- # from the repos when merging.
- svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [], 'up',
- other_wc)
-
- # Merge r5:4 into the root of the disconnected WC.
- # E_only has no explicit mergeinfo and since it's the root of the WC
- # cannot inherit any mergeinfo from a working copy ancestor path. Nor
- # does it have any mergeinfo explicitly set on it in the repository.
- # An ancestor path on the repository side, A_COPY/B does have the merge
- # info '/A/B:5' however and E_only should inherit this, resulting in
- # empty mergeinfo after the removal of r5 (A_COPY has mergeinfo of
- # '/A:3' so this empty mergeinfo is needed to override that.
- expected_output = wc.State(other_wc,
- {'beta' : Item(status='U ')})
- expected_mergeinfo_output = wc.State(other_wc, {
- '' : Item(status=' G')
- })
- expected_elision_output = wc.State(other_wc, {
- })
- expected_status = wc.State(other_wc, {
- '' : Item(status=' M', wc_rev=7),
- 'alpha' : Item(status=' ', wc_rev=7),
- 'beta' : Item(status='M ', wc_rev=7),
- })
- expected_disk = wc.State('', {
- '' : Item(props={SVN_PROP_MERGEINFO : ''}),
- 'alpha' : Item("This is the file 'alpha'.\n"),
- 'beta' : Item("This is the file 'beta'.\n"),
- })
- expected_skip = wc.State(other_wc, { })
-
- svntest.actions.run_and_verify_merge(other_wc, '5', '4',
- sbox.repo_url + '/A/B/E', None,
- expected_output,
- expected_mergeinfo_output,
- expected_elision_output,
- expected_disk,
- expected_status,
- expected_skip,
- None, None, None, None,
- None, 1)
+ ## Copy the subtree A_COPY/B/E from the working copy, making the
+ ## disconnected WC E_only.
+ #other_wc = sbox.add_wc_path('E_only')
+ #svntest.actions.duplicate_dir(E_COPY_path, other_wc)
+ #
+ ## Update the disconnected WC it so it will get the most recent mergeinfo
+ ## from the repos when merging.
+ #svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [], 'up',
+ # other_wc)
+ #
+ ## Merge r5:4 into the root of the disconnected WC.
+ ## E_only has no explicit mergeinfo and since it's the root of the WC
+ ## cannot inherit any mergeinfo from a working copy ancestor path. Nor
+ ## does it have any mergeinfo explicitly set on it in the repository.
+ ## An ancestor path on the repository side, A_COPY/B does have the merge
+ ## info '/A/B:5' however and E_only should inherit this, resulting in
+ ## empty mergeinfo after the removal of r5 (A_COPY has mergeinfo of
+ ## '/A:3' so this empty mergeinfo is needed to override that.
+ #expected_output = wc.State(other_wc,
+ # {'beta' : Item(status='U ')})
+ #expected_mergeinfo_output = wc.State(other_wc, {
+ # '' : Item(status=' G')
+ # })
+ #expected_elision_output = wc.State(other_wc, {
+ # })
+ #expected_status = wc.State(other_wc, {
+ # '' : Item(status=' M', wc_rev=7),
+ # 'alpha' : Item(status=' ', wc_rev=7),
+ # 'beta' : Item(status='M ', wc_rev=7),
+ # })
+ #expected_disk = wc.State('', {
+ # '' : Item(props={SVN_PROP_MERGEINFO : ''}),
+ # 'alpha' : Item("This is the file 'alpha'.\n"),
+ # 'beta' : Item("This is the file 'beta'.\n"),
+ # })
+ #expected_skip = wc.State(other_wc, { })
+ #
+ #svntest.actions.run_and_verify_merge(other_wc, '5', '4',
+ # sbox.repo_url + '/A/B/E', None,
+ # expected_output,
+ # expected_mergeinfo_output,
+ # expected_elision_output,
+ # expected_disk,
+ # expected_status,
+ # expected_skip,
+ # None, None, None, None,
+ # None, 1)
#----------------------------------------------------------------------
@SkipUnless(server_has_mergeinfo)
@@ -6964,9 +6942,7 @@ def merge_loses_mergeinfo(sbox):
expected_elision_output = wc.State(A_C_wc_dir, {
'' : Item(status=' U'),
})
- expected_disk = wc.State('', {'J': Item()})
- if svntest.main.wc_is_singledb(wc_dir):
- expected_disk.remove('J')
+ expected_disk = wc.State('', {})
expected_status = wc.State(A_C_wc_dir,
{ '' : Item(wc_rev=4, status=' M'),
'J' : Item(wc_rev=4, status='D ')
@@ -6985,11 +6961,8 @@ def merge_loses_mergeinfo(sbox):
expected_output = wc.State(A_C_wc_dir, {'K' : Item(status='A ')})
expected_disk = wc.State('', {
'K' : Item(),
- 'J' : Item(),
'' : Item(props={SVN_PROP_MERGEINFO : '/A/B:3'}),
})
- if svntest.main.wc_is_singledb(wc_dir):
- expected_disk.remove('J')
expected_status = wc.State(A_C_wc_dir,
{ '' : Item(wc_rev=4, status=' M'),
'K' : Item(status='A ',
@@ -7652,7 +7625,7 @@ def merge_away_subtrees_noninheritable_r
None, None, None, None, None, 1, 1,
'--depth', 'empty', H_COPY_2_path)
svntest.actions.run_and_verify_svn(None, None, [], 'commit', '-m',
- 'log msg', wc_dir);
+ 'log msg', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
# Now reverse the prior merge. Issue #3392 manifests itself here with
# a mergeinfo parsing error:
@@ -14018,7 +13991,6 @@ def no_self_referential_filtering_on_add
'/A_COPY/C:8\n' +
'/A_COPY/C_MOVED:8',
'propname' : 'propval'}),
- 'C' : Item(),
'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
@@ -14030,8 +14002,6 @@ def no_self_referential_filtering_on_add
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
- if svntest.main.wc_is_singledb(wc_dir):
- expected_A_COPY_2_disk.remove('C')
expected_A_COPY_2_skip = wc.State(A_COPY_2_path, { })
svntest.actions.run_and_verify_merge(A_COPY_2_path, None, None,
sbox.repo_url + '/A', None,
@@ -14846,7 +14816,7 @@ def noop_file_merge(sbox):
[], 'merge', '-c5', sbox.repo_url + '/A', A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'commit', '-m',
'Merge r5 from A to A_COPY',
- wc_dir);
+ wc_dir)
# Update working copy to allow full inheritance and elision.
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
@@ -15595,14 +15565,13 @@ def committed_case_only_move_and_revert(
})
expected_disk.tweak('', props={SVN_PROP_MERGEINFO : '/A:3,5'})
expected_disk.add({'c' : Item()})
- if svntest.main.wc_is_singledb(wc_dir):
- expected_disk.remove('C')
+ expected_disk.remove('C')
expected_status.tweak('MU', status=' ', wc_rev=4, copied=None)
expected_status.remove('mu')
expected_status.tweak('C', status='D ')
expected_status.tweak('', wc_rev=4)
expected_status.add({'c' : Item(status='A ', copied='+', wc_rev='-')})
- # This merge succeeds, but A_COPY/c is in a strange state, added with
+ # This merge succeeds. It used to leave a strange state, added with
# history but missing:
#
# M merge_tests-139\A_COPY
@@ -15738,7 +15707,7 @@ def foreign_repos_del_and_props(sbox):
wc_dir = sbox.wc_dir
wc2_dir = sbox.add_wc_path('wc2')
- (r2_path, r2_url) = sbox.add_repo_path('fgn');
+ (r2_path, r2_url) = sbox.add_repo_path('fgn')
svntest.main.create_repos(r2_path)
svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
@@ -16139,7 +16108,7 @@ def merge_into_locally_added_file(sbox):
shutil.copy(pi_path, new_path)
svntest.main.file_append(pi_path, "foo\n")
- sbox.simple_commit(); # r2
+ sbox.simple_commit() # r2
sbox.simple_add('A/D/G/new')
@@ -16184,7 +16153,7 @@ def merge_into_locally_added_directory(s
new_dir_path = sbox.ospath("A/D/new_dir")
svntest.main.file_append_binary(pi_path, "foo\n")
- sbox.simple_commit(); # r2
+ sbox.simple_commit() # r2
os.mkdir(new_dir_path)
svntest.main.file_append_binary(os.path.join(new_dir_path, 'pi'),
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_tree_conflict_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_tree_conflict_tests.py Mon Dec 31 20:35:19 2012
@@ -625,7 +625,6 @@ def mergeinfo_recording_in_skipped_merge
'B' : Item(),
'B/lambda' : Item(contents="This is the file 'lambda'.\n"),
'B/F' : Item(),
- 'B/E' : Item(),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
@@ -636,9 +635,6 @@ def mergeinfo_recording_in_skipped_merge
'D/H/omega': Item("This is the file 'omega'.\n"),
'D/H/psi' : Item("This is the file 'psi'.\n"),
})
- if svntest.main.wc_is_singledb(sbox.wc_dir):
- # Delete removes directories in single-db
- expected_disk.remove('B/E')
expected_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_COPY_path, None, None,
A_url, None,
@@ -1299,35 +1295,22 @@ def tree_conflicts_merge_edit_onto_missi
'F' : Item(status=' ', wc_rev=3),
'F/alpha' : Item(status='! ', wc_rev=3),
'D' : Item(status=' ', wc_rev=3),
- 'D/D1' : Item(status='! ', wc_rev='?'),
+ 'D/D1' : Item(status='! ', wc_rev='3', entry_rev='?'),
'DF' : Item(status=' ', wc_rev=3),
- 'DF/D1' : Item(status='! ', wc_rev='?'),
- 'DF/D1/beta' : Item(status=' '),
+ 'DF/D1' : Item(status='! ', wc_rev=3, entry_rev='?'),
+ 'DF/D1/beta' : Item(status='! ', wc_rev=3),
'DD' : Item(status=' ', wc_rev=3),
- 'DD/D1' : Item(status='! ', wc_rev='?'),
- 'DD/D1/D2' : Item(status=' '),
+ 'DD/D1' : Item(status='! ', wc_rev=3, entry_rev='?'),
+ 'DD/D1/D2' : Item(status='! ', wc_rev=3),
'DDF' : Item(status=' ', wc_rev=3),
- 'DDF/D1' : Item(status='! ', wc_rev='?'),
- 'DDF/D1/D2' : Item(status=' '),
- 'DDF/D1/D2/gamma' : Item(status=' '),
+ 'DDF/D1' : Item(status='! ', wc_rev=3, entry_rev='?'),
+ 'DDF/D1/D2' : Item(status='! ', wc_rev=3),
+ 'DDF/D1/D2/gamma' : Item(status='! ', wc_rev=3),
'DDD' : Item(status=' ', wc_rev=3),
- 'DDD/D1' : Item(status='! ', wc_rev='?'),
- 'DDD/D1/D2' : Item(status=' '),
- 'DDD/D1/D2/D3' : Item(status=' '),
- })
-
- if svntest.main.wc_is_singledb(sbox.wc_dir):
- expected_status.tweak('D/D1', wc_rev=3, entry_rev='?')
- expected_status.tweak('DF/D1', wc_rev=3, entry_rev='?')
- expected_status.tweak('DF/D1/beta', wc_rev=3, status='! ')
- expected_status.tweak('DD/D1', wc_rev=3, entry_rev='?')
- expected_status.tweak('DD/D1/D2', wc_rev=3, status='! ')
- expected_status.tweak('DDF/D1', wc_rev=3, entry_rev='?')
- expected_status.tweak('DDF/D1/D2', wc_rev=3, status='! ')
- expected_status.tweak('DDF/D1/D2/gamma', wc_rev=3, status='! ')
- expected_status.tweak('DDD/D1', wc_rev=3, entry_rev='?')
- expected_status.tweak('DDD/D1/D2', wc_rev=3, status='! ')
- expected_status.tweak('DDD/D1/D2/D3', wc_rev=3, status='! ')
+ 'DDD/D1' : Item(status='! ', wc_rev=3, entry_rev='?'),
+ 'DDD/D1/D2' : Item(status='! ', wc_rev=3),
+ 'DDD/D1/D2/D3' : Item(status='! ', wc_rev=3),
+ })
expected_skip = svntest.wc.State('', {
'F/alpha' : Item(),
@@ -1384,35 +1367,22 @@ def tree_conflicts_merge_del_onto_missin
'F' : Item(status=' ', wc_rev=3),
'F/alpha' : Item(status='! ', wc_rev=3),
'D' : Item(status=' ', wc_rev=3),
- 'D/D1' : Item(status='! ', wc_rev='?'),
+ 'D/D1' : Item(status='! ', wc_rev=3),
'DF' : Item(status=' ', wc_rev=3),
- 'DF/D1' : Item(status='! ', wc_rev='?'),
- 'DF/D1/beta' : Item(status=' '),
+ 'DF/D1' : Item(status='! ', wc_rev=3),
+ 'DF/D1/beta' : Item(status='! ', wc_rev=3),
'DD' : Item(status=' ', wc_rev=3),
- 'DD/D1' : Item(status='! ', wc_rev='?'),
- 'DD/D1/D2' : Item(status=' '),
+ 'DD/D1' : Item(status='! ', wc_rev=3),
+ 'DD/D1/D2' : Item(status='! ', wc_rev=3),
'DDF' : Item(status=' ', wc_rev=3),
- 'DDF/D1' : Item(status='! ', wc_rev='?'),
- 'DDF/D1/D2' : Item(status=' '),
- 'DDF/D1/D2/gamma' : Item(status=' '),
+ 'DDF/D1' : Item(status='! ', wc_rev=3),
+ 'DDF/D1/D2' : Item(status='! ', wc_rev=3),
+ 'DDF/D1/D2/gamma' : Item(status='! ', wc_rev=3),
'DDD' : Item(status=' ', wc_rev=3),
- 'DDD/D1' : Item(status='! ', wc_rev='?'),
- 'DDD/D1/D2' : Item(status=' '),
- 'DDD/D1/D2/D3' : Item(status=' '),
- })
-
- if svntest.main.wc_is_singledb(sbox.wc_dir):
- expected_status.tweak('D/D1', wc_rev=3)
- expected_status.tweak('DF/D1', wc_rev=3)
- expected_status.tweak('DF/D1/beta', wc_rev=3, status='! ')
- expected_status.tweak('DD/D1', wc_rev=3)
- expected_status.tweak('DD/D1/D2', wc_rev=3, status='! ')
- expected_status.tweak('DDF/D1', wc_rev=3)
- expected_status.tweak('DDF/D1/D2', wc_rev=3, status='! ')
- expected_status.tweak('DDF/D1/D2/gamma', wc_rev=3, status='! ')
- expected_status.tweak('DDD/D1', wc_rev=3)
- expected_status.tweak('DDD/D1/D2', wc_rev=3, status='! ')
- expected_status.tweak('DDD/D1/D2/D3', wc_rev=3, status='! ')
+ 'DDD/D1' : Item(status='! ', wc_rev=3),
+ 'DDD/D1/D2' : Item(status='! ', wc_rev=3),
+ 'DDD/D1/D2/D3' : Item(status='! ', wc_rev=3),
+ })
expected_skip = svntest.wc.State('', {
'F/alpha' : Item(),
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/patch_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/patch_tests.py Mon Dec 31 20:35:19 2012
@@ -999,11 +999,7 @@ def patch_add_new_dir(sbox):
'X/Y/new' : Item(contents='new\n'),
'A/Z' : Item()
})
- expected_disk.remove('A/B/E/alpha')
- expected_disk.remove('A/B/E/beta')
- if svntest.main.wc_is_singledb(wc_dir):
- expected_disk.remove('A/B/E')
- expected_disk.remove('A/C')
+ expected_disk.remove('A/B/E', 'A/B/E/alpha', 'A/B/E/beta', 'A/C')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.add({
@@ -1103,16 +1099,15 @@ def patch_remove_empty_dirs(sbox):
]
expected_disk = svntest.main.greek_state.copy()
- expected_disk.remove('A/D/H/chi')
- expected_disk.remove('A/D/H/psi')
- expected_disk.remove('A/D/H/omega')
- expected_disk.remove('A/B/lambda')
- expected_disk.remove('A/B/E/alpha')
- expected_disk.remove('A/B/E/beta')
- if svntest.main.wc_is_singledb(wc_dir):
- expected_disk.remove('A/B/E')
- expected_disk.remove('A/B/F')
- expected_disk.remove('A/B')
+ expected_disk.remove('A/D/H/chi',
+ 'A/D/H/psi',
+ 'A/D/H/omega',
+ 'A/B/lambda',
+ 'A/B',
+ 'A/B/E',
+ 'A/B/E/alpha',
+ 'A/B/E/beta',
+ 'A/B/F')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.add({'A/D/H/chi' : Item(status='! ', wc_rev=1)})
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/relocate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/relocate_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/relocate_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/relocate_tests.py Mon Dec 31 20:35:19 2012
@@ -88,10 +88,7 @@ def relocate_deleted_missing_copied(sbox
'A/D2/H/omega' : Item(status=' ', wc_rev='-', copied='+'),
'A/D2/H/psi' : Item(status=' ', wc_rev='-', copied='+'),
})
- if svntest.main.wc_is_singledb(wc_dir):
- expected_status.tweak('A/B/F', status='! ', wc_rev='1')
- else:
- expected_status.tweak('A/B/F', status='! ', wc_rev='?')
+ expected_status.tweak('A/B/F', status='! ', wc_rev='1')
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Relocate
@@ -105,14 +102,10 @@ def relocate_deleted_missing_copied(sbox
# Deleted and missing entries should be preserved, so update should
# show only A/B/F being reinstated
- if svntest.main.wc_is_singledb(wc_dir):
- expected_output = svntest.wc.State(wc_dir, {
+ expected_output = svntest.wc.State(wc_dir, {
'A/B/F' : Item(verb='Restored'),
- })
- else:
- expected_output = svntest.wc.State(wc_dir, {
- 'A/B/F' : Item(status='A '),
- })
+ })
+
expected_disk = svntest.main.greek_state.copy()
expected_disk.remove('A/mu')
expected_disk.add({
@@ -123,10 +116,7 @@ def relocate_deleted_missing_copied(sbox
'A/D2/H/omega' : Item("This is the file 'omega'.\n"),
'A/D2/H/psi' : Item("This is the file 'psi'.\n"),
})
- if not svntest.main.wc_is_singledb(wc_dir):
- expected_disk.add({
- 'A/D2/G' : Item(),
- })
+
expected_status.add({
'A/B/F' : Item(status=' ', wc_rev='2'),
})
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/resolved_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/resolved_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/resolved_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/resolved_tests.py Mon Dec 31 20:35:19 2012
@@ -111,11 +111,11 @@ def resolved_on_wc_root(sbox):
expected_disk = svntest.main.greek_state.copy()
expected_disk.remove('iota',
+ 'A/B',
'A/B/lambda',
- 'A/B/E/alpha', 'A/B/E/beta',
+ 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
+ 'A/B/F',
'A/D/gamma')
- if svntest.main.wc_is_singledb(sbox.wc_dir):
- expected_disk.remove('A/B/E', 'A/B/F', 'A/B')
expected_status = svntest.actions.get_virginal_state(wc, 2)
expected_status.tweak('iota', 'A/B', 'A/D/gamma',
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/revert_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/revert_tests.py Mon Dec 31 20:35:19 2012
@@ -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, [],
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/special_tests.py Mon Dec 31 20:35:19 2012
@@ -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/ev2-export/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py Mon Dec 31 20:35:19 2012
@@ -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/ev2-export/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py Mon Dec 31 20:35:19 2012
@@ -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/ev2-export/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py Mon Dec 31 20:35:19 2012
@@ -1300,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."""
@@ -1546,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/ev2-export/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/switch_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/switch_tests.py Mon Dec 31 20:35:19 2012
@@ -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/ev2-export/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/update_tests.py Mon Dec 31 20:35:19 2012
@@ -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)
#----------------------------------------------------------------------
@@ -4331,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
@@ -4441,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' : {
@@ -5936,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/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_diff/diff-diff3-test.c Mon Dec 31 20:35:19 2012
@@ -2394,40 +2394,174 @@ 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
/* ========================================================================== */
@@ -2458,7 +2592,9 @@ 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_NULL
};
Modified: subversion/branches/ev2-export/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_fs/fs-test.c?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_fs/fs-test.c Mon Dec 31 20:35:19 2012
@@ -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,
Modified: subversion/branches/ev2-export/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_repos/repos-test.c?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_repos/repos-test.c Mon Dec 31 20:35:19 2012
@@ -1123,26 +1123,46 @@ rmlocks(const svn_test_opts_t *opts,
/* Helper for the authz test. Set *AUTHZ_P to a representation of
- AUTHZ_CONTENTS, using POOL for temporary allocation. */
+ AUTHZ_CONTENTS, using POOL for temporary allocation. If DISK
+ is TRUE then write the contents to a temp file and use
+ svn_repos_authz_read() to get the data if FALSE write the
+ data to a buffered stream and use svn_repos_authz_parse(). */
static svn_error_t *
authz_get_handle(svn_authz_t **authz_p, const char *authz_contents,
- apr_pool_t *pool)
+ svn_boolean_t disk, apr_pool_t *pool)
{
- const char *authz_file_path;
+ if (disk)
+ {
+ const char *authz_file_path;
+
+ /* Create a temporary file. */
+ SVN_ERR_W(svn_io_write_unique(&authz_file_path, NULL,
+ authz_contents, strlen(authz_contents),
+ svn_io_file_del_on_pool_cleanup, pool),
+ "Writing temporary authz file");
+
+ /* Read the authz configuration back and start testing. */
+ SVN_ERR_W(svn_repos_authz_read(authz_p, authz_file_path, TRUE, pool),
+ "Opening test authz file");
+
+ /* Done with the file. */
+ SVN_ERR_W(svn_io_remove_file(authz_file_path, pool),
+ "Removing test authz file");
+ }
+ else
+ {
+ svn_stream_t *stream;
- /* Create a temporary file. */
- SVN_ERR_W(svn_io_write_unique(&authz_file_path, NULL,
- authz_contents, strlen(authz_contents),
- svn_io_file_del_on_pool_cleanup, pool),
- "Writing temporary authz file");
-
- /* Read the authz configuration back and start testing. */
- SVN_ERR_W(svn_repos_authz_read(authz_p, authz_file_path, TRUE, pool),
- "Opening test authz file");
-
- /* Done with the file. */
- SVN_ERR_W(svn_io_remove_file(authz_file_path, pool),
- "Removing test authz file");
+ stream = svn_stream_buffered(pool);
+ SVN_ERR_W(svn_stream_puts(stream, authz_contents),
+ "Writing authz contents to stream");
+
+ SVN_ERR_W(svn_repos_authz_parse(authz_p, stream, pool),
+ "Parsing the authz contents");
+
+ SVN_ERR_W(svn_stream_close(stream),
+ "Closing the stream");
+ }
return SVN_NO_ERROR;
}
@@ -1287,11 +1307,15 @@ authz(apr_pool_t *pool)
"" NL;
/* Load the test authz rules. */
- SVN_ERR(authz_get_handle(&authz_cfg, contents, subpool));
+ SVN_ERR(authz_get_handle(&authz_cfg, contents, FALSE, subpool));
/* Loop over the test array and test each case. */
SVN_ERR(authz_check_access(authz_cfg, test_set, subpool));
+ /* Repeat the previous test on disk */
+ SVN_ERR(authz_get_handle(&authz_cfg, contents, TRUE, subpool));
+ SVN_ERR(authz_check_access(authz_cfg, test_set, subpool));
+
/* The authz rules for the phase 2 tests, first case (cyclic
dependency). */
contents =
@@ -1304,7 +1328,7 @@ authz(apr_pool_t *pool)
/* Load the test authz rules and check that group cycles are
reported. */
- err = authz_get_handle(&authz_cfg, contents, subpool);
+ err = authz_get_handle(&authz_cfg, contents, FALSE, subpool);
if (!err || err->apr_err != SVN_ERR_AUTHZ_INVALID_CONFIG)
return svn_error_createf(SVN_ERR_TEST_FAILED, err,
"Got %s error instead of expected "
@@ -1319,7 +1343,7 @@ authz(apr_pool_t *pool)
"@senate = r" NL;
/* Check that references to undefined groups are reported. */
- err = authz_get_handle(&authz_cfg, contents, subpool);
+ err = authz_get_handle(&authz_cfg, contents, FALSE, subpool);
if (!err || err->apr_err != SVN_ERR_AUTHZ_INVALID_CONFIG)
return svn_error_createf(SVN_ERR_TEST_FAILED, err,
"Got %s error instead of expected "
@@ -1336,7 +1360,7 @@ authz(apr_pool_t *pool)
"* =" NL;
/* Load the test authz rules. */
- SVN_ERR(authz_get_handle(&authz_cfg, contents, subpool));
+ SVN_ERR(authz_get_handle(&authz_cfg, contents, FALSE, subpool));
/* Verify that the rule on /dir2/secret doesn't affect this
request */
@@ -1354,7 +1378,7 @@ authz(apr_pool_t *pool)
contents =
"[greek:/dir2//secret]" NL
"* =" NL;
- SVN_TEST_ASSERT_ERROR(authz_get_handle(&authz_cfg, contents, subpool),
+ SVN_TEST_ASSERT_ERROR(authz_get_handle(&authz_cfg, contents, FALSE, subpool),
SVN_ERR_AUTHZ_INVALID_CONFIG);
/* That's a wrap! */
@@ -1719,7 +1743,7 @@ commit_editor_authz(const svn_test_opts_
"[/A/D/G]" NL
"plato = r"; /* No newline at end of file. */
- SVN_ERR(authz_get_handle(&authz_file, authz_contents, pool));
+ SVN_ERR(authz_get_handle(&authz_file, authz_contents, FALSE, pool));
iterpool = svn_pool_create(pool);
for (i = 0; i < (sizeof(path_actions) / sizeof(struct authz_path_action_t));
@@ -2674,7 +2698,7 @@ issue_4060(const svn_test_opts_t *opts,
"ozymandias = r" NL
"" NL;
- SVN_ERR(authz_get_handle(&authz_cfg, authz_contents, subpool));
+ SVN_ERR(authz_get_handle(&authz_cfg, authz_contents, FALSE, subpool));
SVN_ERR(svn_repos_authz_check_access(authz_cfg, "babylon",
"/A/B/C", "ozymandias",
Modified: subversion/branches/ev2-export/subversion/tests/libsvn_subr/named_atomic-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_subr/named_atomic-test.c?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_subr/named_atomic-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_subr/named_atomic-test.c Mon Dec 31 20:35:19 2012
@@ -178,17 +178,17 @@ init_test_shm(apr_pool_t *pool)
SVN_ERR(svn_named_atomic__get(&atomic, ns, ATOMIC_NAME "2", TRUE));
SVN_ERR(svn_named_atomic__write(NULL, 0, atomic));
- apr_pool_clear(scratch);
+ svn_pool_clear(scratch);
SVN_ERR(svn_atomic_namespace__create(&ns, name_namespace1, scratch));
SVN_ERR(svn_named_atomic__get(&atomic, ns, ATOMIC_NAME, TRUE));
SVN_ERR(svn_named_atomic__write(NULL, 0, atomic));
- apr_pool_clear(scratch);
+ svn_pool_clear(scratch);
SVN_ERR(svn_atomic_namespace__create(&ns, name_namespace2, scratch));
SVN_ERR(svn_named_atomic__get(&atomic, ns, ATOMIC_NAME, TRUE));
SVN_ERR(svn_named_atomic__write(NULL, 0, atomic));
- apr_pool_clear(scratch);
+ svn_pool_clear(scratch);
/* done */
@@ -256,7 +256,7 @@ APR_THREAD_FUNC test_thread(apr_thread_t
params->thread_count,
params->iterations,
pool);
- apr_pool_destroy(pool);
+ svn_pool_destroy(pool);
apr_thread_exit(thread, APR_SUCCESS);
return NULL;
@@ -401,7 +401,7 @@ calibrate_iterations(apr_pool_t *pool, i
SVN_ERR(run_procs(pool, TEST_PROC, count, calib_iterations));
taken = (double)(apr_time_now() - start);
- apr_pool_destroy(scratch);
+ svn_pool_destroy(scratch);
}
/* scale that to 1s */
Modified: subversion/branches/ev2-export/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/svn_test_main.c?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/svn_test_main.c (original)
+++ subversion/branches/ev2-export/subversion/tests/svn_test_main.c Mon Dec 31 20:35:19 2012
@@ -1,5 +1,5 @@
/*
- * tests-main.c: shared main() & friends for SVN test-suite programs
+ * svn_test_main.c: shared main() & friends for SVN test-suite programs
*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
Modified: subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd (original)
+++ subversion/branches/ev2-export/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd Mon Dec 31 20:35:19 2012
@@ -61,6 +61,7 @@ taskkill /im fs-test.exe /f 2> nul:
taskkill /im op-depth-test.exe /f 2> nul:
taskkill /im java.exe /f 2> nul:
taskkill /im perl.exe /f 2> nul:
+taskkill /im mspdbsrv.exe /f 2> nul:
IF EXIST "%TESTDIR%\tests\subversion\tests\cmdline\httpd\" (
rmdir /s /q "%TESTDIR%\tests\subversion\tests\cmdline\httpd"
)
Modified: subversion/branches/ev2-export/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/dist/backport.pl?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/dist/backport.pl (original)
+++ subversion/branches/ev2-export/tools/dist/backport.pl Mon Dec 31 20:35:19 2012
@@ -110,10 +110,6 @@ $SVNq up
$SVNq merge $mergeargs
$VIM -e -s -n -N -i NONE -u NONE -c '/$pattern/normal! dap' -c wq $STATUS
if $WET_RUN; then
- if [ -n "\$PRINT_SOMETHING_BETWEEN_PROMPTS" ]; then
- # hack for pw-driver.pl to see some output between prompts
- head -n1 $logmsg_filename
- fi
$SVNq commit -F $logmsg_filename
else
echo "Committing:"
Modified: subversion/branches/ev2-export/tools/server-side/fsfs-reorg.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/fsfs-reorg.c?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/server-side/fsfs-reorg.c (original)
+++ subversion/branches/ev2-export/tools/server-side/fsfs-reorg.c Mon Dec 31 20:35:19 2012
@@ -1801,7 +1801,7 @@ read_pack_file(fs_fs_t *fs,
/* one more pack file processed */
print_progress(base);
- apr_pool_destroy(local_pool);
+ svn_pool_destroy(local_pool);
return SVN_NO_ERROR;
}
@@ -1867,7 +1867,7 @@ read_revision_file(fs_fs_t *fs,
if (revision % fs->max_files_per_dir == 0)
print_progress(revision);
- apr_pool_destroy(local_pool);
+ svn_pool_destroy(local_pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/ev2-export/tools/server-side/fsfs-stats.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/fsfs-stats.c?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/server-side/fsfs-stats.c (original)
+++ subversion/branches/ev2-export/tools/server-side/fsfs-stats.c Mon Dec 31 20:35:19 2012
@@ -270,6 +270,7 @@ get_content(svn_stringbuf_t **content,
*content = svn_stringbuf_create_ensure(len, pool);
(*content)->len = len;
+#if APR_VERSION_AT_LEAST(1,3,0)
/* for better efficiency use larger buffers on large reads */
if ( (len >= large_buffer_size)
&& (apr_file_buffer_size_get(file) < large_buffer_size))
@@ -277,7 +278,8 @@ get_content(svn_stringbuf_t **content,
apr_palloc(apr_file_pool_get(file),
large_buffer_size),
large_buffer_size);
-
+#endif
+
SVN_ERR(svn_io_file_seek(file, APR_SET, &offset, pool));
SVN_ERR(svn_io_file_read_full2(file, (*content)->data, len,
NULL, NULL, pool));
@@ -1209,7 +1211,7 @@ read_pack_file(fs_fs_t *fs,
/* one more pack file processed */
print_progress(base);
- apr_pool_destroy(local_pool);
+ svn_pool_destroy(local_pool);
return SVN_NO_ERROR;
}
@@ -1265,7 +1267,7 @@ read_revision_file(fs_fs_t *fs,
if (revision % fs->max_files_per_dir == 0)
print_progress(revision);
- apr_pool_destroy(local_pool);
+ svn_pool_destroy(local_pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/ev2-export/tools/server-side/svnauthz-validate.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnauthz-validate.c?rev=1427238&r1=1427237&r2=1427238&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/server-side/svnauthz-validate.c (original)
+++ subversion/branches/ev2-export/tools/server-side/svnauthz-validate.c Mon Dec 31 20:35:19 2012
@@ -45,13 +45,20 @@ enum {
static int
usage(const char *argv0)
{
- printf("Usage: %s FILE [--username USER [--path FSPATH] [--repository REPOS_NAME]] FILE\n\n", argv0);
- printf("Loads the authz file at FILE and validates its syntax.\n"
- "Optionally prints the access available to USER for FSPATH in\n"
- "repository with authz name REPOS_NAME. If FSPATH is omitted, reports\n"
- "whether USER has any access at all.\n"
- "FILE can also be an absolute file:// URL to a authz file in a\n"
- "repository, but cannot be a repository relative URL (^/).\n"
+ printf("Usage: 1. %s [OPTION]... TARGET\n", argv0);
+ printf(" 2. %s [OPTION]... --transaction TXN REPOS_PATH FILE_PATH\n\n", argv0);
+ printf(" 1. Loads and validates the syntax of the authz file at TARGET.\n"
+ " TARGET can be a path to a file or an absolute file:// URL to an authz\n"
+ " file in a repository, but cannot be a repository relative URL (^/).\n\n"
+ " 2. Loads and validates the syntax of the authz file at FILE_PATH in the\n"
+ " transaction TXN in the repository at REPOS_PATH.\n\n"
+ " Options:\n\n"
+ " --username USER : prints access available for a user\n"
+ " --path FSPATH : makes --username print access available for FSPATH\n"
+ " --repository REPOS_NAME : use REPOS_NAME as repository authz name when\n"
+ " determining access available with --username\n"
+ " -t, --transaction TXN : enables mode 2 which looks for the file in an\n"
+ " uncommitted transaction TXN\n\n"
"Returns:\n"
" 0 when syntax is OK.\n"
" 1 when syntax is invalid.\n"
@@ -59,6 +66,45 @@ usage(const char *argv0)
return 2;
}
+/* Loads the authz config into *AUTHZ from the file at AUTHZ_FILE
+ in repository at REPOS_PATH from the transaction TXN_NAME. Using
+ POOL for allocations. */
+static svn_error_t *
+get_authz_from_txn(svn_authz_t **authz, const char *repos_path,
+ const char *authz_file, const char *txn_name,
+ apr_pool_t *pool)
+{
+ svn_repos_t *repos;
+ svn_fs_t *fs;
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *root;
+ svn_node_kind_t node_kind;
+ svn_stream_t *contents;
+ svn_error_t *err;
+
+ /* Open up the repository and find the transaction root */
+ SVN_ERR(svn_repos_open2(&repos, repos_path, NULL, pool));
+ fs = svn_repos_fs(repos);
+ SVN_ERR(svn_fs_open_txn(&txn, fs, txn_name, pool));
+ SVN_ERR(svn_fs_txn_root(&root, txn, pool));
+
+ /* Make sure the path is a file */
+ SVN_ERR(svn_fs_check_path(&node_kind, root, authz_file, pool));
+ if (node_kind != svn_node_file)
+ return svn_error_createf(SVN_ERR_FS_NOT_FILE, NULL,
+ "Path '%s' is not a file", authz_file);
+
+ SVN_ERR(svn_fs_file_contents(&contents, root, authz_file, pool));
+ err = svn_repos_authz_parse(authz, contents, pool);
+
+ /* Add the filename to the error stack since the parser doesn't have it. */
+ if (err != SVN_NO_ERROR)
+ return svn_error_createf(err->apr_err, err,
+ "Error parsing authz file: '%s':", authz_file);
+
+ return SVN_NO_ERROR;
+}
+
int
main(int argc, const char **argv)
{
@@ -72,6 +118,7 @@ main(int argc, const char **argv)
{"username", OPT_USERNAME, 1, ("the authenticated username")},
{"path", OPT_PATH, 1, ("path within the repository")},
{"repository", OPT_REPOS, 1, ("repository authz name")},
+ {"transaction", 't', 1, ("transaction id")},
{0, 0, 0, 0}
};
struct {
@@ -79,8 +126,11 @@ main(int argc, const char **argv)
const char *username;
const char *fspath;
const char *repos_name;
+ const char *txn;
+ const char *repos_path;
} opts;
- opts.username = opts.fspath = opts.repos_name = NULL;
+ opts.username = opts.fspath = opts.repos_name = opts.txn = NULL;
+ opts.repos_path = NULL;
/* Initialize the app. Send all error messages to 'stderr'. */
if (svn_cmdline_init(argv[0], stderr) != EXIT_SUCCESS)
@@ -113,21 +163,64 @@ main(int argc, const char **argv)
switch (opt)
{
case OPT_USERNAME:
- /* ### TODO: UTF-8? */
- opts.username = arg;
+ err = svn_utf_cstring_to_utf8(&opts.username, arg, pool);
+ if (err)
+ {
+ svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+ svn_error_clear(err);
+ return 2;
+ }
break;
case OPT_PATH:
- /* ### TODO: UTF-8? */
- opts.fspath = arg;
+ err = svn_utf_cstring_to_utf8(&opts.fspath, arg, pool);
+ if (err)
+ {
+ svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+ svn_error_clear(err);
+ return 2;
+ }
break;
case OPT_REPOS:
- opts.repos_name = arg;
+ err = svn_utf_cstring_to_utf8(&opts.repos_name, arg, pool);
+ if (err)
+ {
+ svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+ svn_error_clear(err);
+ return 2;
+ }
+ break;
+ case 't':
+ err = svn_utf_cstring_to_utf8(&opts.txn, arg, pool);
+ if (err)
+ {
+ svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+ svn_error_clear(err);
+ return 2;
+ }
break;
default:
return usage(argv[0]);
}
}
+ /* Consume a non-option argument (repos_path) if --transaction */
+ if (opts.txn)
+ {
+ if (os->ind +2 != argc)
+ return usage(argv[0]);
+
+ err = svn_utf_cstring_to_utf8(&opts.repos_path, os->argv[os->ind], pool);
+ if (err)
+ {
+ svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+ svn_error_clear(err);
+ return 2;
+ }
+ os->ind++;
+
+ opts.repos_path = svn_dirent_internal_style(opts.repos_path, pool);
+ }
+
/* Exactly 1 non-option argument, and no --repository/--path
unless --username. */
if (os->ind + 1 != argc || (!opts.username && (opts.fspath || opts.repos_name)))
@@ -150,9 +243,19 @@ main(int argc, const char **argv)
return usage(argv[0]);
else if (!svn_path_is_url(opts.authz_file))
opts.authz_file = svn_dirent_internal_style(opts.authz_file, pool);
+ else if (opts.txn) /* don't allow urls with transaction argument */
+ return usage(argv[0]);
/* Read the access file and validate it. */
- err = svn_repos_authz_read2(&authz, opts.authz_file, TRUE, NULL, pool);
+ if (opts.txn)
+ {
+ err = get_authz_from_txn(&authz, opts.repos_path,
+ opts.authz_file, opts.txn, pool);
+ }
+ else
+ {
+ err = svn_repos_authz_read2(&authz, opts.authz_file, TRUE, NULL, pool);
+ }
/* Optionally, print the access a USER has to a given PATH in REPOS.
PATH and REPOS may be NULL. */