You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/02/04 21:48:13 UTC
svn commit: r1442344 [33/39] - in /subversion/branches/fsfs-format7: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/emacs/
contrib/server-side/fsfsfixer/fixer/ contrib/server-side/svncutter/ doc/...
Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/prop_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/prop_tests.py Mon Feb 4 20:48:05 2013
@@ -49,6 +49,10 @@ def is_non_posix_and_non_windows_os():
"""lambda function to skip revprop_change test"""
return (not svntest.main.is_posix_os()) and sys.platform != 'win32'
+# this is global so other test files can use it
+binary_mime_type_on_text_file_warning = \
+ "svn: warning:.*is a binary mime-type but file.*looks like text.*"
+
######################################################################
# Tests
@@ -92,11 +96,7 @@ def make_local_props(sbox):
# Read the real disk tree. Notice we are passing the (normally
# disabled) "load props" flag to this routine. This will run 'svn
# proplist' on every item in the working copy!
- actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, 1)
-
- # Compare actual vs. expected disk trees.
- svntest.tree.compare_trees("disk", actual_disk_tree,
- expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk, True)
# Edit without actually changing the property
svntest.main.use_editor('identity')
@@ -616,7 +616,9 @@ def inappropriate_props(sbox):
svntest.main.file_append(path, "binary")
sbox.simple_add('binary')
- sbox.simple_propset('svn:mime-type', 'application/octet-stream', 'binary')
+ svntest.main.run_svn(binary_mime_type_on_text_file_warning,
+ 'propset', 'svn:mime-type', 'application/octet-stream',
+ sbox.ospath('binary'))
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -1319,9 +1321,7 @@ def props_on_replaced_file(sbox):
# check that the replaced file has no properties
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('iota', contents="some mod")
- actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, 1)
- svntest.tree.compare_trees("disk", actual_disk_tree,
- expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
# now add a new property to iota
sbox.simple_propset('red', 'mojo', 'iota')
@@ -1329,9 +1329,7 @@ def props_on_replaced_file(sbox):
# What we expect the disk tree to look like:
expected_disk.tweak('iota', props={'red' : 'mojo', 'groovy' : 'baby'})
- actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, 1)
- svntest.tree.compare_trees("disk", actual_disk_tree,
- expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
#----------------------------------------------------------------------
@@ -1781,9 +1779,7 @@ def rm_of_replaced_file(sbox):
expected_disk.tweak('iota', props={'red': 'rojo', 'blue': 'lagoon'})
expected_disk.tweak('A/mu', props={'red': 'rojo', 'blue': 'lagoon'},
contents="This is the file 'iota'.\n")
- actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, 1)
- svntest.tree.compare_trees("disk", actual_disk_tree,
- expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
# Remove the copy. This should leave the original locally-deleted mu,
# which should have no properties.
@@ -2012,17 +2008,13 @@ def obstructed_subdirs(sbox):
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/C', props={'red': 'blue'})
- actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, load_props=True)
- svntest.tree.compare_trees("disk", actual_disk_tree,
- expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
# Remove the subdir from disk, and validate the status
svntest.main.safe_rmtree(C_path)
expected_disk.remove('A/C')
- actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, load_props=True)
- svntest.tree.compare_trees("disk", actual_disk_tree,
- expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/C', status='!M', wc_rev='1')
@@ -2035,9 +2027,7 @@ def obstructed_subdirs(sbox):
expected_disk.add({'A/C': Item(contents='', props={'red': 'blue'})})
expected_status.tweak('A/C', status='~M', wc_rev='1')
- actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, load_props=True)
- svntest.tree.compare_trees("disk", actual_disk_tree,
- expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@@ -2535,11 +2525,11 @@ def inheritable_ignores(sbox):
sbox.simple_propset('svn:ignore', '*.foo', 'A/B/E')
sbox.simple_commit()
- # Some directories and files that should be added because they don't
- # match any applicable ignores.
- X_dir_path = os.path.join(wc_dir, 'ADD-ME-DIR-X')
- Y_dir_path = os.path.join(wc_dir, 'A', 'ADD-ME-DIR-Y.doo')
- Z_dir_path = os.path.join(wc_dir, 'A', 'D', 'G', 'ADD-ME-DIR-Z.doo')
+ # Some directories and files that should always be added because they
+ # don't match any applicable ignore patterns.
+ X_dir_path = sbox.ospath('ADD-ME-DIR-X')
+ Y_dir_path = sbox.ospath('A/ADD-ME-DIR-Y.doo')
+ Z_dir_path = sbox.ospath('A/D/G/ADD-ME-DIR-Z.doo')
os.mkdir(X_dir_path)
os.mkdir(Y_dir_path)
os.mkdir(Z_dir_path)
@@ -2547,11 +2537,11 @@ def inheritable_ignores(sbox):
# Some directories and files that should be ignored when adding
# because they match an ignore pattern (unless of course they are
# the direct target of an add, which we always add).
- boo_dir_path = os.path.join(wc_dir, 'IGNORE-ME-DIR.boo')
- goo_dir_path = os.path.join(wc_dir, 'IGNORE-ME-DIR.boo', 'IGNORE-ME-DIR.goo')
- doo_dir_path = os.path.join(wc_dir, 'A', 'B', 'IGNORE-ME-DIR.doo')
- moo_dir_path = os.path.join(wc_dir, 'A', 'D', 'IGNORE-ME-DIR.moo')
- foo_dir_path = os.path.join(wc_dir, 'A', 'B', 'E', 'IGNORE-ME-DIR.foo')
+ boo_dir_path = sbox.ospath('IGNORE-ME-DIR.boo')
+ goo_dir_path = sbox.ospath('IGNORE-ME-DIR.boo/IGNORE-ME-DIR.goo')
+ doo_dir_path = sbox.ospath('A/B/IGNORE-ME-DIR.doo')
+ moo_dir_path = sbox.ospath('A/D/IGNORE-ME-DIR.moo')
+ foo_dir_path = sbox.ospath('A/B/E/IGNORE-ME-DIR.foo')
os.mkdir(boo_dir_path)
os.mkdir(goo_dir_path)
os.mkdir(doo_dir_path)
@@ -2650,8 +2640,8 @@ def inheritable_ignores(sbox):
'--config-dir', config_dir)
os.chdir(saved_wd)
- # Now revert and try the add with the --no-ignore flag, only the
- # svn:global-ignores should be enforced.
+ # Now revert and try the add with the --no-ignore flag, nothing should
+ # be ignored.
svntest.actions.run_and_verify_svn(None, None, [], 'revert', wc_dir, '-R')
saved_wd = os.getcwd()
os.chdir(sbox.wc_dir)
@@ -2665,15 +2655,25 @@ def inheritable_ignores(sbox):
'IGNORE-ME-DIR.goo') + '\n',
'A ' + os.path.join('A', 'B', 'E', 'IGNORE-ME-DIR.foo') + '\n',
'A ' + os.path.join('A', 'B', 'E', 'ignore-me-file.foo') + '\n',
- 'A ' + os.path.join('A', 'D', 'G', 'ignore-me-file.goo') + '\n'])
- svntest.actions.run_and_verify_svn("Adds in spite of ignores", expected,
- [], 'add', '.', '--force','--no-ignore',
- '--config-dir', config_dir)
+ 'A ' + os.path.join('A', 'D', 'G', 'ignore-me-file.goo') + '\n',
+
+ 'A ' + os.path.join('A', 'B', 'E', 'ignore-me-file.doo') + '\n',
+ 'A ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo') + '\n',
+ 'A ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo',
+ 'ignore-me-file.doo') + '\n',
+ 'A ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo',
+ 'ignore-me-file.roo') + '\n',
+ 'A ' + os.path.join('A', 'D', 'IGNORE-ME-DIR.moo') + '\n',
+ 'A ' + os.path.join('A', 'D', 'ignore-me-file.moo') + '\n'])
+ svntest.actions.run_and_verify_svn("Files ignored with --no-ignore",
+ expected, [], 'add', '.', '--force',
+ '--no-ignore', '--config-dir',
+ config_dir)
def almost_known_prop_names(sbox):
"propset with svn: prefix but unknown name"
- sbox.build()
+ sbox.build(read_only=True)
wc_dir = sbox.wc_dir
iota_path = sbox.ospath('iota')
Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/relocate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/relocate_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/relocate_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/relocate_tests.py Mon Feb 4 20:48:05 2013
@@ -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/fsfs-format7/subversion/tests/cmdline/resolve_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/resolve_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/resolve_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/resolve_tests.py Mon Feb 4 20:48:05 2013
@@ -44,6 +44,13 @@ Wimp = svntest.testcase.Wimp_deco
from merge_tests import set_up_branch
from merge_tests import expected_merge_output
+
+######################################################################
+# Tests
+#
+# Each test must return on success or raise on failure.
+
+#----------------------------------------------------------------------
# 'svn resolve --accept [ base | mine-full | theirs-full ]' was segfaulting
# on 1.6.x. Prior to this test, the bug was only caught by the Ruby binding
# tests, see http://svn.haxx.se/dev/archive-2010-01/0088.shtml.
@@ -243,6 +250,7 @@ def prop_conflict_resolution(sbox):
[], # Prop deleted
['incoming-conflict\n'])
+#----------------------------------------------------------------------
@SkipUnless(svntest.main.is_posix_os)
def auto_resolve_executable_file(sbox):
"resolve file with executable bit set"
@@ -271,6 +279,333 @@ def auto_resolve_executable_file(sbox):
if mode != os.stat(sbox.ospath('iota'))[stat.ST_MODE]:
raise svntest.Failure
+#----------------------------------------------------------------------
+def resolved_on_wc_root(sbox):
+ "resolved on working copy root"
+
+ sbox.build()
+ wc = sbox.wc_dir
+
+ i = os.path.join(wc, 'iota')
+ B = os.path.join(wc, 'A', 'B')
+ g = os.path.join(wc, 'A', 'D', 'gamma')
+
+ # Create some conflicts...
+ # Commit mods
+ svntest.main.file_append(i, "changed iota.\n")
+ svntest.main.file_append(g, "changed gamma.\n")
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'propset', 'foo', 'foo-val', B)
+
+ expected_output = svntest.wc.State(wc, {
+ 'iota' : Item(verb='Sending'),
+ 'A/B' : Item(verb='Sending'),
+ 'A/D/gamma' : Item(verb='Sending'),
+ })
+
+ expected_status = svntest.actions.get_virginal_state(wc, 1)
+ expected_status.tweak('iota', 'A/B', 'A/D/gamma', wc_rev = 2)
+
+ svntest.actions.run_and_verify_commit(wc,
+ expected_output,
+ expected_status,
+ None,
+ wc)
+
+ # Go back to rev 1
+ expected_output = svntest.wc.State(wc, {
+ 'iota' : Item(status='U '),
+ 'A/B' : Item(status=' U'),
+ 'A/D/gamma' : Item(status='U '),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc, 1)
+ expected_disk = svntest.main.greek_state.copy()
+ svntest.actions.run_and_verify_update(wc,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None, False,
+ '-r1', wc)
+
+ # Deletions so that the item becomes unversioned and
+ # will have a tree-conflict upon update.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'rm', i, B, g)
+
+ # Update so that conflicts appear
+ expected_output = svntest.wc.State(wc, {
+ 'iota' : Item(status=' ', treeconflict='C'),
+ 'A/B' : Item(status=' ', treeconflict='C'),
+ 'A/D/gamma' : Item(status=' ', treeconflict='C'),
+ })
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.remove('iota',
+ 'A/B',
+ 'A/B/lambda',
+ 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
+ 'A/B/F',
+ 'A/D/gamma')
+
+ expected_status = svntest.actions.get_virginal_state(wc, 2)
+ expected_status.tweak('iota', 'A/B', 'A/D/gamma',
+ status='D ', treeconflict='C')
+ expected_status.tweak('A/B/lambda', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
+ 'A/B/F', status='D ')
+ svntest.actions.run_and_verify_update(wc,
+ expected_output,
+ expected_disk,
+ None,
+ None, None, None, None, None, False,
+ wc)
+ svntest.actions.run_and_verify_unquiet_status(wc, expected_status)
+
+ # Resolve recursively
+ svntest.actions.run_and_verify_resolved([i, B, g], '--depth=infinity', wc)
+
+ expected_status.tweak('iota', 'A/B', 'A/D/gamma', treeconflict=None)
+ svntest.actions.run_and_verify_unquiet_status(wc, expected_status)
+
+#----------------------------------------------------------------------
+def resolved_on_deleted_item(sbox):
+ "resolved on deleted item"
+
+ sbox.build()
+ wc = sbox.wc_dir
+
+ A = os.path.join(wc, 'A',)
+ B = os.path.join(wc, 'A', 'B')
+ g = os.path.join(wc, 'A', 'D', 'gamma')
+ A2 = os.path.join(wc, 'A2')
+ B2 = os.path.join(A2, 'B')
+ g2 = os.path.join(A2, 'D', 'gamma')
+
+ A_url = sbox.repo_url + '/A'
+ A2_url = sbox.repo_url + '/A2'
+
+ # make a copy of A
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'cp', A_url, A2_url, '-m', 'm')
+
+ expected_output = svntest.wc.State(wc, {
+ 'A2' : Item(status='A '),
+ 'A2/B' : Item(status='A '),
+ 'A2/B/lambda' : Item(status='A '),
+ 'A2/B/E' : Item(status='A '),
+ 'A2/B/E/alpha' : Item(status='A '),
+ 'A2/B/E/beta' : Item(status='A '),
+ 'A2/B/F' : Item(status='A '),
+ 'A2/mu' : Item(status='A '),
+ 'A2/C' : Item(status='A '),
+ 'A2/D' : Item(status='A '),
+ 'A2/D/gamma' : Item(status='A '),
+ 'A2/D/G' : Item(status='A '),
+ 'A2/D/G/pi' : Item(status='A '),
+ 'A2/D/G/rho' : Item(status='A '),
+ 'A2/D/G/tau' : Item(status='A '),
+ 'A2/D/H' : Item(status='A '),
+ 'A2/D/H/chi' : Item(status='A '),
+ 'A2/D/H/omega' : Item(status='A '),
+ 'A2/D/H/psi' : Item(status='A '),
+ })
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({
+ 'A2/mu' : Item(contents="This is the file 'mu'.\n"),
+ 'A2/D/gamma' : Item(contents="This is the file 'gamma'.\n"),
+ 'A2/D/H/psi' : Item(contents="This is the file 'psi'.\n"),
+ 'A2/D/H/omega' : Item(contents="This is the file 'omega'.\n"),
+ 'A2/D/H/chi' : Item(contents="This is the file 'chi'.\n"),
+ 'A2/D/G/rho' : Item(contents="This is the file 'rho'.\n"),
+ 'A2/D/G/pi' : Item(contents="This is the file 'pi'.\n"),
+ 'A2/D/G/tau' : Item(contents="This is the file 'tau'.\n"),
+ 'A2/B/lambda' : Item(contents="This is the file 'lambda'.\n"),
+ 'A2/B/F' : Item(),
+ 'A2/B/E/beta' : Item(contents="This is the file 'beta'.\n"),
+ 'A2/B/E/alpha' : Item(contents="This is the file 'alpha'.\n"),
+ 'A2/C' : Item(),
+ })
+
+ expected_status = svntest.actions.get_virginal_state(wc, 2)
+ expected_status.add({
+ 'A2' : Item(),
+ 'A2/B' : Item(),
+ 'A2/B/lambda' : Item(),
+ 'A2/B/E' : Item(),
+ 'A2/B/E/alpha' : Item(),
+ 'A2/B/E/beta' : Item(),
+ 'A2/B/F' : Item(),
+ 'A2/mu' : Item(),
+ 'A2/C' : Item(),
+ 'A2/D' : Item(),
+ 'A2/D/gamma' : Item(),
+ 'A2/D/G' : Item(),
+ 'A2/D/G/pi' : Item(),
+ 'A2/D/G/rho' : Item(),
+ 'A2/D/G/tau' : Item(),
+ 'A2/D/H' : Item(),
+ 'A2/D/H/chi' : Item(),
+ 'A2/D/H/omega' : Item(),
+ 'A2/D/H/psi' : Item(),
+ })
+ expected_status.tweak(status=' ', wc_rev='2')
+
+ svntest.actions.run_and_verify_update(wc,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None, False,
+ wc)
+
+ # Create some conflicts...
+
+ # Modify the paths in the one directory.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'propset', 'foo', 'foo-val', B)
+ svntest.main.file_append(g, "Modified gamma.\n")
+
+ expected_output = svntest.wc.State(wc, {
+ 'A/B' : Item(verb='Sending'),
+ 'A/D/gamma' : Item(verb='Sending'),
+ })
+
+ expected_status.tweak('A/B', 'A/D/gamma', wc_rev='3')
+
+ svntest.actions.run_and_verify_commit(wc,
+ expected_output,
+ expected_status,
+ None,
+ wc)
+
+ # Delete the paths in the second directory.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'rm', B2, g2)
+
+ expected_output = svntest.wc.State(wc, {
+ 'A2/B' : Item(verb='Deleting'),
+ 'A2/D/gamma' : Item(verb='Deleting'),
+ })
+
+ expected_status.remove('A2/B', 'A2/B/lambda',
+ 'A2/B/E', 'A2/B/E/alpha', 'A2/B/E/beta',
+ 'A2/B/F',
+ 'A2/D/gamma')
+
+ svntest.actions.run_and_verify_commit(wc,
+ expected_output,
+ expected_status,
+ None,
+ A2)
+
+ # Now merge A to A2, creating conflicts...
+
+ expected_output = svntest.wc.State(A2, {
+ 'B' : Item(status=' ', treeconflict='C'),
+ 'D/gamma' : Item(status=' ', treeconflict='C'),
+ })
+ expected_mergeinfo_output = svntest.wc.State(A2, {
+ '' : Item(status=' U')
+ })
+ expected_elision_output = svntest.wc.State(A2, {
+ })
+ expected_disk = svntest.wc.State('', {
+ 'mu' : Item(contents="This is the file 'mu'.\n"),
+ 'D' : Item(),
+ 'D/H' : Item(),
+ 'D/H/psi' : Item(contents="This is the file 'psi'.\n"),
+ 'D/H/omega' : Item(contents="This is the file 'omega'.\n"),
+ 'D/H/chi' : Item(contents="This is the file 'chi'.\n"),
+ 'D/G' : Item(),
+ 'D/G/rho' : Item(contents="This is the file 'rho'.\n"),
+ 'D/G/pi' : Item(contents="This is the file 'pi'.\n"),
+ 'D/G/tau' : Item(contents="This is the file 'tau'.\n"),
+ 'C' : Item(),
+ })
+
+ expected_skip = svntest.wc.State(wc, {
+ })
+
+ expected_status = svntest.wc.State(A2, {
+ '' : Item(status=' M', wc_rev='2'),
+ 'D' : Item(status=' ', wc_rev='2'),
+ 'D/gamma' : Item(status='! ', treeconflict='C'),
+ 'D/G' : Item(status=' ', wc_rev='2'),
+ 'D/G/pi' : Item(status=' ', wc_rev='2'),
+ 'D/G/rho' : Item(status=' ', wc_rev='2'),
+ 'D/G/tau' : Item(status=' ', wc_rev='2'),
+ 'D/H' : Item(status=' ', wc_rev='2'),
+ 'D/H/chi' : Item(status=' ', wc_rev='2'),
+ 'D/H/omega' : Item(status=' ', wc_rev='2'),
+ 'D/H/psi' : Item(status=' ', wc_rev='2'),
+ 'B' : Item(status='! ', treeconflict='C'),
+ 'mu' : Item(status=' ', wc_rev='2'),
+ 'C' : Item(status=' ', wc_rev='2'),
+ })
+
+ svntest.actions.run_and_verify_merge(A2, None, None, A_url, None,
+ expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
+ expected_disk, None, expected_skip,
+ None, dry_run = False)
+ svntest.actions.run_and_verify_unquiet_status(A2, expected_status)
+
+ # Now resolve by recursing on the working copy root.
+ svntest.actions.run_and_verify_resolved([B2, g2], '--depth=infinity', wc)
+
+ expected_status.remove('B', 'D/gamma')
+ svntest.actions.run_and_verify_unquiet_status(A2, expected_status)
+
+#----------------------------------------------------------------------
+
+def theirs_conflict_in_subdir(sbox):
+ "resolve to 'theirs-conflict' in sub-directory"
+
+ sbox.build()
+ wc = sbox.wc_dir
+ wc2 = sbox.add_wc_path('wc2')
+ svntest.actions.duplicate_dir(sbox.wc_dir, wc2)
+
+ alpha_path = os.path.join(wc, 'A', 'B', 'E', 'alpha')
+ alpha_path2 = os.path.join(wc2, 'A', 'B', 'E', 'alpha')
+
+ svntest.main.file_append(alpha_path, "Modified alpha.\n")
+ svntest.main.run_svn(None, 'ci', '-m', 'logmsg', wc)
+
+ svntest.main.file_append(alpha_path2, "Modified alpha, too.\n")
+ svntest.main.run_svn(None, 'up', wc2)
+
+ svntest.actions.run_and_verify_resolve([alpha_path2],
+ '--accept=theirs-conflict',
+ alpha_path2)
+
+#----------------------------------------------------------------------
+
+# Regression test for issue #4238 "merge -cA,B with --accept option aborts
+# if rA conflicts".
+@Issue(4238)
+def multi_range_merge_with_accept(sbox):
+ "multi range merge with --accept keeps going"
+
+ sbox.build()
+ os.chdir(sbox.wc_dir)
+ sbox.wc_dir = ''
+
+ # Commit some changes
+ for c in [2, 3, 4]:
+ svntest.main.file_append('iota', 'Change ' + str(c) + '\n')
+ sbox.simple_commit()
+
+ sbox.simple_update(revision=1)
+
+ # The bug: with a request to merge -c4 then -c3, it merges -c4 which
+ # conflicts then auto-resolves the conflict, then errors out with
+ # 'svn: E155035: Can't merge into conflicted node 'iota'.
+ # ### We need more checking of the result to make this test robust, since
+ # it may not always just error out.
+ svntest.main.run_svn(None, 'merge', '-c4,3', '^/iota', 'iota',
+ '--accept=theirs-conflict')
+
########################################################################
# Run the tests
@@ -280,6 +615,10 @@ test_list = [ None,
automatic_conflict_resolution,
prop_conflict_resolution,
auto_resolve_executable_file,
+ resolved_on_wc_root,
+ resolved_on_deleted_item,
+ theirs_conflict_in_subdir,
+ multi_range_merge_with_accept,
]
if __name__ == '__main__':
Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/revert_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/revert_tests.py Mon Feb 4 20:48:05 2013
@@ -79,8 +79,7 @@ def revert_replacement_with_props(sbox,
expected_disk.tweak('A/D/G/rho',
props={ 'svn:eol-style': 'LF' })
- actual_disk = svntest.tree.build_tree_from_wc(wc_dir, 1)
- svntest.tree.compare_trees("disk", actual_disk, expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk, True)
# Commit props
expected_output = svntest.wc.State(wc_dir, {
@@ -124,8 +123,7 @@ def revert_replacement_with_props(sbox,
expected_disk.tweak('A/D/G/rho',
contents="This is the file 'pi'.\n",
props=props)
- actual_disk = svntest.tree.build_tree_from_wc(wc_dir, 1)
- svntest.tree.compare_trees("disk", actual_disk, expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
# Now revert
expected_status.tweak('A/D/G/rho', status='R ', copied='+', wc_rev='-')
@@ -144,8 +142,7 @@ def revert_replacement_with_props(sbox,
props={ 'phony-prop': '*' })
expected_disk.tweak('A/D/G/rho',
props={ 'svn:eol-style': 'LF' })
- actual_disk = svntest.tree.build_tree_from_wc(wc_dir, 1)
- svntest.tree.compare_trees("disk", actual_disk, expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
@@ -398,9 +395,10 @@ def revert_moved_file(sbox):
# svn st
expected_status = actions.get_virginal_state(wc_dir, 1)
expected_status.add({
- 'iota_moved' : Item(status='A ', copied='+', wc_rev='-'),
+ 'iota_moved' : Item(status='A ', copied='+', wc_rev='-',
+ moved_from='iota'),
})
- expected_status.tweak('iota', status='D ')
+ expected_status.tweak('iota', status='D ', moved_to='iota_moved')
actions.run_and_verify_unquiet_status(wc_dir, expected_status)
@@ -411,7 +409,8 @@ def revert_moved_file(sbox):
iota)
# svn st
- expected_status.tweak('iota', status=' ')
+ expected_status.tweak('iota', status=' ', moved_to=None)
+ expected_status.tweak('iota_moved', moved_from=None)
actions.run_and_verify_unquiet_status(wc_dir, expected_status)
@@ -509,9 +508,8 @@ def revert_file_merge_replace_with_histo
expected_status.tweak('A/D/G/rho', copied=None, status=' ', wc_rev=3)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
- actual_disk = svntest.tree.build_tree_from_wc(wc_dir, 1)
expected_disk.tweak('A/D/G/rho', contents="new rho\n")
- svntest.tree.compare_trees("disk", actual_disk, expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
# Make sure the revert removed the copy from information.
expected_infos = [
@@ -576,8 +574,7 @@ def revert_after_second_replace(sbox):
# Check disk status
expected_disk = svntest.main.greek_state.copy()
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- actual_disk = svntest.tree.build_tree_from_wc(wc_dir, 1)
- svntest.tree.compare_trees("disk", actual_disk, expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
#----------------------------------------------------------------------
@@ -788,34 +785,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 +895,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 +942,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 +1140,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 +1148,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 +1174,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 +1182,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, [],
@@ -1608,8 +1589,7 @@ def revert_with_unversioned_targets(sbox
expected_disk.add({
'A/D/H/delta': Item(delta_contents),
})
- actual_disk = svntest.tree.build_tree_from_wc(wc_dir, 1)
- svntest.tree.compare_trees("disk", actual_disk, expected_disk.old_tree())
+ svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
def revert_nonexistent(sbox):
'svn revert -R nonexistent'
@@ -1617,6 +1597,54 @@ 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
+ })
+
+ # Use expected_status.old_tree() to avoid doing an entries comparion
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output, None,
+ expected_status.old_tree(),
+ 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 +1684,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/fsfs-format7/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/special_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/special_tests.py Mon Feb 4 20:48:05 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()
@@ -1182,7 +1182,7 @@ def incoming_symlink_changes(sbox):
# Update back to r2, to prepare some local changes
expected_output = svntest.wc.State(wc_dir, {
# s-replace is D + A
- 's-replace' : Item(status='A '),
+ 's-replace' : Item(status='A ', prev_status='D '),
's-in-place' : Item(status='U '),
's-reverse' : Item(status=' U'),
's-type' : Item(status=' U'),
@@ -1203,7 +1203,8 @@ def incoming_symlink_changes(sbox):
sbox.simple_propset('x', 'y', 's-replace', 's-in-place', 's-reverse', 's-type')
expected_output = svntest.wc.State(wc_dir, {
- 's-replace' : Item(status=' ', treeconflict='A'),
+ 's-replace' : Item(prev_status = ' ', prev_treeconflict='C',
+ status=' ', treeconflict='A'),
's-in-place' : Item(status='U '),
's-reverse' : Item(status=' ', treeconflict='C'),
's-type' : Item(status=' ', treeconflict='C'),
Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/stat_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/stat_tests.py Mon Feb 4 20:48:05 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,
@@ -1788,11 +1740,11 @@ def status_with_tree_conflicts(sbox):
# check status of G
expected = svntest.verify.UnorderedOutput(
["A + C %s\n" % rho,
- " > local edit, incoming delete upon update\n",
+ " > local file edit, incoming file delete upon update\n",
"D C %s\n" % pi,
- " > local delete, incoming edit upon update\n",
+ " > local file delete, incoming file edit upon update\n",
"! C %s\n" % tau,
- " > local delete, incoming delete upon update\n",
+ " > local file delete, incoming file delete upon update\n",
"Summary of conflicts:\n",
" Tree conflicts: 3\n",
])
@@ -1806,11 +1758,11 @@ def status_with_tree_conflicts(sbox):
expected = svntest.verify.UnorderedOutput(
[" 2 2 jrandom %s\n" % G,
"D C 2 2 jrandom %s\n" % pi,
- " > local delete, incoming edit upon update\n",
+ " > local file delete, incoming file edit upon update\n",
"A + C - 1 jrandom %s\n" % rho,
- " > local edit, incoming delete upon update\n",
+ " > local file edit, incoming file delete upon update\n",
"! C %s\n" % tau,
- " > local delete, incoming delete upon update\n",
+ " > local file delete, incoming file delete upon update\n",
"Summary of conflicts:\n",
" Tree conflicts: 3\n",
])
@@ -2036,6 +1988,40 @@ def status_unversioned_dir(sbox):
svntest.actions.run_and_verify_svn2(None, [], expected_err, 0,
"status", "/")
+def status_case_changed(sbox):
+ "status reporting on case changed nodes directly"
+
+ sbox.build(read_only = True)
+ wc_dir = sbox.wc_dir
+
+ os.rename(sbox.ospath('iota'), sbox.ospath('iOTA'))
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'iOTA' : Item(status='? '),
+ })
+ expected_status.tweak('iota', status='! ')
+
+ # First run status on the directory
+ svntest.actions.run_and_verify_unquiet_status(wc_dir,
+ expected_status)
+
+ # Now on the missing iota directly, which should give the same
+ # result, even on case insenstive filesystems
+ expected_status = svntest.wc.State(wc_dir, {
+ 'iota' : Item(status='! ', wc_rev=1),
+ })
+ svntest.actions.run_and_verify_unquiet_status(sbox.ospath('iota'),
+ expected_status)
+
+ # And on the unversioned iOTA
+ expected_status = svntest.wc.State(wc_dir, {
+ 'iOTA' : Item(status='? '),
+ })
+ svntest.actions.run_and_verify_unquiet_status(sbox.ospath('iOTA'),
+ expected_status)
+
+
########################################################################
# Run the tests
@@ -2081,6 +2067,7 @@ test_list = [ None,
modified_modulo_translation,
status_not_present,
status_unversioned_dir,
+ status_case_changed,
]
if __name__ == '__main__':
Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svnadmin_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svnadmin_tests.py Mon Feb 4 20:48:05 2013
@@ -201,7 +201,7 @@ def load_and_verify_dumpstream(sbox, exp
dump = [ dump ]
exit_code, output, errput = svntest.main.run_command_stdin(
- svntest.main.svnadmin_binary, expected_stderr, 0, 1, dump,
+ svntest.main.svnadmin_binary, expected_stderr, 0, True, dump,
'load', '--quiet', sbox.repo_dir, *varargs)
if expected_stdout:
@@ -230,14 +230,8 @@ def load_and_verify_dumpstream(sbox, exp
"update", "-r%s" % (rev+1),
sbox.wc_dir)
- wc_tree = svntest.tree.build_tree_from_wc(sbox.wc_dir, check_props)
- rev_tree = revs[rev].old_tree()
-
- try:
- svntest.tree.compare_trees("rev/disk", rev_tree, wc_tree)
- except svntest.tree.SVNTreeError:
- svntest.verify.display_trees(None, 'WC TREE', wc_tree, rev_tree)
- raise
+ rev_tree = revs[rev]
+ svntest.actions.verify_disk(sbox.wc_dir, rev_tree, check_props)
def load_dumpstream(sbox, dump, *varargs):
"Load dump text without verification."
@@ -554,11 +548,22 @@ def verify_windows_paths_in_repos(sbox):
exit_code, output, errput = svntest.main.run_svnadmin("verify",
sbox.repo_dir)
- svntest.verify.compare_and_display_lines(
- "Error while running 'svnadmin verify'.",
- 'STDERR', ["* Verified revision 0.\n",
- "* Verified revision 1.\n",
- "* Verified revision 2.\n"], errput)
+
+ # unfortunately, FSFS needs to do more checks than BDB resulting in
+ # different progress output
+ if svntest.main.is_fs_type_fsfs():
+ svntest.verify.compare_and_display_lines(
+ "Error while running 'svnadmin verify'.",
+ 'STDERR', ["* Verifying repository metadata ...\n",
+ "* Verified revision 0.\n",
+ "* Verified revision 1.\n",
+ "* Verified revision 2.\n"], errput)
+ else:
+ svntest.verify.compare_and_display_lines(
+ "Error while running 'svnadmin verify'.",
+ 'STDERR', ["* Verified revision 0.\n",
+ "* Verified revision 1.\n",
+ "* Verified revision 2.\n"], errput)
#----------------------------------------------------------------------
@@ -741,7 +746,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 +1822,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/fsfs-format7/subversion/tests/cmdline/svndumpfilter_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svndumpfilter_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svndumpfilter_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svndumpfilter_tests.py Mon Feb 4 20:48:05 2013
@@ -71,7 +71,7 @@ def filter_and_return_output(dump, bufsi
expected_errput = svntest.verify.AnyOutput
## TODO: Should we handle exit_code?
exit_code, output, errput = svntest.main.run_command_stdin(
- svntest.main.svndumpfilter_binary, expected_errput, bufsize, 1,
+ svntest.main.svndumpfilter_binary, expected_errput, bufsize, True,
dump, *varargs)
# Since we call svntest.main.run_command_stdin() in binary mode,
Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/svnlook_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svnlook_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svnlook_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svnlook_tests.py Mon Feb 4 20:48:05 2013
@@ -32,6 +32,7 @@ logger = logging.getLogger()
# Our testing module
import svntest
+from prop_tests import binary_mime_type_on_text_file_warning
# (abbreviation)
Skip = svntest.testcase.Skip_deco
@@ -48,10 +49,12 @@ Item = svntest.wc.StateItem
# Convenience functions to make writing more tests easier
def run_svnlook(*varargs):
- """Run svnlook with VARARGS, returns stdout as list of lines.
- Raises Failure if any stderr messages."""
+ """Run svnlook with VARARGS, returns exit code as int; stdout, stderr as
+ list of lines (including line terminators).
+ Raises Failure if any stderr messages.
+ """
exit_code, output, dummy_errput = svntest.main.run_command(
- svntest.main.svnlook_binary, 0, 0, *varargs)
+ svntest.main.svnlook_binary, 0, False, *varargs)
return output
@@ -98,7 +101,7 @@ def test_misc(sbox):
# give the repo a new UUID
uuid = "01234567-89ab-cdef-89ab-cdef01234567"
- svntest.main.run_command_stdin(svntest.main.svnadmin_binary, None, 0, 1,
+ svntest.main.run_command_stdin(svntest.main.svnadmin_binary, None, 0, True,
["SVN-fs-dump-format-version: 2\n",
"\n",
"UUID: ", uuid, "\n",
@@ -504,6 +507,8 @@ def diff_ignore_eolstyle(sbox):
repo_dir = sbox.repo_dir
wc_dir = sbox.wc_dir
+ # CRLF is a string that will match a CRLF sequence read from a text file.
+ # ### On Windows, we assume CRLF will be read as LF, so it's a poor test.
if os.name == 'nt':
crlf = '\n'
else:
@@ -574,7 +579,8 @@ def diff_binary(sbox):
# Set A/mu to a binary mime-type, tweak its text, and commit.
mu_path = os.path.join(wc_dir, 'A', 'mu')
svntest.main.file_append(mu_path, 'new appended text for mu')
- svntest.main.run_svn(None, 'propset', 'svn:mime-type',
+ svntest.main.run_svn(binary_mime_type_on_text_file_warning,
+ 'propset', 'svn:mime-type',
'application/octet-stream', mu_path)
svntest.main.run_svn(None, 'ci', '-m', 'log msg', mu_path)
@@ -696,6 +702,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/fsfs-format7/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svnmucc_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svnmucc_tests.py Mon Feb 4 20:48:05 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/fsfs-format7/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svnrdump_tests.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svnrdump_tests.py Mon Feb 4 20:48:05 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/fsfs-format7/subversion/tests/cmdline/svnserveautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svnserveautocheck.sh?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svnserveautocheck.sh (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svnserveautocheck.sh Mon Feb 4 20:48:05 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/fsfs-format7/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svntest/actions.py?rev=1442344&r1=1442343&r2=1442344&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svntest/actions.py Mon Feb 4 20:48:05 2013
@@ -333,11 +333,11 @@ def run_and_verify_load(repo_dir, dump_f
expected_stderr = []
if bypass_prop_validation:
exit_code, output, errput = main.run_command_stdin(
- main.svnadmin_binary, expected_stderr, 0, 1, dump_file_content,
+ main.svnadmin_binary, expected_stderr, 0, True, dump_file_content,
'load', '--force-uuid', '--quiet', '--bypass-prop-validation', repo_dir)
else:
exit_code, output, errput = main.run_command_stdin(
- main.svnadmin_binary, expected_stderr, 0, 1, dump_file_content,
+ main.svnadmin_binary, expected_stderr, 0, True, dump_file_content,
'load', '--force-uuid', '--quiet', repo_dir)
verify.verify_outputs("Unexpected stderr output", None, errput,
@@ -424,6 +424,22 @@ def expected_noop_update_output(rev):
% (rev),
"no-op update")
+def run_and_verify_svnauthz(message, expected_stdout, expected_stderr,
+ expected_exit, compat_mode, *varargs):
+ """Run svnauthz command and check its output and exit code.
+ If COMPAT_MODE is True then run the command in pre-1.8
+ compatibility mode"""
+
+ if compat_mode:
+ exit_code, out, err = main.run_svnauthz_validate(*varargs)
+ else:
+ exit_code, out, err = main.run_svnauthz(*varargs)
+
+ verify.verify_outputs("Unexpected output", out, err,
+ expected_stdout, expected_stderr)
+ verify.verify_exit_code(message, exit_code, expected_exit)
+ return exit_code, out, err
+
######################################################################
# Subversion Actions
#
@@ -455,8 +471,6 @@ def run_and_verify_checkout2(do_remove,
if isinstance(output_tree, wc.State):
output_tree = output_tree.old_tree()
- if isinstance(disk_tree, wc.State):
- disk_tree = disk_tree.old_tree()
# Remove dir if it's already there, unless this is a forced checkout.
# In that case assume we want to test a forced checkout's toleration
@@ -478,17 +492,10 @@ def run_and_verify_checkout2(do_remove,
_log_tree_state("ACTUAL OUTPUT TREE:", actual, wc_dir_name)
raise
- # Create a tree by scanning the working copy
- actual = tree.build_tree_from_wc(wc_dir_name)
-
- # Verify expected disk against actual disk.
- try:
- tree.compare_trees("disk", actual, disk_tree,
- singleton_handler_a, a_baton,
- singleton_handler_b, b_baton)
- except tree.SVNTreeUnequal:
- _log_tree_state("ACTUAL DISK TREE:", actual, wc_dir_name)
- raise
+ if disk_tree:
+ verify_disk(wc_dir_name, disk_tree, False,
+ singleton_handler_a, a_baton,
+ singleton_handler_b, b_baton)
def run_and_verify_checkout(URL, wc_dir_name, output_tree, disk_tree,
singleton_handler_a = None,
@@ -759,10 +766,6 @@ def verify_update(actual_output,
mergeinfo_output_tree = mergeinfo_output_tree.old_tree()
if isinstance(elision_output_tree, wc.State):
elision_output_tree = elision_output_tree.old_tree()
- if isinstance(disk_tree, wc.State):
- disk_tree = disk_tree.old_tree()
- if isinstance(status_tree, wc.State):
- status_tree = status_tree.old_tree()
# Verify actual output against expected output.
if output_tree:
@@ -794,27 +797,35 @@ def verify_update(actual_output,
# Create a tree by scanning the working copy, and verify it
if disk_tree:
- actual_disk = tree.build_tree_from_wc(wc_dir_name, check_props)
- try:
- tree.compare_trees("disk", actual_disk, disk_tree,
- singleton_handler_a, a_baton,
- singleton_handler_b, b_baton)
- except tree.SVNTreeUnequal:
- _log_tree_state("EXPECTED DISK TREE:", disk_tree)
- _log_tree_state("ACTUAL DISK TREE:", actual_disk)
- raise
+ verify_disk(wc_dir_name, disk_tree, check_props,
+ singleton_handler_a, a_baton,
+ singleton_handler_b, b_baton)
# Verify via 'status' command too, if possible.
if status_tree:
run_and_verify_status(wc_dir_name, status_tree)
-def verify_disk(wc_dir_name, disk_tree, check_props=False):
+def verify_disk(wc_dir_name, disk_tree, check_props=False,
+ singleton_handler_a = None, a_baton = None,
+ singleton_handler_b = None, b_baton = None):
"""Verify WC_DIR_NAME against DISK_TREE. If CHECK_PROPS is set,
the comparison will examin props. Returns if successful, raises on
failure."""
- verify_update(None, None, None, wc_dir_name, None, None, None, disk_tree,
- None, check_props=check_props)
+
+ if isinstance(disk_tree, wc.State):
+ disk_tree = disk_tree.old_tree()
+
+ actual_disk = tree.build_tree_from_wc(wc_dir_name, check_props)
+ try:
+ tree.compare_trees("disk", actual_disk, disk_tree,
+ singleton_handler_a, a_baton,
+ singleton_handler_b, b_baton)
+ except tree.SVNTreeUnequal:
+ _log_tree_state("EXPECTED DISK TREE:", disk_tree)
+ _log_tree_state("ACTUAL DISK TREE:", actual_disk)
+ raise
+
@@ -838,8 +849,6 @@ def run_and_verify_update(wc_dir_name,
If ERROR_RE_STRING, the update must exit with error, and the error
message must match regular expression ERROR_RE_STRING.
- Else if ERROR_RE_STRING is None, then:
-
If OUTPUT_TREE is not None, the subcommand output will be verified
against OUTPUT_TREE. If DISK_TREE is not None, the working copy
itself will be verified against DISK_TREE. If STATUS_TREE is not
@@ -864,11 +873,13 @@ def run_and_verify_update(wc_dir_name,
if error_re_string:
rm = re.compile(error_re_string)
+ match = None
for line in errput:
match = rm.search(line)
if match:
- return
- raise main.SVNUnmatchedError
+ break
+ if not match:
+ raise main.SVNUnmatchedError
actual = wc.State.from_checkout(output)
verify_update(actual, None, None, wc_dir_name,
@@ -1121,7 +1132,7 @@ def run_and_verify_merge(dir, rev1, rev2
for x in out_dry:
logger.warn(x)
logger.warn("The full merge output:")
- for x in out:
+ for x in merge_diff_out:
logger.warn(x)
logger.warn("=============================================================")
raise main.SVNUnmatchedError
@@ -1171,8 +1182,6 @@ def run_and_verify_patch(dir, patch_path
If ERROR_RE_STRING, 'svn patch' must exit with error, and the error
message must match regular expression ERROR_RE_STRING.
- Else if ERROR_RE_STRING is None, then:
-
The subcommand output will be verified against OUTPUT_TREE, and the
working copy itself will be verified against DISK_TREE. If optional
STATUS_TREE is given, then 'svn status' output will be compared.
@@ -1341,7 +1350,6 @@ def run_and_verify_switch(wc_dir_name,
error_re_string = ".*(" + error_re_string + ")"
expected_err = verify.RegexOutput(error_re_string, match_all=False)
verify.verify_outputs(None, None, errput, None, expected_err)
- return
elif errput:
raise verify.SVNUnexpectedStderr(err)
@@ -1353,7 +1361,7 @@ def run_and_verify_switch(wc_dir_name,
singleton_handler_b, b_baton,
check_props)
-def process_output_for_commit(output):
+def process_output_for_commit(output, error_re_string):
"""Helper for run_and_verify_commit(), also used in the factory."""
# Remove the final output line, and verify that the commit succeeded.
lastline = ""
@@ -1372,7 +1380,7 @@ def process_output_for_commit(output):
cm = re.compile("(Committed|Imported) revision [0-9]+.")
match = cm.search(lastline)
- if not match:
+ if not match and not error_re_string:
logger.warn("ERROR: commit did not succeed.")
logger.warn("The final line from 'svn ci' was:")
logger.warn(lastline)
@@ -1417,8 +1425,6 @@ def run_and_verify_commit(wc_dir_name, o
if isinstance(output_tree, wc.State):
output_tree = output_tree.old_tree()
- if isinstance(status_tree, wc.State):
- status_tree = status_tree.old_tree()
# Commit.
if '-m' not in args and '-F' not in args:
@@ -1431,22 +1437,22 @@ def run_and_verify_commit(wc_dir_name, o
error_re_string = ".*(" + error_re_string + ")"
expected_err = verify.RegexOutput(error_re_string, match_all=False)
verify.verify_outputs(None, None, errput, None, expected_err)
- return
# Else not expecting error:
# Convert the output into a tree.
- output = process_output_for_commit(output)
+ output = process_output_for_commit(output, error_re_string)
actual = tree.build_tree_from_commit(output)
# Verify actual output against expected output.
- try:
- tree.compare_trees("output", actual, output_tree)
- except tree.SVNTreeError:
- verify.display_trees("Output of commit is unexpected",
- "OUTPUT TREE", output_tree, actual)
- _log_tree_state("ACTUAL OUTPUT TREE:", actual, wc_dir_name)
- raise
+ if output_tree:
+ try:
+ tree.compare_trees("output", actual, output_tree)
+ except tree.SVNTreeError:
+ verify.display_trees("Output of commit is unexpected",
+ "OUTPUT TREE", output_tree, actual)
+ _log_tree_state("ACTUAL OUTPUT TREE:", actual, wc_dir_name)
+ raise
# Verify via 'status' command too, if possible.
if status_tree:
@@ -1475,7 +1481,7 @@ def run_and_verify_status(wc_dir_name, o
exit_code, output, errput = main.run_svn(None, 'status', '-v', '-u', '-q',
wc_dir_name)
- actual = tree.build_tree_from_status(output)
+ actual = tree.build_tree_from_status(output, wc_dir_name=wc_dir_name)
# Verify actual output against expected output.
try:
@@ -1514,7 +1520,7 @@ def run_and_verify_unquiet_status(wc_dir
exit_code, output, errput = main.run_svn(None, 'status', '-v',
'-u', wc_dir_name)
- actual = tree.build_tree_from_status(output)
+ actual = tree.build_tree_from_status(output, wc_dir_name=wc_dir_name)
# Verify actual output against expected output.
try:
@@ -1918,7 +1924,11 @@ def get_wc_base_rev(wc_dir):
def hook_failure_message(hook_name):
"""Return the error message that the client prints for failure of the
specified hook HOOK_NAME. The wording changed with Subversion 1.5."""
- if svntest.main.options.server_minor_version < 5:
+
+ # Output depends on the server version, not the repository version.
+ # This gets the wrong result for modern servers with old format
+ # repositories.
+ if svntest.main.options.server_minor_version < 5 and not svntest.main.is_ra_type_file():
return "'%s' hook failed with error output:\n" % hook_name
else:
if hook_name in ["start-commit", "pre-commit"]:
@@ -2020,7 +2030,7 @@ def check_prop(name, path, exp_out, revp
else:
revprop_options = []
# Not using run_svn because binary_mode must be set
- exit_code, out, err = main.run_command(main.svn_binary, None, 1, 'pg',
+ exit_code, out, err = main.run_command(main.svn_binary, None, True, 'pg',
'--strict', name, path,
'--config-dir',
main.default_config_dir,