summaryrefslogtreecommitdiff
path: root/subversion/tests/cmdline/svnversion_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/tests/cmdline/svnversion_tests.py')
-rwxr-xr-xsubversion/tests/cmdline/svnversion_tests.py126
1 files changed, 47 insertions, 79 deletions
diff --git a/subversion/tests/cmdline/svnversion_tests.py b/subversion/tests/cmdline/svnversion_tests.py
index ccc8e78..2ed6e46 100755
--- a/subversion/tests/cmdline/svnversion_tests.py
+++ b/subversion/tests/cmdline/svnversion_tests.py
@@ -50,47 +50,41 @@ def svnversion_test(sbox):
repo_url = sbox.repo_url
# Unmodified
- svntest.actions.run_and_verify_svnversion("Unmodified working copy",
- wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1\n" ], [])
# Unmodified, whole wc switched
- svntest.actions.run_and_verify_svnversion("Unmodified switched working copy",
- wc_dir, "some/other/url",
+ svntest.actions.run_and_verify_svnversion(wc_dir, "some/other/url",
[ "1S\n" ], [])
mu_path = os.path.join(wc_dir, 'A', 'mu')
svntest.main.file_append(mu_path, 'appended mu text')
# Modified file
- svntest.actions.run_and_verify_svnversion("Modified file",
- mu_path, repo_url + '/A/mu',
+ svntest.actions.run_and_verify_svnversion(mu_path, repo_url + '/A/mu',
[ "1M\n" ], [])
# Text modified
- svntest.actions.run_and_verify_svnversion("Modified text", wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1M\n" ], [])
expected_output = wc.State(wc_dir, {'A/mu' : Item(verb='Sending')})
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/mu', wc_rev=2)
if svntest.actions.run_and_verify_commit(wc_dir,
- expected_output, expected_status,
- None, wc_dir):
+ expected_output, expected_status):
raise svntest.Failure
# Unmodified, mixed
- svntest.actions.run_and_verify_svnversion("Unmodified mixed working copy",
- wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1:2\n" ], [])
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'propset', 'blue', 'azul',
os.path.join(wc_dir, 'A', 'mu'))
# Prop modified, mixed
- svntest.actions.run_and_verify_svnversion("Property modified mixed wc",
- wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1:2M\n" ], [])
iota_path = os.path.join(wc_dir, 'iota')
@@ -108,45 +102,39 @@ def svnversion_test(sbox):
expected_output,
expected_disk,
expected_status,
- None, None, None, None, None,
+ [],
False, '--ignore-ancestry'):
raise svntest.Failure
# Prop modified, mixed, part wc switched
- svntest.actions.run_and_verify_svnversion("Prop-mod mixed partly switched",
- wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1:2MS\n" ], [])
# Plain (exported) directory that is a direct subdir of a versioned dir
Q_path = os.path.join(wc_dir, 'Q')
os.mkdir(Q_path)
- svntest.actions.run_and_verify_svnversion("Exported subdirectory",
- Q_path, repo_url,
+ svntest.actions.run_and_verify_svnversion(Q_path, repo_url,
[ "Unversioned directory\n" ], [])
# Plain (exported) directory that is not a direct subdir of a versioned dir
R_path = os.path.join(Q_path, 'Q')
os.mkdir(R_path)
- svntest.actions.run_and_verify_svnversion("Exported directory",
- R_path, repo_url,
+ svntest.actions.run_and_verify_svnversion(R_path, repo_url,
[ "Unversioned directory\n" ], [])
# Switched file
- svntest.actions.run_and_verify_svnversion("Switched file",
- iota_path, repo_url + '/iota',
+ svntest.actions.run_and_verify_svnversion(iota_path, repo_url + '/iota',
[ "2S\n" ], [])
# Unversioned file
kappa_path = os.path.join(wc_dir, 'kappa')
svntest.main.file_write(kappa_path, "This is the file 'kappa'.")
- svntest.actions.run_and_verify_svnversion("Unversioned file",
- kappa_path, repo_url,
+ svntest.actions.run_and_verify_svnversion(kappa_path, repo_url,
[ "Unversioned file\n" ], [])
# Nonexistent file or directory
X_path = os.path.join(wc_dir, 'Q', 'X')
- svntest.actions.run_and_verify_svnversion("Nonexistent file or directory",
- X_path, repo_url,
+ svntest.actions.run_and_verify_svnversion(X_path, repo_url,
None, [ "'%s' doesn't exist\n"
% os.path.abspath(X_path) ])
@@ -163,11 +151,10 @@ def svnversion_test(sbox):
})
svntest.actions.run_and_verify_checkout(repo_url + "/A", A_A_path,
expected_output, expected_disk,
- None, None, None, None,
- "--depth=files")
+ [], "--depth=files")
# Partial (sparse) checkout
- svntest.actions.run_and_verify_svnversion("Sparse checkout", A_A_path,
+ svntest.actions.run_and_verify_svnversion(A_A_path,
repo_url, [ "2SP\n" ], [])
@@ -188,7 +175,7 @@ ext-file -r 1 %s/A/D/H/omega
""" % (repo_url, repo_url)
(fd, tmp_f) = tempfile.mkstemp(dir=wc_dir)
svntest.main.file_append(tmp_f, externals_desc)
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'pset',
'-F', tmp_f, 'svn:externals', C_path)
os.close(fd)
@@ -200,11 +187,10 @@ ext-file -r 1 %s/A/D/H/omega
expected_status.tweak('A/C', wc_rev=2)
svntest.actions.run_and_verify_commit(wc_dir,
expected_output,
- expected_status,
- None, wc_dir)
+ expected_status)
# Update to get it on disk
- svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+ svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
ext_dir_path = os.path.join(C_path, 'ext-dir')
ext_file_path = os.path.join(C_path, 'ext-file')
expected_infos = [
@@ -213,8 +199,7 @@ ext-file -r 1 %s/A/D/H/omega
]
svntest.actions.run_and_verify_info(expected_infos, ext_dir_path, ext_file_path)
- svntest.actions.run_and_verify_svnversion("working copy with svn:externals",
- wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "2\n" ], [])
#----------------------------------------------------------------------
@@ -231,24 +216,21 @@ def svnversion_with_excluded_subtrees(sbox):
D_path = os.path.join(wc_dir, "A", "D")
psi_path = os.path.join(wc_dir, "A", "D", "H", "psi")
- svntest.actions.run_and_verify_svnversion("working copy with excluded dir",
- wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1\n" ], [])
# Exclude a directory and check that svnversion detects it.
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'up', '--set-depth', 'exclude', B_path)
- svntest.actions.run_and_verify_svnversion("working copy with excluded dir",
- wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1P\n" ], [])
# Exclude a file and check that svnversion detects it. Target the
# svnversion command on a subtree that does not contain the excluded
# directory to assure we a detecting the switched file.
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'up', '--set-depth', 'exclude', psi_path)
- svntest.actions.run_and_verify_svnversion("working copy with excluded file",
- D_path, repo_url + '/A/D',
+ svntest.actions.run_and_verify_svnversion(D_path, repo_url + '/A/D',
[ "1P\n" ], [])
def svnversion_with_structural_changes(sbox):
@@ -261,22 +243,20 @@ def svnversion_with_structural_changes(sbox):
iota_path = os.path.join(wc_dir, 'iota')
iota_copy_path = os.path.join(wc_dir, 'iota_copy')
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'cp', iota_path, iota_copy_path)
- svntest.actions.run_and_verify_svnversion("Copied file",
- iota_copy_path, repo_url +
+ svntest.actions.run_and_verify_svnversion(iota_copy_path, repo_url +
'/iota_copy',
[ "Uncommitted local addition, "
"copy or move\n" ],
[])
C_path = os.path.join(wc_dir, 'A', 'C')
C_copy_path = os.path.join(wc_dir, 'C_copy')
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'cp', C_path, C_copy_path)
- svntest.actions.run_and_verify_svnversion("Copied dir",
- C_copy_path, repo_url +
+ svntest.actions.run_and_verify_svnversion(C_copy_path, repo_url +
'/C_copy',
[ "Uncommitted local addition, "
"copy or move\n" ],
@@ -285,13 +265,12 @@ def svnversion_with_structural_changes(sbox):
# Test deletion
sbox.simple_rm('iota')
- svntest.actions.run_and_verify_svnversion("Deleted file",
- sbox.ospath('iota'),
+ svntest.actions.run_and_verify_svnversion(sbox.ospath('iota'),
repo_url + '/iota',
["1M\n"],
[],
)
- svntest.actions.run_and_verify_svnversion("Deleted file", wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1:2M\n" ], [])
def committed_revisions(sbox):
@@ -303,7 +282,7 @@ def committed_revisions(sbox):
sbox.simple_copy('iota', 'iota2')
sbox.simple_commit()
sbox.simple_update()
- svntest.actions.run_and_verify_svnversion("Committed revisions", wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1:2\n" ], [],
"--committed")
@@ -313,8 +292,7 @@ def non_reposroot_wc(sbox):
wc_dir = sbox.add_wc_path('wc2')
repo_url = sbox.repo_url + "/A/B"
svntest.main.run_svn(None, 'checkout', repo_url, wc_dir)
- svntest.actions.run_and_verify_svnversion("Non-repos-root wc dir",
- wc_dir, repo_url,
+ svntest.actions.run_and_verify_svnversion(wc_dir, repo_url,
[ "1\n" ], [])
@Issue(3858)
@@ -332,25 +310,24 @@ def child_switched(sbox):
### Target is repos root and WC root.
# No switches.
- svntest.actions.run_and_verify_svnversion(None, wc_dir, None,
+ svntest.actions.run_and_verify_svnversion(wc_dir, None,
[ "2\n" ], [])
# Switch A/B to a sibling.
sbox.simple_switch(repo_url + '/A/D', 'A/B')
# This should detect the switch at A/B.
- svntest.actions.run_and_verify_svnversion(None, wc_dir, None,
+ svntest.actions.run_and_verify_svnversion(wc_dir, None,
[ "2S\n" ], [])
### Target is neither repos root nor WC root.
# But A/B/G and its children are not switched by itself.
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir, 'A/B/G'),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'A/B/G'),
None, [ "2\n" ], [])
# And A/B isn't switched when you look at it directly.
- svntest.actions.run_and_verify_svnversion(None, os.path.join(wc_dir, 'A/B'),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'A/B'),
None, [ "2\n" ], [])
# Switch branch/D to ^/A, then switch branch/D/G back to ^/branch/D/G so
@@ -359,37 +336,31 @@ def child_switched(sbox):
sbox.simple_switch(repo_url + '/branch/D/G', 'branch/D/G')
# This should detect the switch at branch/D and branch/D/G.
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir, 'branch'),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'branch'),
None, [ "2S\n" ], [])
# Directly targeting the switched branch/D should still detect the switch
# at branch/D/G even though the latter isn't switched against the root of
# the working copy.
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir, 'branch',
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'branch',
'D'),
None, [ "2S\n" ], [])
# Switch A/B to ^/.
sbox.simple_switch(repo_url, 'A/B')
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir),
None, [ "2S\n" ], [])
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir, 'A'),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'A'),
None, [ "2S\n" ], [])
### Target is repos root but not WC root.
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir, 'A', 'B'),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'A', 'B'),
None, [ "2\n" ], [])
# Switch A/B/A/D/G to ^/A/D/H.
sbox.simple_switch(repo_url + '/A/D/H', 'A/B/A/D/G')
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir, 'A', 'B'),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'A', 'B'),
None, [ "2S\n" ], [])
### Target is not repos root but is WC root.
@@ -398,17 +369,14 @@ def child_switched(sbox):
# ^A/D/G.
sbox.simple_switch(repo_url + '/branch', '.')
sbox.simple_switch(repo_url + '/A/D/G', 'D/G')
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir,),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir,),
None, [ "2S\n" ], [])
### Target is neither repos root nor WC root.
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir, 'D'),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'D'),
None, [ "2S\n" ], [])
- svntest.actions.run_and_verify_svnversion(None,
- os.path.join(wc_dir, 'D', 'H'),
+ svntest.actions.run_and_verify_svnversion(os.path.join(wc_dir, 'D', 'H'),
None, [ "2\n" ], [])
########################################################################