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 2010/12/02 21:55:18 UTC
svn commit: r1041580 [32/35] - in
/subversion/branches/gpg-agent-password-store: ./ build/ build/ac-macros/
build/generator/ build/generator/templates/ build/win32/
contrib/hook-scripts/ contrib/server-side/ notes/http-and-webdav/
notes/wc-ng/ subversi...
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/prop_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/prop_tests.py Thu Dec 2 20:55:08 2010
@@ -55,11 +55,11 @@ def make_local_props(sbox):
wc_dir = sbox.wc_dir
# Add properties to one file and one directory
- sbox.simple_propset('blue', 'azul', sbox.ospath('A/mu'))
- sbox.simple_propset('green', 'verde', sbox.ospath('A/mu'))
- sbox.simple_propset('editme', 'the foo fighters', sbox.ospath('A/mu'))
- sbox.simple_propset('red', 'rojo', sbox.ospath('A/D/G'))
- sbox.simple_propset('yellow', 'amarillo', sbox.ospath('A/D/G'))
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('green', 'verde', 'A/mu')
+ sbox.simple_propset('editme', 'the foo fighters', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/G')
+ sbox.simple_propset('yellow', 'amarillo', 'A/D/G')
# Make sure they show up as local mods in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -69,7 +69,7 @@ def make_local_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Remove one property
- sbox.simple_propdel('yellow', sbox.ospath('A/D/G'))
+ sbox.simple_propdel('yellow', 'A/D/G')
svntest.main.use_editor('foo_to_bar')
# Edit one property
@@ -111,10 +111,8 @@ def commit_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file and a directory
- mu_path = sbox.ospath('A/mu')
- H_path = sbox.ospath('A/D/H')
- sbox.simple_propset('blue', 'azul', mu_path)
- sbox.simple_propset('red', 'rojo', H_path)
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/H')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -149,10 +147,8 @@ def update_props(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Add a property to a file and a directory
- mu_path = sbox.ospath('A/mu')
- H_path = sbox.ospath('A/D/H')
- sbox.simple_propset('blue', 'azul', mu_path)
- sbox.simple_propset('red', 'rojo', H_path)
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_propset('red', 'rojo', 'A/D/H')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -164,15 +160,18 @@ def update_props(sbox):
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/mu', 'A/D/H', wc_rev=2, status=' ')
- # Commit the one file.
+ # Commit property mods
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status,
None, wc_dir)
- # Overwrite mu_path and H_path to refer to the backup copies from
- # here on out.
- mu_path = sbox.ospath('A/mu', wc_dir=wc_backup)
- H_path = sbox.ospath('A/D/H', wc_dir=wc_backup)
+ # Add more properties
+ sbox.simple_propset('blue2', 'azul2', 'A/mu')
+ sbox.simple_propset('red2', 'rojo2', 'A/D/H')
+ expected_status.tweak('A/mu', 'A/D/H', wc_rev=3, status=' ')
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status,
+ None, wc_dir)
# Create expected output tree for an update of the wc_backup.
expected_output = svntest.wc.State(wc_backup, {
@@ -190,11 +189,27 @@ def update_props(sbox):
expected_status.tweak('A/mu', 'A/D/H', status=' ')
# Do the update and check the results in three ways... INCLUDING PROPS
+ # This adds properties to nodes that have none
svntest.actions.run_and_verify_update(wc_backup,
expected_output,
expected_disk,
expected_status,
- None, None, None, None, None, 1)
+ None, None, None, None, None, 1,
+ '-r', '2', wc_backup)
+
+ # This adds properties to nodes that have properties
+ expected_status.tweak(wc_rev=3)
+ expected_disk.tweak('A/mu', props={'blue' : 'azul',
+ 'blue2' : 'azul2'})
+ expected_disk.tweak('A/D/H', props={'red' : 'rojo',
+ 'red2' : 'rojo2'})
+ svntest.actions.run_and_verify_update(wc_backup,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None, 1,
+ '-r', '3', wc_backup)
+
#----------------------------------------------------------------------
@@ -205,11 +220,10 @@ def downdate_props(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = sbox.ospath('iota')
mu_path = sbox.ospath('A/mu')
# Add a property to a file
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -273,14 +287,13 @@ def remove_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file
- iota_path = sbox.ospath('iota')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
# Commit the file
- sbox.simple_commit(iota_path)
+ sbox.simple_commit('iota')
# Now, remove the property
- sbox.simple_propdel('cash-sound', iota_path)
+ sbox.simple_propdel('cash-sound', 'iota')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -307,9 +320,9 @@ def update_conflict_props(sbox):
# Add a property to a file and a directory
mu_path = sbox.ospath('A/mu')
- sbox.simple_propset('cash-sound', 'cha-ching!', mu_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'A/mu')
A_path = sbox.ospath('A')
- sbox.simple_propset('foo', 'bar', A_path)
+ sbox.simple_propset('foo', 'bar', 'A')
# Commit the file and directory
sbox.simple_commit()
@@ -318,8 +331,8 @@ def update_conflict_props(sbox):
svntest.main.run_svn(None, 'up', '-r', '1', wc_dir)
# Add conflicting properties
- sbox.simple_propset('cash-sound', 'beep!', mu_path)
- sbox.simple_propset('foo', 'baz', A_path)
+ sbox.simple_propset('cash-sound', 'beep!', 'A/mu')
+ sbox.simple_propset('foo', 'baz', 'A')
# Create expected output tree for an update of the wc_backup.
expected_output = svntest.wc.State(wc_dir, {
@@ -370,7 +383,7 @@ def commit_conflict_dirprops(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- sbox.simple_propset('foo', 'bar', wc_dir)
+ sbox.simple_propset('foo', 'bar', '')
# Commit the file and directory
sbox.simple_commit()
@@ -380,7 +393,7 @@ def commit_conflict_dirprops(sbox):
'up', '-r', '1', wc_dir)
# Add conflicting properties
- sbox.simple_propset('foo', 'eek', wc_dir)
+ sbox.simple_propset('foo', 'eek', '')
svntest.actions.run_and_verify_commit(wc_dir, None, None,
"[oO]ut[- ]of[- ]date",
@@ -404,20 +417,20 @@ def commit_replacement_props(sbox):
# Add a property to two files
iota_path = sbox.ospath('iota')
lambda_path = sbox.ospath('A/B/lambda')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
- sbox.simple_propset('boson', 'W', lambda_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
+ sbox.simple_propset('boson', 'W', 'A/B/lambda')
# Commit (### someday use run_and_verify_commit for better coverage)
sbox.simple_commit()
# Schedule both files for deletion
- sbox.simple_rm(iota_path, lambda_path)
+ sbox.simple_rm('iota', 'A/B/lambda')
# Now recreate the files, and schedule them for addition.
# Poof, the 'new' files don't have any properties at birth.
svntest.main.file_append(iota_path, 'iota TNG')
svntest.main.file_append(lambda_path, 'lambda TNG')
- sbox.simple_add(iota_path, lambda_path)
+ sbox.simple_add('iota', 'A/B/lambda')
# Sanity check: the two files should be scheduled for (R)eplacement.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -427,7 +440,7 @@ def commit_replacement_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Now add a property to lambda. Iota still doesn't have any.
- sbox.simple_propset('capacitor', 'flux', lambda_path)
+ sbox.simple_propset('capacitor', 'flux', 'A/B/lambda')
# Commit, with careful output checking. We're actually going to
# scan the working copy for props after the commit.
@@ -458,20 +471,20 @@ def revert_replacement_props(sbox):
# Add a property to two files
iota_path = sbox.ospath('iota')
lambda_path = sbox.ospath('A/B/lambda')
- sbox.simple_propset('cash-sound', 'cha-ching!', iota_path)
- sbox.simple_propset('boson', 'W', lambda_path)
+ sbox.simple_propset('cash-sound', 'cha-ching!', 'iota')
+ sbox.simple_propset('boson', 'W', 'A/B/lambda')
# Commit rev 2. (### someday use run_and_verify_commit for better coverage)
sbox.simple_commit()
# Schedule both files for deletion
- sbox.simple_rm(iota_path, lambda_path)
+ sbox.simple_rm('iota', 'A/B/lambda')
# Now recreate the files, and schedule them for addition.
# Poof, the 'new' files don't have any properties at birth.
svntest.main.file_append(iota_path, 'iota TNG')
svntest.main.file_append(lambda_path, 'lambda TNG')
- sbox.simple_add(iota_path, lambda_path)
+ sbox.simple_add('iota', 'A/B/lambda')
# Sanity check: the two files should be scheduled for (R)eplacement.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -481,10 +494,10 @@ def revert_replacement_props(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Now add a property to lambda. Iota still doesn't have any.
- sbox.simple_propset('capacitor', 'flux', lambda_path)
+ sbox.simple_propset('capacitor', 'flux', 'A/B/lambda')
# Now revert both files.
- sbox.simple_revert(iota_path, lambda_path)
+ sbox.simple_revert('iota', 'A/B/lambda')
# Do an update; even though the update is really a no-op,
# run_and_verify_update has the nice feature of scanning disk as
@@ -592,9 +605,9 @@ def inappropriate_props(sbox):
path = sbox.ospath('binary')
svntest.main.file_append(path, "binary")
- sbox.simple_add(path)
+ sbox.simple_add('binary')
- sbox.simple_propset('svn:mime-type', 'application/octet-stream', path)
+ sbox.simple_propset('svn:mime-type', 'application/octet-stream', 'binary')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -603,7 +616,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('multi-eol')
svntest.main.file_append(path, "line1\rline2\n")
- sbox.simple_add(path)
+ sbox.simple_add('multi-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -612,7 +625,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('backwards-eol')
svntest.main.file_append(path, "line1\n\r")
- sbox.simple_add(path)
+ sbox.simple_add('backwards-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -621,7 +634,7 @@ def inappropriate_props(sbox):
path = sbox.ospath('incomplete-eol')
svntest.main.file_append(path, "line1\r\n\r")
- sbox.simple_add(path)
+ sbox.simple_add('incomplete-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
@@ -732,10 +745,10 @@ def copy_inherits_special_props(sbox):
# Create the first path as a binary file. To have svn treat the
# file as binary, have a 0x00 in the file.
svntest.main.file_append(new_path1, "binary file\000")
- sbox.simple_add(new_path1)
+ sbox.simple_add('new_file1.bin')
# Add initial svn:mime-type to the file
- sbox.simple_propset('svn:mime-type', orig_mime_type, new_path1)
+ sbox.simple_propset('svn:mime-type', orig_mime_type, 'new_file1.bin')
# Set the svn:executable property on the file if this is a system
# that can handle chmod, in which case svn will turn on the
@@ -743,7 +756,7 @@ def copy_inherits_special_props(sbox):
# manually on the file and see the value of svn:executable in the
# copied file.
if os.name == 'posix':
- sbox.simple_propset('svn:executable', 'on', new_path1)
+ sbox.simple_propset('svn:executable', 'on', 'new_file1.bin')
os.chmod(new_path1, 0644)
# Commit the file
@@ -1039,18 +1052,18 @@ def recursive_base_wc_ops(sbox):
# Files with which to test, in alphabetical order
fp_add = sbox.ospath('A/added')
fp_del = sbox.ospath('A/mu')
- fp_keep= sbox.ospath('iota')
+ #fp_keep= sbox.ospath('iota')
# Set up properties
- sbox.simple_propset('p', 'old-del', fp_del)
- sbox.simple_propset('p', 'old-keep', fp_keep)
+ sbox.simple_propset('p', 'old-del', 'A/mu')
+ sbox.simple_propset('p', 'old-keep', 'iota')
sbox.simple_commit()
svntest.main.file_append(fp_add, 'blah')
- sbox.simple_add(fp_add)
- sbox.simple_propset('p', 'new-add', fp_add)
- sbox.simple_propset('p', 'new-del', fp_del)
- sbox.simple_propset('p', 'new-keep', fp_keep)
+ sbox.simple_add('A/added')
+ sbox.simple_propset('p', 'new-add', 'A/added')
+ sbox.simple_propset('p', 'new-del', 'A/mu')
+ sbox.simple_propset('p', 'new-keep', 'iota')
svntest.main.run_svn(None, 'del', '--force', fp_del)
# Test recursive proplist
@@ -1108,21 +1121,19 @@ def url_props_ops(sbox):
prop2 = 'prop2'
propval2 = 'propval2'
- iota_path = sbox.ospath('iota')
iota_url = sbox.repo_url + '/iota'
- A_path = sbox.ospath('A')
A_url = sbox.repo_url + '/A'
# Add a couple of properties
- sbox.simple_propset(prop1, propval1, iota_path)
- sbox.simple_propset(prop1, propval1, A_path)
+ sbox.simple_propset(prop1, propval1, 'iota')
+ sbox.simple_propset(prop1, propval1, 'A')
# Commit
sbox.simple_commit()
# Add a few more properties
- sbox.simple_propset(prop2, propval2, iota_path)
- sbox.simple_propset(prop2, propval2, A_path)
+ sbox.simple_propset(prop2, propval2, 'iota')
+ sbox.simple_propset(prop2, propval2, 'A')
# Commit again
sbox.simple_commit()
@@ -1232,7 +1243,7 @@ def update_props_on_wc_root(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Add a property to the root folder
- sbox.simple_propset('red', 'rojo', wc_dir)
+ sbox.simple_propset('red', 'rojo', '')
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
@@ -1277,14 +1288,14 @@ def props_on_replaced_file(sbox):
# Add some properties to iota
iota_path = sbox.ospath("iota")
- sbox.simple_propset('red', 'rojo', iota_path)
- sbox.simple_propset('blue', 'lagoon', iota_path)
+ sbox.simple_propset('red', 'rojo', 'iota')
+ sbox.simple_propset('blue', 'lagoon', 'iota')
sbox.simple_commit()
# replace iota_path
- sbox.simple_rm(iota_path)
+ sbox.simple_rm('iota')
svntest.main.file_append(iota_path, "some mod")
- sbox.simple_add(iota_path)
+ sbox.simple_add('iota')
# check that the replaced file has no properties
expected_disk = svntest.main.greek_state.copy()
@@ -1294,8 +1305,8 @@ def props_on_replaced_file(sbox):
expected_disk.old_tree())
# now add a new property to iota
- sbox.simple_propset('red', 'mojo', iota_path)
- sbox.simple_propset('groovy', 'baby', iota_path)
+ sbox.simple_propset('red', 'mojo', 'iota')
+ sbox.simple_propset('groovy', 'baby', 'iota')
# What we expect the disk tree to look like:
expected_disk.tweak('iota', props={'red' : 'mojo', 'groovy' : 'baby'})
@@ -1311,15 +1322,11 @@ def depthy_wc_proplist(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- A_path = sbox.ospath('A')
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
-
# Set up properties.
- sbox.simple_propset('p', 'prop1', wc_dir)
- sbox.simple_propset('p', 'prop2', iota_path)
- sbox.simple_propset('p', 'prop3', A_path)
- sbox.simple_propset('p', 'prop4', mu_path)
+ sbox.simple_propset('p', 'prop1', '')
+ sbox.simple_propset('p', 'prop2', 'iota')
+ sbox.simple_propset('p', 'prop3', 'A')
+ sbox.simple_propset('p', 'prop4', 'A/mu')
# Commit.
sbox.simple_commit()
@@ -1366,15 +1373,11 @@ def depthy_url_proplist(sbox):
repo_url = sbox.repo_url
wc_dir = sbox.wc_dir
- A_path = sbox.ospath('A')
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
-
# Set up properties.
- sbox.simple_propset('p', 'prop1', wc_dir)
- sbox.simple_propset('p', 'prop2', iota_path)
- sbox.simple_propset('p', 'prop3', A_path)
- sbox.simple_propset('p', 'prop4', mu_path)
+ sbox.simple_propset('p', 'prop1', '')
+ sbox.simple_propset('p', 'prop2', 'iota')
+ sbox.simple_propset('p', 'prop3', 'A')
+ sbox.simple_propset('p', 'prop4', 'A/mu')
# Test depth-empty proplist.
exit_code, output, errput = svntest.main.run_svn(None, 'proplist',
@@ -1488,18 +1491,17 @@ def remove_custom_ns_props(sbox):
wc_dir = sbox.wc_dir
# Add a property to a file
- iota_path = sbox.ospath('iota')
- sbox.simple_propset('ns:cash-sound', 'cha-ching!', iota_path)
+ sbox.simple_propset('ns:cash-sound', 'cha-ching!', 'iota')
# Commit the file
- sbox.simple_commit(iota_path)
+ sbox.simple_commit('iota')
# Now, make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Remove the property
- sbox.simple_propdel('ns:cash-sound', iota_path)
+ sbox.simple_propdel('ns:cash-sound', 'iota')
# Create expected trees.
expected_output = svntest.wc.State(wc_dir, {
@@ -1542,8 +1544,8 @@ def props_over_time(sbox):
# Add/tweak a property 'revision' with value revision-committed to a
# file, commit, and then repeat this a few times.
for rev in range(2, 4):
- sbox.simple_propset('revision', str(rev), iota_path)
- sbox.simple_commit(iota_path)
+ sbox.simple_propset('revision', str(rev), 'iota')
+ sbox.simple_commit('iota')
# Backdate to r2 so the defaults for URL- vs. WC-style queries are
# different.
@@ -1629,18 +1631,18 @@ def same_replacement_props(sbox):
foo_path = sbox.ospath('foo')
open(foo_path, 'w').close()
- sbox.simple_add(foo_path)
- sbox.simple_propset('someprop', 'someval', foo_path)
- sbox.simple_commit(foo_path)
- sbox.simple_rm(foo_path)
+ sbox.simple_add('foo')
+ sbox.simple_propset('someprop', 'someval', 'foo')
+ sbox.simple_commit('foo')
+ sbox.simple_rm('foo')
# Now replace 'foo'.
open(foo_path, 'w').close()
- sbox.simple_add(foo_path)
+ sbox.simple_add('foo')
# Set the same property again, with the same value.
- sbox.simple_propset('someprop', 'someval', foo_path)
- sbox.simple_commit(foo_path)
+ sbox.simple_propset('someprop', 'someval', 'foo')
+ sbox.simple_commit('foo')
# Check if the property made it into the repository.
foo_url = sbox.repo_url + '/foo'
@@ -1664,8 +1666,8 @@ def added_moved_file(sbox):
open(foo_path, 'w').close()
# add it
- sbox.simple_add(foo_path)
- sbox.simple_propset('someprop', 'someval', foo_path)
+ sbox.simple_add('foo')
+ sbox.simple_propset('someprop', 'someval', 'foo')
# move it
svntest.main.run_svn(None, 'mv', foo_path, foo2_path)
@@ -1731,17 +1733,17 @@ def rm_of_replaced_file(sbox):
# Add some properties to iota and mu
iota_path = sbox.ospath('iota')
- sbox.simple_propset('red', 'rojo', iota_path)
- sbox.simple_propset('blue', 'lagoon', iota_path)
+ sbox.simple_propset('red', 'rojo', 'iota')
+ sbox.simple_propset('blue', 'lagoon', 'iota')
mu_path = sbox.ospath('A/mu')
- sbox.simple_propset('yellow', 'submarine', mu_path)
- sbox.simple_propset('orange', 'toothpick', mu_path)
+ sbox.simple_propset('yellow', 'submarine', 'A/mu')
+ sbox.simple_propset('orange', 'toothpick', 'A/mu')
sbox.simple_commit()
# Copy iota over the top of mu
- sbox.simple_rm(mu_path)
+ sbox.simple_rm('A/mu')
svntest.main.run_svn(None, 'cp', iota_path, mu_path)
expected_disk = svntest.main.greek_state.copy()
@@ -1785,7 +1787,6 @@ def prop_reject_grind(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = sbox.ospath('iota')
mu_path = sbox.ospath('A/mu')
mu_prej_path = sbox.ospath('A/mu.prej')
@@ -1793,60 +1794,60 @@ def prop_reject_grind(sbox):
# and as incoming-delete. Also set up our local-edit and local-delete
# properties. We also need some properties that are simply different
# from the incoming properties
- sbox.simple_propset('edit.diff', 'repos', iota_path)
- sbox.simple_propset('edit.edit', 'repos', iota_path)
- sbox.simple_propset('edit.del', 'repos', iota_path)
- sbox.simple_propset('edit.add', 'repos', iota_path)
- sbox.simple_propset('edit.none', 'repos', iota_path)
- sbox.simple_propset('del.edit', 'repos', iota_path)
- sbox.simple_propset('del.edit2', 'repos', iota_path)
- sbox.simple_propset('del.diff', 'repos', iota_path)
- sbox.simple_propset('del.del', 'repos', iota_path)
- sbox.simple_propset('del.add', 'repos', iota_path)
-
- sbox.simple_propset('edit.edit', 'local', mu_path)
- sbox.simple_propset('add.edit', 'local', mu_path)
- sbox.simple_propset('del.edit', 'local', mu_path)
- sbox.simple_propset('del.edit2', 'repos', mu_path)
- sbox.simple_propset('add.del', 'local', mu_path)
- sbox.simple_propset('edit.del', 'local', mu_path)
- sbox.simple_propset('del.del', 'local', mu_path)
- sbox.simple_propset('edit.diff', 'local', mu_path)
- sbox.simple_propset('add.diff', 'local', mu_path)
- sbox.simple_propset('del.diff', 'local', mu_path)
+ sbox.simple_propset('edit.diff', 'repos', 'iota')
+ sbox.simple_propset('edit.edit', 'repos', 'iota')
+ sbox.simple_propset('edit.del', 'repos', 'iota')
+ sbox.simple_propset('edit.add', 'repos', 'iota')
+ sbox.simple_propset('edit.none', 'repos', 'iota')
+ sbox.simple_propset('del.edit', 'repos', 'iota')
+ sbox.simple_propset('del.edit2', 'repos', 'iota')
+ sbox.simple_propset('del.diff', 'repos', 'iota')
+ sbox.simple_propset('del.del', 'repos', 'iota')
+ sbox.simple_propset('del.add', 'repos', 'iota')
+
+ sbox.simple_propset('edit.edit', 'local', 'A/mu')
+ sbox.simple_propset('add.edit', 'local', 'A/mu')
+ sbox.simple_propset('del.edit', 'local', 'A/mu')
+ sbox.simple_propset('del.edit2', 'repos', 'A/mu')
+ sbox.simple_propset('add.del', 'local', 'A/mu')
+ sbox.simple_propset('edit.del', 'local', 'A/mu')
+ sbox.simple_propset('del.del', 'local', 'A/mu')
+ sbox.simple_propset('edit.diff', 'local', 'A/mu')
+ sbox.simple_propset('add.diff', 'local', 'A/mu')
+ sbox.simple_propset('del.diff', 'local', 'A/mu')
sbox.simple_commit()
# Create r3 with all the properties that we intend to use as incoming-add,
# and then perform the incoming-edits and incoming-deletes.
- sbox.simple_propset('add.add', 'repos', iota_path)
- sbox.simple_propset('add.edit', 'repos', iota_path)
- sbox.simple_propset('add.del', 'repos', iota_path)
- sbox.simple_propset('add.diff', 'repos', iota_path)
- sbox.simple_propset('edit.diff', 'repos.changed', iota_path)
- sbox.simple_propset('edit.edit', 'repos.changed', iota_path)
- sbox.simple_propset('edit.del', 'repos.changed', iota_path)
- sbox.simple_propset('edit.add', 'repos.changed', iota_path)
- sbox.simple_propset('edit.none', 'repos.changed', iota_path)
- sbox.simple_propdel('del.edit', iota_path)
- sbox.simple_propdel('del.edit2', iota_path)
- sbox.simple_propdel('del.diff', iota_path)
- sbox.simple_propdel('del.del', iota_path)
- sbox.simple_propdel('del.add', iota_path)
+ sbox.simple_propset('add.add', 'repos', 'iota')
+ sbox.simple_propset('add.edit', 'repos', 'iota')
+ sbox.simple_propset('add.del', 'repos', 'iota')
+ sbox.simple_propset('add.diff', 'repos', 'iota')
+ sbox.simple_propset('edit.diff', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.edit', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.del', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.add', 'repos.changed', 'iota')
+ sbox.simple_propset('edit.none', 'repos.changed', 'iota')
+ sbox.simple_propdel('del.edit', 'iota')
+ sbox.simple_propdel('del.edit2', 'iota')
+ sbox.simple_propdel('del.diff', 'iota')
+ sbox.simple_propdel('del.del', 'iota')
+ sbox.simple_propdel('del.add', 'iota')
sbox.simple_commit()
# Set up our victim for all the right rejects: local-adds, local-edits,
# and local-deletes.
- sbox.simple_propset('edit.add', 'local', mu_path)
- sbox.simple_propset('add.add', 'local', mu_path)
- sbox.simple_propset('del.add', 'local', mu_path)
- sbox.simple_propset('edit.edit', 'local.changed', mu_path)
- sbox.simple_propset('add.edit', 'local.changed', mu_path)
- sbox.simple_propset('del.edit', 'local.changed', mu_path)
- sbox.simple_propset('del.edit2', 'repos.changed', mu_path)
- sbox.simple_propdel('add.del', mu_path)
- sbox.simple_propdel('edit.del', mu_path)
- sbox.simple_propdel('del.del', mu_path)
+ sbox.simple_propset('edit.add', 'local', 'A/mu')
+ sbox.simple_propset('add.add', 'local', 'A/mu')
+ sbox.simple_propset('del.add', 'local', 'A/mu')
+ sbox.simple_propset('edit.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('add.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('del.edit', 'local.changed', 'A/mu')
+ sbox.simple_propset('del.edit2', 'repos.changed', 'A/mu')
+ sbox.simple_propdel('add.del', 'A/mu')
+ sbox.simple_propdel('edit.del', 'A/mu')
+ sbox.simple_propdel('del.del', 'A/mu')
# Now merge r2:3 into the victim to create all variants
svntest.main.run_svn(False, 'merge', '-r2:3', sbox.repo_url + '/iota',
@@ -1927,7 +1928,7 @@ def obstructed_subdirs(sbox):
# this test ensures we won't run into that problem again.
C_path = sbox.ospath('A/C')
- sbox.simple_propset('red', 'blue', C_path)
+ sbox.simple_propset('red', 'blue', 'A/C')
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/C', props={'red': 'blue'})
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/redirect_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/redirect_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/redirect_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/redirect_tests.py Thu Dec 2 20:55:08 2010
@@ -129,7 +129,9 @@ def redirected_update(sbox):
exit_code, out, err = svntest.main.run_svn(None, 'up', wc_dir)
if err:
raise svntest.Failure
- if not redirect_regex.match(out[0]):
+ if not re.match("^Updating '.*' ...", out[0]):
+ raise svntest.Failure
+ if not redirect_regex.match(out[1]):
raise svntest.Failure
# Verify that we have the expected URL.
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/resolve_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/resolve_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/resolve_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/resolve_tests.py Thu Dec 2 20:55:08 2010
@@ -72,7 +72,7 @@ def automatic_conflict_resolution(sbox):
"( U .*A_COPY\n)|"
"(Summary of conflicts:\n)|"
"( Text conflicts: 1\n)",
- [], 'merge', '-c3',
+ [], 'merge', '-c3', '--allow-mixed-revisions',
sbox.repo_url + '/A',
A_COPY_path)
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/revert_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/revert_tests.py Thu Dec 2 20:55:08 2010
@@ -847,15 +847,7 @@ def status_of_missing_dir_after_revert_r
dry_run = 0)
# now test if the revert works ok
- revert_paths = [G_path,
- os.path.join(G_path, 'alpha'),
- os.path.join(G_path, 'beta')]
-
- if svntest.main.wc_is_singledb(wc_dir):
- # These nodes are not lost in single-db
- revert_paths += [ os.path.join(G_path, 'pi'),
- os.path.join(G_path, 'rho'),
- os.path.join(G_path, 'tau')]
+ revert_paths = [G_path]
expected_output = svntest.verify.UnorderedOutput([
"Reverted '%s'\n" % path for path in revert_paths])
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/schedule_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/schedule_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/schedule_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/schedule_tests.py Thu Dec 2 20:55:08 2010
@@ -37,7 +37,7 @@ SkipUnless = svntest.testcase.SkipUnless
XFail = svntest.testcase.XFail
Wimp = svntest.testcase.Wimp
Item = svntest.wc.StateItem
-
+exp_noop_up_out = svntest.actions.expected_noop_update_output
######################################################################
# Tests
@@ -71,7 +71,7 @@ def add_files(sbox):
svntest.main.file_append(zeta_path, "This is the file 'zeta'.")
svntest.main.file_append(epsilon_path, "This is the file 'epsilon'.")
- sbox.simple_add(delta_path, zeta_path, epsilon_path)
+ sbox.simple_add('delta', 'A/B/zeta', 'A/D/G/epsilon')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -100,7 +100,7 @@ def add_directories(sbox):
os.mkdir(Y_path)
os.mkdir(Z_path)
- sbox.simple_add(X_path, Y_path, Z_path)
+ sbox.simple_add('X', 'A/C/Y', 'A/D/H/Z')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -150,7 +150,7 @@ def nested_adds(sbox):
svntest.main.file_append(zeta_path, "This is the file 'zeta'.")
# Finally, let's try adding our new files and directories
- sbox.simple_add(X_path, Y_path, Z_path)
+ sbox.simple_add('X', 'A/C/Y', 'A/D/H/Z')
# Make sure the adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -177,19 +177,19 @@ def add_executable(sbox):
sbox.build(read_only = True)
def runTest(wc_dir, fileName, perm, executable):
- fileName = sbox.ospath(fileName)
+ file_ospath = sbox.ospath(fileName)
if executable:
expected_out = ["*\n"]
else:
expected_out = []
# create an empty file
- open(fileName, "w")
+ open(file_ospath, "w")
- os.chmod(fileName, perm)
+ os.chmod(file_ospath, perm)
sbox.simple_add(fileName)
svntest.actions.run_and_verify_svn(None, expected_out, [],
- 'propget', "svn:executable", fileName)
+ 'propget', "svn:executable", file_ospath)
test_cases = [
("all_exe", 0777, 1),
@@ -210,12 +210,7 @@ def delete_files(sbox):
wc_dir = sbox.wc_dir
# Schedule some files for deletion
- iota_path = sbox.ospath('iota')
- mu_path = sbox.ospath('A/mu')
- rho_path = sbox.ospath('A/D/G/rho')
- omega_path = sbox.ospath('A/D/H/omega')
-
- sbox.simple_rm(iota_path, mu_path, rho_path, omega_path)
+ sbox.simple_rm('iota', 'A/mu', 'A/D/G/rho', 'A/D/H/omega')
# Make sure the deletes show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -233,17 +228,7 @@ def delete_dirs(sbox):
wc_dir = sbox.wc_dir
# Schedule some directories for deletion (this is recursive!)
- E_path = sbox.ospath('A/B/E')
- F_path = sbox.ospath('A/B/F')
- H_path = sbox.ospath('A/D/H')
- alpha_path = sbox.ospath('A/B/E/alpha')
- beta_path = sbox.ospath('A/B/E/beta')
- chi_path = sbox.ospath('A/D/H/chi')
- omega_path = sbox.ospath('A/D/H/omega')
- psi_path = sbox.ospath('A/D/H/psi')
-
- # Now, delete (recursively) the directories.
- sbox.simple_rm(E_path, F_path, H_path)
+ sbox.simple_rm('A/B/E', 'A/B/F', 'A/D/H')
# Make sure the deletes show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -430,8 +415,8 @@ def unschedule_missing_added(sbox):
svntest.main.file_append(file1_path, "This is the file 'file1'.")
svntest.main.file_append(file2_path, "This is the file 'file2'.")
- sbox.simple_add(file1_path, file2_path)
- sbox.simple_mkdir(dir1_path, dir2_path)
+ sbox.simple_add('file1', 'file2')
+ sbox.simple_mkdir('dir1', 'dir2')
# Make sure the 4 adds show up as such in status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -456,8 +441,8 @@ def unschedule_missing_added(sbox):
svntest.main.run_svn(svntest.verify.AnyOutput, 'rm', file1_path)
### actually, the stub does not provide enough information to revert
### the addition, so this command will fail. marking as XFail
- sbox.simple_rm(dir1_path)
- sbox.simple_revert(file2_path, dir2_path)
+ sbox.simple_rm('dir1')
+ sbox.simple_revert('file2', 'dir2')
# 'svn st' should now show absolutely zero local mods.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -483,7 +468,7 @@ def delete_missing(sbox):
svntest.main.safe_rmtree(H_path)
# Now schedule them for deletion anyway, and make sure no error is output.
- sbox.simple_rm(mu_path, H_path)
+ sbox.simple_rm('A/mu', 'A/D/H')
# Commit the deletions.
expected_output = svntest.wc.State(wc_dir, {
@@ -511,18 +496,14 @@ def revert_inside_newly_added_dir(sbox):
"revert inside a newly added dir"
sbox.build(read_only = True)
- wc_dir = sbox.wc_dir
-
- os.chdir(wc_dir)
# Schedule a new directory for addition
- os.mkdir('foo')
- sbox.simple_add('foo')
+ sbox.simple_mkdir('foo')
# Now change into the newly added directory, revert and make sure
# no error is output.
- os.chdir('foo')
- sbox.simple_revert('.')
+ os.chdir(sbox.ospath('foo'))
+ svntest.main.run_svn(None, 'revert', '.')
#----------------------------------------------------------------------
# Regression test for issue #1609:
@@ -546,11 +527,11 @@ def status_add_deleted_directory(sbox):
A_path = sbox.ospath('A')
- sbox.simple_rm(A_path)
+ sbox.simple_rm('A')
svntest.main.safe_rmtree(A_path)
sbox.simple_commit()
- sbox.simple_mkdir(A_path)
+ sbox.simple_mkdir('A')
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
expected_status = svntest.wc.State(wc_dir,
@@ -562,7 +543,7 @@ def status_add_deleted_directory(sbox):
# Update will *not* remove the entry for A despite it being marked
# deleted.
- svntest.actions.run_and_verify_svn(None, ['At revision 2.\n'], [],
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(2), [],
'up', wc_dir)
expected_status.tweak('', 'iota', wc_rev=2)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/special_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/special_tests.py Thu Dec 2 20:55:08 2010
@@ -473,7 +473,7 @@ def merge_file_into_symlink(sbox):
# ok, now merge the change to the file into the symlink we created, this
# gives us a weird error
svntest.main.run_svn(None,
- 'merge', '-r', '4:5', d_url,
+ 'merge', '-r', '4:5', '--allow-mixed-revisions', d_url,
os.path.join(wc_dir, 'A', 'Dprime'))
# Issue 2701: Tests to see repository with symlinks can be checked out on all
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/stat_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/stat_tests.py Thu Dec 2 20:55:08 2010
@@ -1780,6 +1780,20 @@ def status_with_tree_conflicts(sbox):
raise svntest.Failure
+#----------------------------------------------------------------------
+# Regression for issue #3742
+def status_nested_wc_old_format(sbox):
+ "status on wc with nested old-format wc"
+
+ sbox.build(read_only = True)
+ wc_dir = sbox.wc_dir
+ os.mkdir(os.path.join(wc_dir, 'subdir'))
+ os.mkdir(os.path.join(wc_dir, 'subdir', '.svn'))
+ svntest.main.file_append(os.path.join(wc_dir, 'subdir', '.svn', 'format'),
+ '10\n') # format 10 was the Subversion 1.6 format
+ os.chdir(wc_dir)
+ svntest.actions.run_and_verify_svn(None, [ "? subdir\n" ], [], 'st')
+
########################################################################
# Run the tests
@@ -1818,6 +1832,7 @@ test_list = [ None,
status_depth_update,
status_dash_u_type_change,
status_with_tree_conflicts,
+ XFail(status_nested_wc_old_format),
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnrdump_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnrdump_tests.py Thu Dec 2 20:55:08 2010
@@ -340,7 +340,7 @@ test_list = [ None,
tag_trunk_with_file2_dump,
tag_trunk_with_file2_load,
dir_prop_change_dump,
- Wimp("TODO", dir_prop_change_load, svntest.main.is_ra_type_dav),
+ dir_prop_change_load,
copy_parent_modify_prop_dump,
copy_parent_modify_prop_load,
url_encoding_dump,
@@ -348,7 +348,7 @@ test_list = [ None,
copy_revprops_dump,
copy_revprops_load,
only_trunk_dump,
- XFail(only_trunk_A_with_changes_dump, svntest.main.is_os_windows),
+ only_trunk_A_with_changes_dump,
no_author_dump,
no_author_load,
move_and_modify_in_the_same_revision_dump,
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests.py Thu Dec 2 20:55:08 2010
@@ -136,21 +136,14 @@ def run_info(url, expected_error=None):
raise SVNUnexpectedStdout("Missing stdout")
-def run_test(sbox, dump_file_name, subdir = None, exp_dump_file_name = None):
- """Load a dump file, sync repositories, and compare contents with the original
-or another dump file."""
+def setup_and_sync(sbox, dump_file_contents, subdir=None):
+ """Create a repository for SBOX, load it with DUMP_FILE_CONTENTS, then create a mirror repository and sync it with SBOX. Return the mirror sandbox."""
# Create the empty master repository.
build_repos(sbox)
- # This directory contains all the dump files
- svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
- 'svnsync_tests_data')
- # Load the specified dump file into the master repository.
- master_dumpfile_contents = open(os.path.join(svnsync_tests_dir,
- dump_file_name),
- 'rb').readlines()
- svntest.actions.run_and_verify_load(sbox.repo_dir, master_dumpfile_contents)
+ # Load the repository from DUMP_FILE_PATH.
+ svntest.actions.run_and_verify_load(sbox.repo_dir, dump_file_contents)
# Create the empty destination repository.
dest_sbox = sbox.clone_dependent()
@@ -173,6 +166,11 @@ or another dump file."""
run_sync(dest_sbox.repo_url, repo_url)
run_copy_revprops(dest_sbox.repo_url, repo_url)
+ return dest_sbox
+
+def verify_mirror(dest_sbox, exp_dump_file_contents):
+ """Compare the contents of the DEST_SBOX repository with EXP_DUMP_FILE_CONTENTS."""
+
# Remove some SVNSync-specific housekeeping properties from the
# mirror repository in preparation for the comparison dump.
for prop_name in ("svn:sync-from-url", "svn:sync-from-uuid",
@@ -184,6 +182,24 @@ or another dump file."""
# Create a dump file from the mirror repository.
dest_dump = svntest.actions.run_and_verify_dump(dest_sbox.repo_dir)
+ svntest.verify.compare_and_display_lines(
+ "Dump files", "DUMP", exp_dump_file_contents, dest_dump)
+
+def run_test(sbox, dump_file_name, subdir=None, exp_dump_file_name=None):
+ """Load a dump file, sync repositories, and compare contents with the original
+or another dump file."""
+
+ # This directory contains all the dump files
+ svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
+ 'svnsync_tests_data')
+
+ # Load the specified dump file into the master repository.
+ master_dumpfile_contents = open(os.path.join(svnsync_tests_dir,
+ dump_file_name),
+ 'rb').readlines()
+
+ dest_sbox = setup_and_sync(sbox, master_dumpfile_contents, subdir)
+
# Compare the dump produced by the mirror repository with either the original
# dump file (used to create the master repository) or another specified dump
# file.
@@ -193,8 +209,8 @@ or another dump file."""
else:
exp_master_dumpfile_contents = master_dumpfile_contents
- svntest.verify.compare_and_display_lines(
- "Dump files", "DUMP", exp_master_dumpfile_contents, dest_dump)
+ verify_mirror(dest_sbox, exp_master_dumpfile_contents)
+
######################################################################
@@ -775,12 +791,78 @@ def commit_a_copy_of_root(sbox):
#Testcase for issue 3438.
run_test(sbox, "repo_with_copy_of_root_dir.dump")
-# issue #3641
+# issue #3641 'svnsync fails to partially copy a repository'.
+# This currently fails because while replacements with history
+# within copies are handled, replacements without history inside
+# copies cause the sync to fail:
+#
+# >svnsync synchronize %TEST_REPOS_ROOT_URL%/svnsync_tests-29-1
+# %TEST_REPOS_ROOT_URL%/svnsync_tests-29/trunk/H
+# Transmitting file data ...\..\..\subversion\svnsync\main.c:1444: (apr_err=160013)
+# ..\..\..\subversion\svnsync\main.c:1391: (apr_err=160013)
+# ..\..\..\subversion\libsvn_ra\ra_loader.c:1168: (apr_err=160013)
+# ..\..\..\subversion\libsvn_delta\path_driver.c:254: (apr_err=160013)
+# ..\..\..\subversion\libsvn_repos\replay.c:480: (apr_err=160013)
+# ..\..\..\subversion\libsvn_repos\replay.c:276: (apr_err=160013)
+# ..\..\..\subversion\libsvn_repos\replay.c:290: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:1258: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:1258: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:1236: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:931: (apr_err=160013)
+# ..\..\..\subversion\libsvn_fs_base\tree.c:742: (apr_err=160013)
+# svnsync: File not found: revision 4, path '/trunk/H/Z/B/lambda'
+#
+# See also http://svn.haxx.se/dev/archive-2010-11/0411.shtml and
+#
+#
+# Note: For those who may poke around this test in the future, r3 of
+# delete-revprops.dump was created with the following svnmucc command:
+#
+# svnmucc.exe -mm cp head %ROOT_URL%/trunk/A %ROOT_URL%/trunk/H
+# rm %ROOT_URL%/trunk/H/B
+# cp head %ROOT_URL%/trunk/X %ROOT_URL%/trunk/B
+#
+# r4 was created with this svnmucc command:
+#
+# svnmucc.exe -mm cp head %ROOT_URL%/trunk/A %ROOT_URL%/trunk/H/Z
+# rm %ROOT_URL%/trunk/H/Z/B
+# mkdir %ROOT_URL%/trunk/H/Z/B
def descend_into_replace(sbox):
"descending into replaced dir looks in src"
run_test(sbox, "descend_into_replace.dump", subdir='/trunk/H',
exp_dump_file_name = "descend_into_replace.expected.dump")
+# issue #3728
+def delete_revprops(sbox):
+ "copy-revprops with removals"
+ svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
+ 'svnsync_tests_data')
+ initial_contents = open(os.path.join(svnsync_tests_dir,
+ "delete-revprops.dump"),
+ 'rb').readlines()
+ expected_contents = open(os.path.join(svnsync_tests_dir,
+ "delete-revprops.expected.dump"),
+ 'rb').readlines()
+
+ # Create the initial repos and mirror, and sync 'em.
+ dest_sbox = setup_and_sync(sbox, initial_contents)
+
+ # Now remove a revprop from r1 of the source, and run 'svnsync
+ # copy-revprops' to re-sync 'em.
+ svntest.actions.enable_revprop_changes(sbox.repo_dir)
+ exit_code, out, err = svntest.main.run_svn(None,
+ 'pdel',
+ '-r', '1',
+ '--revprop',
+ 'issue-id',
+ sbox.repo_url)
+ if err:
+ raise SVNUnexpectedStderr(err)
+ run_copy_revprops(dest_sbox.repo_url, sbox.repo_url)
+
+ # Does the result look as we expected?
+ verify_mirror(dest_sbox, expected_contents)
+
########################################################################
# Run the tests
@@ -820,11 +902,13 @@ test_list = [ None,
copy_bad_line_endings,
delete_svn_props,
commit_a_copy_of_root,
- descend_into_replace,
+ XFail(descend_into_replace),
+ delete_revprops,
]
+serial_only = True
if __name__ == '__main__':
- svntest.main.run_tests(test_list, serial_only = True)
+ svntest.main.run_tests(test_list, serial_only = serial_only)
# NOTREACHED
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump Thu Dec 2 20:55:08 2010
@@ -350,3 +350,37 @@ Node-copyfrom-path: trunk/X
+Revision-number: 4
+Prop-content-length: 101
+Content-length: 101
+
+K 10
+svn:author
+V 6
+pburba
+K 8
+svn:date
+V 27
+2010-11-19T17:10:31.620281Z
+K 7
+svn:log
+V 1
+m
+PROPS-END
+
+Node-path: trunk/H/Z
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 3
+Node-copyfrom-path: trunk/A
+
+
+Node-path: trunk/H/Z/B
+Node-kind: dir
+Node-action: replace
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.expected.dump
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.expected.dump?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.expected.dump (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.expected.dump Thu Dec 2 20:55:08 2010
@@ -233,3 +233,179 @@ PROPS-END
This is the file 'mu'.
+Revision-number: 4
+Prop-content-length: 108
+Content-length: 108
+
+K 10
+svn:author
+V 7
+jrandom
+K 8
+svn:date
+V 27
+2010-11-22T15:40:03.023927Z
+K 7
+svn:log
+V 7
+log msg
+PROPS-END
+
+Node-path: trunk/H/Z
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/H/Z/B
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/H/Z/C
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/H/Z/D
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/H/Z/D/G
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/H/Z/D/G/pi
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 23
+Text-content-md5: adddfc3e6b605b5f90ceeab11b4e8ab6
+Text-content-sha1: 411e258dc14b42701fdc29b75f653e93f8686415
+Content-length: 33
+
+PROPS-END
+This is the file 'pi'.
+
+
+Node-path: trunk/H/Z/D/G/rho
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 24
+Text-content-md5: 82f2211cf4ab22e3555fc7b835fbc604
+Text-content-sha1: 56388a031dffbf9df7c32e1f299b1d5d7ef60881
+Content-length: 34
+
+PROPS-END
+This is the file 'rho'.
+
+
+Node-path: trunk/H/Z/D/G/tau
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 24
+Text-content-md5: 9936e2716e469bb686deb98c280ead58
+Text-content-sha1: 62e8c07d56bee94ea4577e80414fa8805aaf0175
+Content-length: 34
+
+PROPS-END
+This is the file 'tau'.
+
+
+Node-path: trunk/H/Z/D/H
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/H/Z/D/H/chi
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 24
+Text-content-md5: 8f5ebad6d1f7775c2682e54417cbe4d3
+Text-content-sha1: abeac1bf62099ab66b44779198dc19f40e3244f4
+Content-length: 34
+
+PROPS-END
+This is the file 'chi'.
+
+
+Node-path: trunk/H/Z/D/H/omega
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 26
+Text-content-md5: fe4ec8bdd3d2056db4f55b474a10fadc
+Text-content-sha1: c06e671bf15a6af55086176a0931d3b5034c82e6
+Content-length: 36
+
+PROPS-END
+This is the file 'omega'.
+
+
+Node-path: trunk/H/Z/D/H/psi
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 24
+Text-content-md5: e81f8f68ba50e749c200cb3c9ce5d2b1
+Text-content-sha1: 9c438bde39e8ccbbd366df2638e3cb6700950204
+Content-length: 34
+
+PROPS-END
+This is the file 'psi'.
+
+
+Node-path: trunk/H/Z/D/gamma
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 26
+Text-content-md5: 412138bd677d64cd1c32fafbffe6245d
+Text-content-sha1: 74b75d7f2e1a0292f17d5a57c570bd89783f5d1c
+Content-length: 36
+
+PROPS-END
+This is the file 'gamma'.
+
+
+Node-path: trunk/H/Z/mu
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 23
+Text-content-md5: baf78ae06a2d5b7d9554c5f1280d3fa8
+Text-content-sha1: b4d00c56351d1a752e24d839d41a362d8da4a4c7
+Content-length: 33
+
+PROPS-END
+This is the file 'mu'.
+
+
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/actions.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/actions.py Thu Dec 2 20:55:08 2010
@@ -356,6 +356,13 @@ def load_repo(sbox, dumpfile_path = None
return dump_str
+def expected_noop_update_output(rev):
+ """Return an ExpectedOutput object describing what we'd expect to
+ see from an update to revision REV that was effectively a no-op (no
+ server changes transmitted)."""
+ return verify.createExpectedOutput("Updating '.*' ...|At revision %d."
+ % (rev),
+ "no-op update")
######################################################################
# Subversion Actions
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/main.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/main.py Thu Dec 2 20:55:08 2010
@@ -74,6 +74,8 @@ from svntest import Skip
#####################################################################
# Global stuff
+default_num_threads = 5
+
class SVNProcessTerminatedBySignal(Failure):
"Exception raised if a spawned process segfaulted, aborted, etc."
pass
@@ -343,23 +345,22 @@ _safe_arg_re = re.compile(r'^[A-Za-z\d\.
def _quote_arg(arg):
"""Quote ARG for a command line.
- Simply surround every argument in double-quotes unless it contains
+ Return a quoted version of the string ARG, or just ARG if it contains
only universally harmless characters.
WARNING: This function cannot handle arbitrary command-line
- arguments. It can easily be confused by shell metacharacters. A
- perfect job would be difficult and OS-dependent (see, for example,
- http://msdn.microsoft.com/library/en-us/vccelng/htm/progs_12.asp).
- In other words, this function is just good enough for what we need
- here."""
+ arguments: it is just good enough for what we need here."""
arg = str(arg)
if _safe_arg_re.match(arg):
return arg
+
+ if windows:
+ # Note: subprocess.list2cmdline is Windows-specific.
+ return subprocess.list2cmdline([arg])
else:
- if os.name != 'nt':
- arg = arg.replace('$', '\$')
- return '"%s"' % (arg,)
+ # Quoting suitable for most Unix shells.
+ return "'" + arg.replace("'", "'\\''") + "'"
def open_pipe(command, bufsize=0, stdin=None, stdout=None, stderr=None):
"""Opens a subprocess.Popen pipe to COMMAND using STDIN,
@@ -375,15 +376,7 @@ def open_pipe(command, bufsize=0, stdin=
if (sys.platform == 'win32') and (command[0].endswith('.py')):
command.insert(0, sys.executable)
- # Quote only the arguments on Windows. Later versions of subprocess,
- # 2.5.2+ confirmed, don't require this quoting, but versions < 2.4.3 do.
- if sys.platform == 'win32':
- args = command[1:]
- args = ' '.join([_quote_arg(x) for x in args])
- command = command[0] + ' ' + args
- command_string = command
- else:
- command_string = ' '.join(command)
+ command_string = command[0] + ' ' + ' '.join(map(_quote_arg, command[1:]))
if not stdin:
stdin = subprocess.PIPE
@@ -445,6 +438,7 @@ def wait_on_pipe(waiter, binary_mode, st
if exit_code and options.verbose:
sys.stderr.write("CMD: %s exited with %d\n"
% (command_string, exit_code))
+ sys.stderr.flush()
return stdout_lines, stderr_lines, exit_code
def spawn_process(command, bufsize=0, binary_mode=0, stdin_lines=None,
@@ -737,7 +731,7 @@ def create_repos(path):
# (e.g. due to a missing 'svnadmin' binary).
raise SVNRepositoryCreateFailure("".join(stderr).rstrip())
- # Allow unauthenticated users to write to the repos, for ra_svn testing.
+ # Require authentication to write to the repos, for ra_svn testing.
file_write(get_svnserve_conf_file_path(path),
"[general]\nauth-access = write\n");
if options.enable_sasl:
@@ -1113,7 +1107,7 @@ class TestSpawningThread(threading.Threa
self.run_one(next_index)
def run_one(self, index):
- command = sys.argv[0]
+ command = os.path.abspath(sys.argv[0])
args = []
args.append(str(index))
@@ -1271,15 +1265,19 @@ def run_one_test(n, test_list, finished_
If we're running the tests in parallel spawn the test in a new process.
"""
- if (n < 1) or (n > len(test_list) - 1):
+ # allow N to be negative, so './basic_tests.py -- -1' works
+ num_tests = len(test_list) - 1
+ if (n == 0) or (abs(n) > num_tests):
print("There is no test %s.\n" % n)
return 1
+ if n < 0:
+ n += 1+num_tests
# Run the test.
exit_code = TestRunner(test_list[n], n).run()
return exit_code
-def _internal_run_tests(test_list, testnums, parallel):
+def _internal_run_tests(test_list, testnums, parallel, srcdir, progress_func):
"""Run the tests from TEST_LIST whose indices are listed in TESTNUMS.
If we're running the tests in parallel spawn as much parallel processes
@@ -1291,10 +1289,19 @@ def _internal_run_tests(test_list, testn
finished_tests = []
tests_started = 0
+ # Some of the tests use sys.argv[0] to locate their test data
+ # directory. Perhaps we should just be passing srcdir to the tests?
+ if srcdir:
+ sys.argv[0] = os.path.join(srcdir, 'subversion', 'tests', 'cmdline',
+ sys.argv[0])
+
if not parallel:
- for testnum in testnums:
+ for i, testnum in enumerate(testnums):
if run_one_test(testnum, test_list) == 1:
exit_code = 1
+ # signal progress
+ if progress_func:
+ progress_func(i+1, len(testnums))
else:
number_queue = queue.Queue()
for num in testnums:
@@ -1313,6 +1320,10 @@ def _internal_run_tests(test_list, testn
results += t.results
results.sort()
+ # signal some kind of progress
+ if progress_func:
+ progress_func(len(testnums), len(testnums))
+
# terminate the line of dots
print("")
@@ -1340,6 +1351,7 @@ def create_default_options():
def _create_parser():
"""Return a parser for our test suite."""
# set up the parser
+ _default_http_library = 'serf'
usage = 'usage: %prog [options] [<test> ...]'
parser = optparse.OptionParser(usage=usage)
parser.add_option('-l', '--list', action='store_true', dest='list_tests',
@@ -1348,8 +1360,8 @@ def _create_parser():
help='Print binary command-lines (not with --quiet)')
parser.add_option('-q', '--quiet', action='store_true',
help='Print only unexpected results (not with --verbose)')
- parser.add_option('-p', '--parallel', action='store_const', const=5,
- dest='parallel',
+ parser.add_option('-p', '--parallel', action='store_const',
+ const=default_num_threads, dest='parallel',
help='Run the tests in parallel')
parser.add_option('-c', action='store_true', dest='is_child_process',
help='Flag if we are running this python test as a ' +
@@ -1370,7 +1382,7 @@ def _create_parser():
parser.add_option('--http-library', action='store',
help="Make svn use this DAV library (neon or serf) if " +
"it supports both, else assume it's using this " +
- "one; the default is neon")
+ "one; the default is " + _default_http_library)
parser.add_option('--server-minor-version', type='int', action='store',
help="Set the minor version for the server ('4', " +
"'5', or '6').")
@@ -1388,12 +1400,14 @@ def _create_parser():
'test output and ignores all exceptions in the ' +
'run_and_verify* functions. This option is only ' +
'useful during test development!')
+ parser.add_option('--srcdir', action='store', dest='srcdir',
+ help='Source directory.')
# most of the defaults are None, but some are other values, set them here
parser.set_defaults(
server_minor_version=7,
url=file_scheme_prefix + pathname2url(os.path.abspath(os.getcwd())),
- http_library='serf')
+ http_library=_default_http_library)
return parser
@@ -1424,10 +1438,6 @@ def _parse_options(arglist=sys.argv[1:])
return (parser, args)
-# Main func. This is the "entry point" that all the test scripts call
-# to run their list of tests.
-#
-# This routine parses sys.argv to decide what to do.
def run_tests(test_list, serial_only = False):
"""Main routine to run all tests in TEST_LIST.
@@ -1435,6 +1445,20 @@ def run_tests(test_list, serial_only = F
appropriate exit code.
"""
+ sys.exit(execute_tests(test_list, serial_only))
+
+
+# Main func. This is the "entry point" that all the test scripts call
+# to run their list of tests.
+#
+# This routine parses sys.argv to decide what to do.
+def execute_tests(test_list, serial_only = False, test_name = None,
+ progress_func = None):
+ """Similar to run_tests(), but just returns the exit code, rather than
+ exiting the process. This function can be used when a caller doesn't
+ want the process to die."""
+
+ global pristine_url
global pristine_greek_repos_url
global svn_binary
global svnadmin_binary
@@ -1444,6 +1468,9 @@ def run_tests(test_list, serial_only = F
global svnversion_binary
global options
+ if test_name:
+ sys.argv[0] = test_name
+
testnums = []
if not options:
@@ -1556,7 +1583,8 @@ def run_tests(test_list, serial_only = F
svntest.actions.setup_pristine_greek_repository()
# Run the tests.
- exit_code = _internal_run_tests(test_list, testnums, options.parallel)
+ exit_code = _internal_run_tests(test_list, testnums, options.parallel,
+ options.srcdir, progress_func)
# Remove all scratchwork: the 'pristine' repository, greek tree, etc.
# This ensures that an 'import' will happen the next time we run.
@@ -1567,4 +1595,4 @@ def run_tests(test_list, serial_only = F
svntest.sandbox.cleanup_deferred_test_paths()
# Return the appropriate exit code from the tests.
- sys.exit(exit_code)
+ return exit_code
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/sandbox.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/sandbox.py Thu Dec 2 20:55:08 2010
@@ -162,10 +162,18 @@ class Sandbox:
return self._is_built
def ospath(self, relpath, wc_dir=None):
+ """Return RELPATH converted to an OS-style path relative to the WC dir
+ of this sbox, or relative to OS-style path WC_DIR if supplied."""
if wc_dir is None:
wc_dir = self.wc_dir
return os.path.join(wc_dir, svntest.wc.to_ospath(relpath))
+ def ospaths(self, relpaths, wc_dir=None):
+ """Return a list of RELPATHS but with each path converted to an OS-style
+ path relative to the WC dir of this sbox, or relative to OS-style
+ path WC_DIR if supplied."""
+ return [self.ospath(rp, wc_dir) for rp in relpaths]
+
def redirected_root_url(self, temporary=False):
"""If TEMPORARY is set, return the URL which should be configured
to temporarily redirect to the root of this repository;
@@ -180,47 +188,61 @@ class Sandbox:
parts[1])
def simple_update(self, target=None):
+ """Update the WC or TARGET.
+ TARGET is a relpath relative to the WC."""
assert not self.read_only
if target is None:
target = self.wc_dir
+ else:
+ target = self.ospath(target)
svntest.main.run_svn(False, 'update', target)
def simple_commit(self, target=None):
+ """Commit the WC or TARGET with a default log message.
+ TARGET is a relpath relative to the WC."""
assert not self.read_only
if target is None:
target = self.wc_dir
+ else:
+ target = self.ospath(target)
svntest.main.run_svn(False, 'commit',
'-m', svntest.main.make_log_msg(),
target)
def simple_rm(self, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
- if len(targets) == 1 and is_url(targets[0]):
- assert not self.read_only
- targets = ('-m', svntests.main.make_log_msg(), targets[0])
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'rm', *targets)
def simple_mkdir(self, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
- if len(targets) == 1 and is_url(targets[0]):
- assert not self.read_only
- targets = ('-m', svntests.main.make_log_msg(), targets[0])
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'mkdir', *targets)
def simple_add(self, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'add', *targets)
def simple_revert(self, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'revert', *targets)
def simple_propset(self, name, value, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'propset', name, value, *targets)
def simple_propdel(self, name, *targets):
+ """TARGET is a relpath relative to the WC."""
assert len(targets) > 0
+ targets = self.ospaths(targets)
svntest.main.run_svn(False, 'propdel', name, *targets)
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/tree.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/tree.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/tree.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svntest/tree.py Thu Dec 2 20:55:08 2010
@@ -413,23 +413,6 @@ def add_elements_as_path(top_node, eleme
prev_node = new_node
-def compare_atts(a, b):
- """Compare two dictionaries of attributes, A (actual) and B (expected).
- If the attribute 'treeconflict' in B is missing or is 'None', ignore it.
- Return 0 if the same, 1 otherwise."""
- a = a.copy()
- b = b.copy()
- # Remove any attributes to ignore.
- for att in ['treeconflict']:
- if (att not in b) or (b[att] is None):
- if att in a:
- del a[att]
- if att in b:
- del b[att]
- if a != b:
- return 1
- return 0
-
# Helper for compare_trees
def compare_file_nodes(a, b):
"""Compare two nodes, A (actual) and B (expected). Compare their names,
@@ -441,7 +424,9 @@ def compare_file_nodes(a, b):
return 1
if a.props != b.props:
return 1
- return compare_atts(a.atts, b.atts)
+ if a.atts != b.atts:
+ return 1
+ return 0
# Internal utility used by most build_tree_from_foo() routines.
@@ -658,7 +643,7 @@ def compare_trees(label,
# They're both directories.
else:
# First, compare the directories' two hashes.
- if (a.props != b.props) or compare_atts(a.atts, b.atts):
+ if (a.props != b.props) or (a.atts != b.atts):
display_nodes(a, b)
raise SVNTreeUnequal
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/switch_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/switch_tests.py Thu Dec 2 20:55:08 2010
@@ -1068,18 +1068,17 @@ def relocate_beyond_repos_root(sbox):
svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 0)
-
# A relocate that changes the repo path part of the URL shouldn't work.
# This tests for issue #2380.
svntest.actions.run_and_verify_svn(None, None,
- ".*Given destination URL invalid.*",
+ ".*Invalid destination URL.*",
'switch', '--relocate',
A_url, other_B_url, A_wc_dir)
# Another way of trying to change the fs path, leading to an invalid
# repository root.
svntest.actions.run_and_verify_svn(None, None,
- ".*Given source URL invalid.*",
+ ".*is not the root.*",
'switch', '--relocate',
repo_url, other_B_url, A_wc_dir)
@@ -2778,7 +2777,7 @@ def tree_conflicts_on_switch_2_2(sbox):
'DF/D1',
'DDD/D1',
'DDF/D1',
- status='! ', wc_rev=None)
+ status='! ', treeconflict='C', wc_rev=None)
# Remove from expected status and disk everything below the deleted paths.
expected_status.remove('DD/D1/D2',
'DF/D1/beta',
@@ -3105,7 +3104,8 @@ def relocate_with_relative_externals(sbo
wc_dir = sbox.wc_dir
# Add a relative external.
- change_external(os.path.join(wc_dir, 'A', 'B'), "^/A/D/G G-ext", commit=True)
+ change_external(os.path.join(wc_dir, 'A', 'B'),
+ "^/A/D/G G-ext\n../D/H H-ext", commit=True)
svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
# Move our repository to another location.
@@ -3119,10 +3119,12 @@ def relocate_with_relative_externals(sbo
svntest.actions.run_and_verify_svn(None, None, [], 'switch', '--relocate',
repo_url, other_repo_url, wc_dir)
- # Check the URL of the external -- was it updated to point to the
+ # Check the URLs of the externals -- were they updated to point to the
# .other repository URL?
svntest.actions.run_and_verify_info([{ 'URL' : '.*.other/A/D/G$' }],
os.path.join(wc_dir, 'A', 'B', 'G-ext'))
+ svntest.actions.run_and_verify_info([{ 'URL' : '.*.other/A/D/H$' }],
+ os.path.join(wc_dir, 'A', 'B', 'H-ext'))
########################################################################
@@ -3169,7 +3171,7 @@ test_list = [ None,
single_file_relocate,
relocate_with_switched_children,
XFail(copy_with_switched_subdir),
- XFail(relocate_with_relative_externals),
+ relocate_with_relative_externals,
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/tree_conflict_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/tree_conflict_tests.py Thu Dec 2 20:55:08 2010
@@ -477,6 +477,7 @@ def ensure_tree_conflict(sbox, operation
verbose_print("--- Merging")
run_and_verify_svn(None, expected_stdout, [],
'merge', '--ignore-ancestry',
+ '--allow-mixed-revisions',
'-r', str(source_left_rev) + ':' + str(source_right_rev),
source_url, target_path)
else:
@@ -1053,7 +1054,7 @@ def lock_update_only(sbox):
expected_disk = main.greek_state.copy()
expected_disk.remove('iota')
expected_status = get_virginal_state(wc_dir, 1)
- expected_status.tweak('iota', status='D ')
+ expected_status.tweak('iota', status='D ', writelocked='O')
run_and_verify_update(wc_dir,
None, expected_disk, expected_status,
None, None, None, None, None, 1,
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/update_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/update_tests.py Thu Dec 2 20:55:08 2010
@@ -39,6 +39,7 @@ Skip = svntest.testcase.Skip
SkipUnless = svntest.testcase.SkipUnless
XFail = svntest.testcase.XFail
Item = svntest.wc.StateItem
+exp_noop_up_out = svntest.actions.expected_noop_update_output
from svntest.main import SVN_PROP_MERGEINFO, server_has_mergeinfo
@@ -1168,11 +1169,13 @@ def another_hudson_problem(sbox):
# as 'deleted' and should not alter gamma's entry.
if not svntest.main.wc_is_singledb(wc_dir):
- expected_output = ['D '+G_path+'\n',
+ expected_output = ["Updating '%s' ...\n" % (G_path),
+ 'D '+G_path+'\n',
'Updated to revision 3.\n',
]
else:
- expected_output = ['Restored \'' + G_path + '\'\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',
@@ -1226,9 +1229,9 @@ def update_deleted_targets(sbox):
None, wc_dir)
# Explicit update must not remove the 'deleted=true' entries
- svntest.actions.run_and_verify_svn(None, ['At revision 2.\n'], [],
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(2), [],
'update', gamma_path)
- svntest.actions.run_and_verify_svn(None, ['At revision 2.\n'], [],
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(2), [],
'update', F_path)
# Update to r1 to restore items, since the parent directory is already
@@ -3350,7 +3353,7 @@ def mergeinfo_update_elision(sbox):
expected_status, None, wc_dir)
# Update A to get all paths to the same working revision.
- svntest.actions.run_and_verify_svn(None, ["At revision 7.\n"], [],
+ svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
'up', wc_dir)
# Merge r6:7 into A/B_COPY/E
@@ -3394,7 +3397,7 @@ def mergeinfo_update_elision(sbox):
# r8 - Commit the merge
svntest.actions.run_and_verify_svn(None,
- ["At revision 7.\n"],
+ exp_noop_up_out(7),
[], 'update', wc_dir)
expected_output = wc.State(wc_dir,
@@ -3792,7 +3795,8 @@ def update_accept_conflicts(sbox):
# Just leave the conflicts alone, since run_and_verify_svn already uses
# the --non-interactive option.
svntest.actions.run_and_verify_svn(None,
- ['C %s\n' % (iota_path_backup,),
+ ["Updating '%s' ...\n" % (iota_path_backup),
+ 'C %s\n' % (iota_path_backup,),
'Updated to revision 2.\n',
'Summary of conflicts:\n',
' Text conflicts: 1\n'],
@@ -3802,7 +3806,8 @@ def update_accept_conflicts(sbox):
# lambda: --accept=postpone
# Just leave the conflicts alone.
svntest.actions.run_and_verify_svn(None,
- ['C %s\n' % (lambda_path_backup,),
+ ["Updating '%s' ...\n" % (lambda_path_backup),
+ 'C %s\n' % (lambda_path_backup,),
'Updated to revision 2.\n',
'Summary of conflicts:\n',
' Text conflicts: 1\n'],
@@ -3813,7 +3818,8 @@ def update_accept_conflicts(sbox):
# mu: --accept=base
# Accept the pre-update base file.
svntest.actions.run_and_verify_svn(None,
- ['G %s\n' % (mu_path_backup,),
+ ["Updating '%s' ...\n" % (mu_path_backup),
+ 'G %s\n' % (mu_path_backup,),
'Updated to revision 2.\n'],
[],
'update', '--accept=base',
@@ -3822,7 +3828,8 @@ def update_accept_conflicts(sbox):
# alpha: --accept=mine
# Accept the user's working file.
svntest.actions.run_and_verify_svn(None,
- ['G %s\n' % (alpha_path_backup,),
+ ["Updating '%s' ...\n" % (alpha_path_backup),
+ 'G %s\n' % (alpha_path_backup,),
'Updated to revision 2.\n'],
[],
'update', '--accept=mine-full',
@@ -3831,7 +3838,8 @@ def update_accept_conflicts(sbox):
# beta: --accept=theirs
# Accept their file.
svntest.actions.run_and_verify_svn(None,
- ['G %s\n' % (beta_path_backup,),
+ ["Updating '%s' ...\n" % (beta_path_backup),
+ 'G %s\n' % (beta_path_backup,),
'Updated to revision 2.\n'],
[],
'update', '--accept=theirs-full',
@@ -3842,7 +3850,8 @@ def update_accept_conflicts(sbox):
# conflicts in place, so expect a message on stderr, but expect
# svn to exit with an exit code of 0.
svntest.actions.run_and_verify_svn2(None,
- ['G %s\n' % (pi_path_backup,),
+ ["Updating '%s' ...\n" % (pi_path_backup),
+ 'G %s\n' % (pi_path_backup,),
'Updated to revision 2.\n'],
"system(.*) returned.*", 0,
'update', '--accept=edit',
@@ -3851,7 +3860,8 @@ def update_accept_conflicts(sbox):
# rho: --accept=launch
# Run the external merge tool, it should leave conflict markers in place.
svntest.actions.run_and_verify_svn(None,
- ['C %s\n' % (rho_path_backup,),
+ ["Updating '%s' ...\n" % (rho_path_backup),
+ 'C %s\n' % (rho_path_backup,),
'Updated to revision 2.\n',
'Summary of conflicts:\n',
' Text conflicts: 1\n'],
@@ -5317,7 +5327,24 @@ def update_with_file_lock_and_keywords_p
if (mu_ts_before_update != mu_ts_after_update):
print("The timestamp of 'mu' before and after update does not match.")
raise svntest.Failure
-
+
+#----------------------------------------------------------------------
+# Updating a nonexistent or deleted path should be a successful no-op,
+# when there is no incoming change. In trunk@1035343, such an update
+# within a copied directory triggered an assertion failure.
+def update_nonexistent_child_of_copy(sbox):
+ """update a nonexistent child of a copied dir"""
+ sbox.build()
+ os.chdir(sbox.wc_dir)
+
+ svntest.main.run_svn(None, 'copy', 'A', 'A2')
+
+ # Try updating a nonexistent path in the copied dir.
+ svntest.main.run_svn(None, 'update', os.path.join('A2', 'nonexistent'))
+
+ # Try updating a deleted path in the copied dir.
+ svntest.main.run_svn(None, 'delete', os.path.join('A2', 'mu'))
+ svntest.main.run_svn(None, 'update', os.path.join('A2', 'mu'))
#######################################################################
# Run the tests
@@ -5382,7 +5409,8 @@ test_list = [ None,
XFail(update_empty_hides_entries),
mergeinfo_updates_merge_with_local_mods,
update_with_excluded_subdir,
- XFail(update_with_file_lock_and_keywords_property_set)
+ XFail(update_with_file_lock_and_keywords_property_set),
+ XFail(update_nonexistent_child_of_copy),
]
if __name__ == '__main__':
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/upgrade_tests.py?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/upgrade_tests.py Thu Dec 2 20:55:08 2010
@@ -106,15 +106,18 @@ def check_dav_cache(dir_path, wc_id, exp
c = db.cursor()
for local_relpath, expected_dav_cache in expected_dav_caches.items():
- c.execute('select dav_cache from base_node ' +
- 'where wc_id=? and local_relpath=?',
- (wc_id, local_relpath))
- row = c.fetchone()
- if row is None:
+ # NODES conversion is complete enough that we can use it if it exists
+ c.execute("""pragma table_info(nodes)""")
+ if c.fetchone():
c.execute('select dav_cache from nodes ' +
'where wc_id=? and local_relpath=? and op_depth = 0',
(wc_id, local_relpath))
row = c.fetchone()
+ else:
+ c.execute('select dav_cache from base_node ' +
+ 'where wc_id=? and local_relpath=?',
+ (wc_id, local_relpath))
+ row = c.fetchone()
if row is None:
raise svntest.Failure("no dav cache for '%s'" % (local_relpath))
dav_cache = str(row[0])
@@ -651,6 +654,64 @@ def delete_and_keep_local(sbox):
raise svntest.Failure('wc/Deleted should not exist')
+def dirs_only_upgrade(sbox):
+ "upgrade a wc without files"
+
+ sbox.build(create_wc = False)
+ replace_sbox_with_tarfile(sbox, 'dirs-only.tar.bz2')
+
+ expected_output = ["Upgraded '%s'.\n" % (sbox.ospath('').rstrip(os.path.sep)),
+ "Upgraded '%s'.\n" % (sbox.ospath('A'))]
+
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'upgrade', sbox.wc_dir)
+
+ expected_status = svntest.wc.State(sbox.wc_dir, {
+ '' : Item(status=' ', wc_rev='1'),
+ 'A' : Item(status=' ', wc_rev='1'),
+ })
+ run_and_verify_status_no_server(sbox.wc_dir, expected_status)
+
+
+def upgrade_tree_conflict_data(sbox):
+ "upgrade tree conflict data (f20->f21)"
+
+ sbox.build(create_wc = False)
+ wc_dir = sbox.wc_dir
+ replace_sbox_with_tarfile(sbox, 'upgrade_tc.tar.bz2')
+
+ # Check and see if we can still read our tree conflicts
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.tweak('A/D/G/pi', status='D ', treeconflict='C')
+ expected_status.tweak('A/D/G/tau', status='! ', treeconflict='C',
+ wc_rev=None)
+ expected_status.tweak('A/D/G/rho', status='A ', copied='+',
+ treeconflict='C', wc_rev='-')
+
+ run_and_verify_status_no_server(wc_dir, expected_status)
+
+def delete_in_copy_upgrade(sbox):
+ "upgrade a delete within a copy"
+
+ sbox.build(create_wc = False)
+ wc_dir = sbox.wc_dir
+ replace_sbox_with_tarfile(sbox, 'delete-in-copy.tar.bz2')
+
+ # Doesn't work, creates spurious base nodes for the copy
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'upgrade', sbox.wc_dir)
+
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+ expected_status.add({
+ 'A/B-copied' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A/B-copied/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B-copied/E' : Item(status='D ', wc_rev='?'),
+ 'A/B-copied/E/alpha' : Item(status='D ', wc_rev='?'),
+ 'A/B-copied/E/beta' : Item(status='D ', wc_rev='?'),
+ 'A/B-copied/F' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+ run_and_verify_status_no_server(sbox.wc_dir, expected_status)
+
########################################################################
# Run the tests
@@ -667,11 +728,14 @@ test_list = [ None,
# Upgrading from 1.4.0-1.4.5 with specific states fails
# See issue #2530
XFail(x3_1_4_0),
- x3_1_4_6,
- x3_1_6_12,
+ XFail(x3_1_4_6),
+ XFail(x3_1_6_12),
missing_dirs,
missing_dirs2,
XFail(delete_and_keep_local),
+ dirs_only_upgrade,
+ upgrade_tree_conflict_data,
+ delete_in_copy_upgrade,
]
Modified: subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_client/client-test.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_client/client-test.c Thu Dec 2 20:55:08 2010
@@ -379,7 +379,7 @@ test_patch(const svn_test_opts_t *opts,
pcb.patched_tempfiles = apr_hash_make(pool);
pcb.reject_tempfiles = apr_hash_make(pool);
pcb.state_pool = pool;
- SVN_ERR(svn_client_patch(patch_file_path, wc_path, FALSE, 0, FALSE, FALSE,
+ SVN_ERR(svn_client_patch(patch_file_path, wc_path, FALSE, 0, FALSE,
FALSE, FALSE, patch_collection_func, &pcb,
ctx, pool, pool));
SVN_ERR(svn_io_file_close(patch_file, pool));