('binary' encoding is not supported, stored as-is)
Hi all,
Last week I submitted a little change to the svnversion test. Before the test was found acceptable, I had to rewrite it so that it was written as a 'new style' test: one which uses the Python exception handling instead of the return 0 / return 1 structure.
I thought I could edit the README document in the test directory to document the desired state of the test suite. That would have cost me quite some time, so I took the (only slightly longer) route of bringing the testsuite into harmony. In the patch below I have changed the scripts to "raise <some exception>" instead of returning 1. All return 0 statements at the end of the functions have been removed. After applying the patch the test suite can be used for learning by example again.
I also added an occasional try: .. finally: around a os.cwd(wc_dir) ... os.cwd(was_dir).
The new test suite has run 'make check' without problems. The patch removes 914 lines and adds 594. The patch contains a total of 3815 lines due to the supplied context.
Could someone comment please?
PS: I left out changes to svnversion_tests.py since a patch which brings that file into harmony with the others has already been filed in issue #1491
The log message:
[[[
Rewrite the test suite to new philosophy where
exceptions are raised to pass errors back to
the caller.
* subversion/tests/clients/cmdline/basic_tests.py
* subversion/tests/clients/cmdline/commit_tests.py
* subversion/tests/clients/cmdline/copy_tests.py
* subversion/tests/clients/cmdline/diff_tests.py
* subversion/tests/clients/cmdline/export_tests.py
* subversion/tests/clients/cmdline/externals_tests.py
* subversion/tests/clients/cmdline/log_tests.py
* subversion/tests/clients/cmdline/merge_tests.py
* subversion/tests/clients/cmdline/prop_tests.py
* subversion/tests/clients/cmdline/schedule_tests.py
* subversion/tests/clients/cmdline/stat_tests.py
* subversion/tests/clients/cmdline/svnadmin_tests.py
* subversion/tests/clients/cmdline/svnlook_tests.py
* subversion/tests/clients/cmdline/trans_tests.py
* subversion/tests/clients/cmdline/update_tests.py
* subversion/tests/clients/cmdline/utf8_tests.py
]]]
Index: subversion/tests/clients/cmdline/diff_tests.py
===================================================================
--- subversion/tests/clients/cmdline/diff_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/diff_tests.py (working copy)
@@ -75,7 +75,7 @@
i += 1
# no suitable diff found
- return 1
+ raise 1
def count_diff_output(diff_output):
"count the number of file diffs in the output"
@@ -405,7 +405,6 @@
"multiple revisions diff'd forwards and backwards"
sbox.build()
-
wc_dir = sbox.wc_dir
# rev 2
@@ -445,7 +444,6 @@
"non-recursive behaviour"
sbox.build()
-
wc_dir = sbox.wc_dir
change_diff_commit_diff(wc_dir, 1,
@@ -484,7 +482,6 @@
"diff only part of the repository"
sbox.build()
-
wc_dir = sbox.wc_dir
was_cwd = os.getcwd()
@@ -511,7 +508,6 @@
"non version controlled files"
sbox.build()
-
wc_dir = sbox.wc_dir
svntest.main.file_append(os.path.join(wc_dir, 'A', 'D', 'foo'), "a new file")
@@ -534,8 +530,8 @@
"pure repository diff update a file"
sbox.build()
-
wc_dir = sbox.wc_dir
+
was_cwd = os.getcwd()
os.chdir(wc_dir)
@@ -626,7 +622,6 @@
### really ought to check that the property diff gets output.
sbox.build()
-
wc_dir = sbox.wc_dir
current_dir = os.getcwd();
@@ -661,7 +656,6 @@
"don't diff file marked as binary type"
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a binary file to the project.
@@ -689,10 +683,9 @@
})
# Commit the new binary file, creating revision 2.
- if svntest.actions.run_and_verify_commit(wc_dir, expected_output,
- expected_status, None,
- None, None, None, None, wc_dir):
- raise svntest.Failure
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None,
+ None, None, None, None, wc_dir)
# Update the whole working copy to HEAD (rev 2)
expected_output = svntest.wc.State(wc_dir, {})
@@ -708,13 +701,12 @@
'A/theta' : Item(status=' ', wc_rev=2, repos_rev=2),
})
- if svntest.actions.run_and_verify_update(wc_dir,
- expected_output,
- expected_disk,
- expected_status,
- None, None, None, None, None,
- 1): # verify props, too.
- raise svntest.Failure
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None,
+ 1) # verify props, too.
# Make a local mod to the binary file.
svntest.main.file_append(theta_path, "some extra junk")
@@ -757,10 +749,9 @@
'A/theta' : Item(status=' ', wc_rev=3, repos_rev=3),
})
- if svntest.actions.run_and_verify_commit(wc_dir, expected_output,
- expected_status, None,
- None, None, None, None, wc_dir):
- raise svntest.Failure
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None,
+ None, None, None, None, wc_dir)
# Third diff use-case: 'svn diff -r2:3 wc' will compare two
# repository trees.
@@ -827,7 +818,6 @@
"diff text-bases against repository"
sbox.build()
-
wc_dir = sbox.wc_dir
iota_path = os.path.join(sbox.wc_dir, 'iota')
@@ -1043,7 +1033,6 @@
"repos-repos diff on item deleted from HEAD"
sbox.build()
-
wc_dir = sbox.wc_dir
A_path = os.path.join(sbox.wc_dir, 'A')
Index: subversion/tests/clients/cmdline/copy_tests.py
===================================================================
--- subversion/tests/clients/cmdline/copy_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/copy_tests.py (working copy)
@@ -112,7 +112,6 @@
"basic copy and move commands -- on files only"
sbox.build()
-
wc_dir = sbox.wc_dir
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -256,7 +255,6 @@
# -- Lars
sbox.build()
-
wc_dir = sbox.wc_dir
unver_path = os.path.join(wc_dir, 'A', 'unversioned')
@@ -281,7 +279,6 @@
"receive a copied directory during update"
sbox.build()
-
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy.
@@ -376,7 +373,6 @@
"resurrect a deleted directory"
sbox.build()
-
wc_dir = sbox.wc_dir
# Delete directory A/D/G, commit that as r2.
@@ -554,8 +550,8 @@
"copy and tree and modify before commit"
sbox.build()
-
wc_dir = sbox.wc_dir
+
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
wc_dir + '/A/B', wc_dir + '/A/B2',
'-m', 'fooogle')
@@ -661,7 +657,6 @@
"copy a tree and delete part of it before commit"
sbox.build()
-
wc_dir = sbox.wc_dir
# copy a tree
@@ -714,7 +709,6 @@
"move and revert a directory"
sbox.build()
-
wc_dir = sbox.wc_dir
# Issue 931: move failed to lock the directory being deleted
@@ -745,7 +739,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
# Create two paths
@@ -790,7 +783,6 @@
"working-copy to repository copy"
sbox.build()
-
wc_dir = sbox.wc_dir
beta_path = os.path.join(wc_dir, "A", "B", "E", "beta")
@@ -861,7 +853,6 @@
"repository to working-copy copy"
sbox.build()
-
wc_dir = sbox.wc_dir
# We have a standard repository and working copy. Now we create a
@@ -962,6 +953,7 @@
sbox.build()
wc_dir = sbox.wc_dir
+
B_url = svntest.main.current_repo_url + "/A/B"
F_url = svntest.main.current_repo_url + "/A/B/F"
@@ -1012,6 +1004,7 @@
sbox.build()
wc_dir = sbox.wc_dir
+
B_url = svntest.main.current_repo_url + "/A/B"
F_B_url = svntest.main.current_repo_url + "/A/B/F/B"
Index: subversion/tests/clients/cmdline/stat_tests.py
===================================================================
--- subversion/tests/clients/cmdline/stat_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/stat_tests.py (working copy)
@@ -39,9 +39,7 @@
def status_unversioned_file_in_current_dir(sbox):
"status on unversioned file in current directory"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
was_cwd = os.getcwd()
@@ -53,12 +51,11 @@
stat_output, err_output = svntest.main.run_svn(None, 'stat', 'foo')
if len(stat_output) != 1:
- return 1
+ raise svntest.Failure
if len(err_output) != 0:
- return 1
+ raise svntest.Failure
- return 0
finally:
os.chdir(was_cwd)
@@ -68,9 +65,7 @@
def status_update_with_nested_adds(sbox):
"run 'status -u' when nested additions are pending"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
@@ -103,10 +98,9 @@
})
# Commit.
- if svntest.actions.run_and_verify_commit (wc_dir, expected_output,
- expected_status, None,
- None, None, None, None, wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir, expected_output,
+ expected_status, None,
+ None, None, None, None, wc_dir)
# Now we go to the backup working copy, still at revision 1.
# We will run 'svn st -u', and make sure that newdir/newfile is reported
@@ -124,18 +118,16 @@
# an error happens, we'll catch it here. So that's a good enough
# regression test for now. Someday, though, it would be nice to
# positively match the mostly-empty lines.
- return svntest.actions.run_and_verify_unquiet_status(wc_backup,
- expected_status)
-
+ svntest.actions.run_and_verify_unquiet_status(wc_backup,
+ expected_status)
+
#----------------------------------------------------------------------
# svn status -vN should include all entries in a directory
def status_shows_all_in_current_dir(sbox):
"status -vN shows all items in current directory"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
was_cwd = os.getcwd()
@@ -143,54 +135,47 @@
stat_output, err_output = svntest.main.run_svn(None, 'stat', '-vN')
if err_output:
- return 1
+ raise svntest.Failure
entries_in_wc = len(os.listdir("."))
os.chdir(was_cwd)
if (len(stat_output) != entries_in_wc):
- return 1
+ raise svntest.Failure
- return 0
-
-
#----------------------------------------------------------------------
def status_missing_file(sbox):
"status with a versioned file missing"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
was_cwd = os.getcwd()
-
+
os.chdir(wc_dir)
+ try:
- os.remove('iota')
+ os.remove('iota')
- stat_output, err_output = svntest.main.run_svn(None, 'status')
- if err_output:
- return 1
- for line in stat_output:
- if not re.match("! +iota", line):
- return 1
-
- os.chdir(was_cwd)
+ stat_output, err_output = svntest.main.run_svn(None, 'status')
+ if err_output:
+ raise svntest.Failure
+ for line in stat_output:
+ if not re.match("! +iota", line):
+ raise svntest.Failure
+ finally:
+ os.chdir(was_cwd)
- return 0
-
-
#----------------------------------------------------------------------
def status_type_change(sbox):
"status on versioned items whose type has changed"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
was_cwd = os.getcwd()
os.chdir(wc_dir)
@@ -204,10 +189,10 @@
stat_output, err_output = svntest.main.run_svn(None, 'status')
if err_output or len(stat_output) != 2:
- return 1
+ raise svntest.Failure
for line in stat_output:
if not re.match("~ +(iota|A)", line):
- return 1
+ raise svntest.Failure
# Now change the file that is obstructing the versioned dir into an
# unversioned dir.
@@ -216,10 +201,10 @@
stat_output, err_output = svntest.main.run_svn(None, 'status')
if err_output or len(stat_output) != 2:
- return 1
+ raise svntest.Failure
for line in stat_output:
if not re.match("~ +(iota|A)", line):
- return 1
+ raise svntest.Failure
# Now change the versioned dir that is obstructing the file into an
# unversioned dir.
@@ -228,25 +213,22 @@
stat_output, err_output = svntest.main.run_svn(None, 'status')
if err_output or len(stat_output) != 2:
- return 1
+ raise svntest.Failure
for line in stat_output:
if not re.match("~ +(iota|A)", line):
- return 1
+ raise svntest.Failure
finally:
os.chdir(was_cwd)
- return 0
-
#----------------------------------------------------------------------
def status_type_change_to_symlink(sbox):
"status on versioned items replaced by symlinks"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
was_cwd = os.getcwd()
os.chdir(wc_dir)
@@ -260,10 +242,10 @@
stat_output, err_output = svntest.main.run_svn(None, 'status')
if err_output or len(stat_output) != 2:
- return 1
+ raise svntest.Failure
for line in stat_output:
if not re.match("~ +(iota|A/D)", line):
- return 1
+ raise svntest.Failure
# "valid" symlinks
os.remove('iota')
@@ -273,70 +255,63 @@
stat_output, err_output = svntest.main.run_svn(None, 'status')
if err_output or len(stat_output) != 2:
- return 1
+ raise svntest.Failure
for line in stat_output:
if not re.match("~ +(iota|A/D)", line):
- return 1
+ raise svntest.Failure
finally:
os.chdir(was_cwd)
- return 0
-
-
#----------------------------------------------------------------------
# Regression test for revision 3686.
def status_with_new_files_pending(sbox):
"status -u with new files in the repository"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
was_cwd = os.getcwd()
os.chdir(wc_dir)
+ try:
+ svntest.main.file_append('newfile', 'this is a new file')
+ svntest.main.run_svn(None, 'add', 'newfile')
+ svntest.main.run_svn(None, 'ci', '-m', 'logmsg')
+ svntest.main.run_svn(None, 'up', '-r', '1')
- svntest.main.file_append('newfile', 'this is a new file')
- svntest.main.run_svn(None, 'add', 'newfile')
- svntest.main.run_svn(None, 'ci', '-m', 'logmsg')
- svntest.main.run_svn(None, 'up', '-r', '1')
+ stat_output, err_output = svntest.main.run_svn(None, 'status', '-u')
+ if err_output:
+ raise svntest.Failure
- stat_output, err_output = svntest.main.run_svn(None, 'status', '-u')
- if err_output:
- return 1
+ # The bug fixed in revision 3686 was a seg fault. We don't have a
+ # reliable way to detect a seg fault here, since we haven't dealt
+ # with the popen2{Popen3,Popen4} mess in Python yet (the latter two
+ # are classes within the first, which is a module, and the Popen3
+ # class is not the same as os.popen3(). Got that?) See the Python
+ # docs for details; in the meantime, no output means there was a
+ # problem.
+ for line in stat_output:
+ if line.find('newfile') != -1:
+ break;
+ else:
+ raise svntest.Failure
- # The bug fixed in revision 3686 was a seg fault. We don't have a
- # reliable way to detect a seg fault here, since we haven't dealt
- # with the popen2{Popen3,Popen4} mess in Python yet (the latter two
- # are classes within the first, which is a module, and the Popen3
- # class is not the same as os.popen3(). Got that?) See the Python
- # docs for details; in the meantime, no output means there was a
- # problem.
- for line in stat_output:
- if line.find('newfile') != -1:
- break;
- else:
- return 1
+ finally:
+ os.chdir(was_cwd)
- os.chdir(was_cwd)
-
- return 0
-
-
#----------------------------------------------------------------------
def status_for_unignored_file(sbox):
"status for unignored file and directory"
sbox.build()
-
wc_dir = sbox.wc_dir
+
was_cwd = os.getcwd()
os.chdir(wc_dir)
-
try:
svntest.main.file_append('newfile', 'this is a new file')
os.makedirs('newdir')
@@ -417,10 +392,9 @@
# any issue for this bug, so this comment and the thread are your
# audit trail :-).
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
other_wc = sbox.add_wc_path('other')
svntest.actions.duplicate_dir(wc_dir, other_wc)
@@ -431,7 +405,6 @@
svntest.main.file_append('crontab.root', 'New file crontab.root.\n')
svntest.main.run_svn(None, 'add', 'crontab.root')
svntest.main.run_svn(None, 'ci', '-m', 'log msg')
-
os.chdir(was_cwd)
os.chdir(other_wc)
svntest.main.run_svn(None, 'up')
@@ -447,16 +420,14 @@
os.chdir(was_cwd)
out, err = svntest.main.run_svn(None, 'status', '-u', other_wc)
if err:
- return 1
+ raise svntest.Failure
- saw_it = 0
for line in out:
if re.match("\\s+\\*.*crontab\\.root$", line):
- saw_it = 1
+ break
+ else:
+ raise svntest.Failure
- return not saw_it
-
-
#----------------------------------------------------------------------
def status_uninvited_parent_directory(sbox):
@@ -485,10 +456,9 @@
# reverted because it caused other status problems (see the test
# status_file_needs_update(), which fails when 4181 is present).
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
other_wc = sbox.add_wc_path('other')
svntest.actions.duplicate_dir(wc_dir, other_wc)
@@ -513,24 +483,19 @@
out, err = svntest.main.run_svn(None, 'status', '-u',
os.path.join(other_wc, 'newfile'))
if err:
- return 1
+ raise svntest.Failure
- saw_uninvited_parent_dir = 0
for line in out:
# The "/?" is just to allow for an optional trailing slash.
if re.match("\\s+\\*.*\.other/?$", line):
- saw_uninvited_parent_dir = 1
+ raise svntest.Failure
- return saw_uninvited_parent_dir
-
-
def status_on_forward_deletion(sbox):
"status -u on working copy deleted in HEAD"
# See issue #1289.
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
top_url = svntest.main.current_repo_url
A_url = top_url + '/A'
Index: subversion/tests/clients/cmdline/svnadmin_tests.py
===================================================================
--- subversion/tests/clients/cmdline/svnadmin_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/svnadmin_tests.py (working copy)
@@ -102,7 +102,6 @@
"'svnadmin createtxn'"
sbox.build()
-
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
@@ -121,7 +120,6 @@
"'svnadmin rmtxns'"
sbox.build()
-
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
@@ -149,6 +147,7 @@
def dump_copied_dir(sbox):
"'svnadmin dump' on copied directory"
+
sbox.build()
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
@@ -170,6 +169,7 @@
def dump_move_dir_modify_child(sbox):
"'svnadmin dump' on modified child of copied dir"
+
sbox.build()
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
@@ -181,32 +181,30 @@
svntest.main.run_svn(None, 'ci', wc_dir, '--quiet', '-m', 'log msg')
output, errput = svntest.main.run_svnadmin("dump", repo_dir)
- if svntest.actions.compare_and_display_lines(
+ svntest.actions.compare_and_display_lines(
"Output of 'svnadmin dump' is unexpected.",
'STDERR', ["* Dumped revision 0.\n",
"* Dumped revision 1.\n",
- "* Dumped revision 2.\n"], errput):
- raise svntest.Failure
+ "* Dumped revision 2.\n"], errput)
output, errput = svntest.main.run_svnadmin("dump", "-r", "0:HEAD", repo_dir)
- if svntest.actions.compare_and_display_lines(
+ svntest.actions.compare_and_display_lines(
"Output of 'svnadmin dump' is unexpected.",
'STDERR', ["* Dumped revision 0.\n",
"* Dumped revision 1.\n",
- "* Dumped revision 2.\n"], errput):
- raise svntest.Failure
+ "* Dumped revision 2.\n"], errput)
#----------------------------------------------------------------------
def dump_quiet(sbox):
"'svnadmin dump --quiet'"
+
sbox.build()
output, errput = svntest.main.run_svnadmin("dump", sbox.repo_dir, '--quiet')
- if svntest.actions.compare_and_display_lines(
+ svntest.actions.compare_and_display_lines(
"Output of 'svnadmin dump --quiet' is unexpected.",
- 'STDERR', [], errput):
- raise svntest.Failure
+ 'STDERR', [], errput)
########################################################################
Index: subversion/tests/clients/cmdline/prop_tests.py
===================================================================
--- subversion/tests/clients/cmdline/prop_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/prop_tests.py (working copy)
@@ -53,7 +53,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
# Add properties to one file and one directory
@@ -97,7 +96,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a property to a file and a directory
@@ -135,7 +133,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
@@ -199,7 +196,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
iota_path = os.path.join(wc_dir, 'iota')
@@ -272,7 +268,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a property to a file
@@ -324,7 +319,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a property to a file and a directory
@@ -394,7 +388,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a property to two files
@@ -453,7 +446,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a property to two files
@@ -521,8 +513,8 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
+
A_path = os.path.join(wc_dir, 'A')
E_path = os.path.join(wc_dir, 'A', 'B', 'E')
iota_path = os.path.join(wc_dir, 'iota')
@@ -622,7 +614,6 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
orig_mime_type = 'image/fake_image'
@@ -709,8 +700,8 @@
# Bootstrap
sbox.build()
-
wc_dir = sbox.wc_dir
+
A_path = os.path.join(wc_dir, 'A')
B_path = os.path.join(wc_dir, 'A', 'B')
iota_path = os.path.join(wc_dir, 'iota')
Index: subversion/tests/clients/cmdline/log_tests.py
===================================================================
--- subversion/tests/clients/cmdline/log_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/log_tests.py (working copy)
@@ -67,7 +67,6 @@
global max_revision
sbox.build()
-
wc_path = sbox.wc_dir
# Now we have a repos and wc at revision 1.
@@ -315,8 +314,6 @@
guarantee_repos_and_wc(sbox)
- result = 0
-
was_cwd = os.getcwd()
os.chdir(sbox.wc_dir)
@@ -450,8 +447,6 @@
guarantee_repos_and_wc(sbox)
- result = 0
-
was_cwd = os.getcwd()
os.chdir(sbox.wc_dir)
@@ -476,8 +471,6 @@
guarantee_repos_and_wc(sbox)
- result = 0
-
my_url = svntest.main.current_repo_url + "/A/B/E/alpha"
output, errput = svntest.main.run_svn (None, 'log', '-r', '8', my_url)
Index: subversion/tests/clients/cmdline/basic_tests.py
===================================================================
--- subversion/tests/clients/cmdline/basic_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/basic_tests.py (working copy)
@@ -52,7 +52,6 @@
"basic checkout of a wc"
sbox.build()
-
wc_dir = sbox.wc_dir
# Checkout of a different URL into a working copy fails
@@ -114,7 +113,6 @@
"basic status command"
sbox.build()
-
wc_dir = sbox.wc_dir
# Created expected output tree for 'svn status'
@@ -128,7 +126,6 @@
"basic commit command"
sbox.build()
-
wc_dir = sbox.wc_dir
# Make a couple of local mods to files
@@ -164,7 +161,6 @@
"basic update command"
sbox.build()
-
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
@@ -223,6 +219,7 @@
"basic mkdir URL"
sbox.build()
+
Y_url = svntest.main.current_repo_url + '/Y'
Y_Z_url = svntest.main.current_repo_url + '/Y/Z'
@@ -270,7 +267,6 @@
## Here we go...
sbox.build()
-
wc_dir = sbox.wc_dir
# Make the "other" working copy
@@ -379,7 +375,6 @@
"receiving text merges as part of an update"
sbox.build()
-
wc_dir = sbox.wc_dir
# First change the greek tree to make two files 10 lines long
@@ -490,7 +485,6 @@
"basic conflict creation and resolution"
sbox.build()
-
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
@@ -603,7 +597,6 @@
"basic cleanup command"
sbox.build()
-
wc_dir = sbox.wc_dir
# Lock some directories.
@@ -636,7 +629,6 @@
"basic revert command"
sbox.build()
-
wc_dir = sbox.wc_dir
# Modify some files.
@@ -760,7 +752,6 @@
"basic switch command"
sbox.build()
-
wc_dir = sbox.wc_dir
### Switch the file `iota' to `A/D/gamma'.
@@ -841,7 +832,6 @@
expected_disk,
expected_status)
-
#----------------------------------------------------------------------
def verify_file_deleted(message, path):
@@ -853,7 +843,6 @@
###TODO We should raise a less generic error here. which?
raise Failure
-
def can_cd_to_dir(path):
current_dir = os.getcwd();
try: os.chdir(path)
@@ -865,7 +854,6 @@
"basic delete command"
sbox.build()
-
wc_dir = sbox.wc_dir
# modify text of chi
@@ -1065,7 +1053,6 @@
"checkout a path no longer in HEAD"
sbox.build()
-
wc_dir = sbox.wc_dir
# Delete A/D and commit.
@@ -1166,7 +1153,6 @@
"basic import of single new file"
sbox.build()
-
wc_dir = sbox.wc_dir
# create a new directory with files of various permissions
@@ -1229,7 +1215,6 @@
"basic import of executable files"
sbox.build()
-
wc_dir = sbox.wc_dir
# create a new directory with files of various permissions
@@ -1313,7 +1298,6 @@
"basic cat of files"
sbox.build()
-
wc_dir = sbox.wc_dir
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -1420,8 +1404,8 @@
"basic auth caching"
sbox.build()
-
wc_dir = sbox.wc_dir
+
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
@@ -1468,7 +1452,6 @@
# svn_wc_is_ignored function.
sbox.build()
-
wc_dir = sbox.wc_dir
dir_path = os.path.join(wc_dir, 'dir')
@@ -1507,7 +1490,6 @@
# svn_wc_is_ignored function.
sbox.build()
-
wc_dir = sbox.wc_dir
dir_path = os.path.join(wc_dir, 'dir')
@@ -1521,7 +1503,6 @@
# import new dir into repository
url = os.path.join(svntest.main.current_repo_url, 'dir')
-
output, errput = svntest.actions.run_and_verify_svn(
None, None, [], 'import',
'--username', svntest.main.wc_author,
@@ -1567,7 +1548,6 @@
None, None, None,
None, None, 1)
-
def uri_syntax(sbox):
'make sure URI syntaxes are parsed correctly'
@@ -1587,7 +1567,6 @@
if not errput:
raise svntest.Failure
-
#----------------------------------------------------------------------
########################################################################
Index: subversion/tests/clients/cmdline/export_tests.py
===================================================================
--- subversion/tests/clients/cmdline/export_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/export_tests.py (working copy)
@@ -40,13 +40,13 @@
def export_empty_directory(sbox):
"export an empty directory"
sbox.build()
+
svntest.main.safe_rmtree(sbox.wc_dir)
export_target = sbox.wc_dir
empty_dir_url = svntest.main.current_repo_url + '/A/C'
svntest.main.run_svn(None, 'export', empty_dir_url, export_target)
if not os.path.exists(export_target):
raise svntest.Failure
- return 0
########################################################################
Index: subversion/tests/clients/cmdline/update_tests.py
===================================================================
--- subversion/tests/clients/cmdline/update_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/update_tests.py (working copy)
@@ -72,7 +72,6 @@
"update a locally-modified binary file"
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a binary file to the project.
@@ -181,15 +180,12 @@
print extra_files
raise svntest.Failure
- return 0
-
#----------------------------------------------------------------------
def update_binary_file_2(sbox):
"update to an old revision of a binary files"
sbox.build()
-
wc_dir = sbox.wc_dir
# Suck up contents of a test .png file.
@@ -290,13 +286,13 @@
# Do an update from revision 2 and make sure that our binary file
# gets reverted to its original contents.
- return svntest.actions.run_and_verify_update(wc_dir,
- expected_output,
- expected_disk,
- expected_status,
- None, None, None,
- None, None, 1,
- '-r', '2', wc_dir)
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None,
+ None, None, 1,
+ '-r', '2', wc_dir)
#----------------------------------------------------------------------
@@ -305,7 +301,6 @@
"update missing items (by name) in working copy"
sbox.build()
-
wc_dir = sbox.wc_dir
# Remove some files and dirs from the working copy.
@@ -344,13 +339,13 @@
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
# Do the update and check the results in three ways.
- return svntest.actions.run_and_verify_update(wc_dir,
- expected_output,
- expected_disk,
- expected_status,
- None, None, None, None, None, 0,
- mu_path, rho_path,
- E_path, H_path)
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None, 0,
+ mu_path, rho_path,
+ E_path, H_path)
#----------------------------------------------------------------------
@@ -358,7 +353,6 @@
"update should not munge adds or replaces"
sbox.build()
-
wc_dir = sbox.wc_dir
# Commit something so there's actually a new revision to update to.
@@ -402,10 +396,10 @@
})
# Do the update and check the results in three ways.
- return svntest.actions.run_and_verify_update(wc_dir,
- expected_output,
- expected_disk,
- expected_status)
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status)
#----------------------------------------------------------------------
@@ -414,7 +408,6 @@
"update to revision 0"
sbox.build()
-
wc_dir = sbox.wc_dir
iota_path = os.path.join(wc_dir, 'iota')
@@ -430,14 +423,13 @@
expected_disk = svntest.wc.State(wc_dir, { })
# Do the update and check the results.
- return svntest.actions.run_and_verify_update(wc_dir,
- expected_output,
- expected_disk,
- None, None,
- None, None, None, None, 0,
- '-r', '0', wc_dir)
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ None, None,
+ None, None, None, None, 0,
+ '-r', '0', wc_dir)
-
#----------------------------------------------------------------------
def receive_overlapping_same_change(sbox):
@@ -462,7 +454,6 @@
### the two modifications are identical.
sbox.build()
-
wc_dir = sbox.wc_dir
# Modify iota.
@@ -503,10 +494,10 @@
expected_status = svntest.actions.get_virginal_state(other_wc, 2)
# Do the update and check the results in three ways.
- return svntest.actions.run_and_verify_update(other_wc,
- expected_output,
- expected_disk,
- expected_status)
+ svntest.actions.run_and_verify_update(other_wc,
+ expected_output,
+ expected_disk,
+ expected_status)
#----------------------------------------------------------------------
@@ -530,7 +521,6 @@
"delete files and update to resolve text conflicts"
sbox.build()
-
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
@@ -634,8 +624,7 @@
expected_status = svntest.actions.get_virginal_state(wc_backup, 2)
expected_status.tweak('A/D/G/rho', status=' C')
- return svntest.actions.run_and_verify_status (wc_backup,
- expected_status)
+ svntest.actions.run_and_verify_status(wc_backup, expected_status)
#----------------------------------------------------------------------
@@ -654,7 +643,6 @@
"update that deletes modified files"
sbox.build()
-
wc_dir = sbox.wc_dir
# Delete a file
@@ -728,7 +716,6 @@
"update after add/rm of deleted state"
sbox.build()
-
wc_dir = sbox.wc_dir
# Delete a file and directory from WC
@@ -795,7 +782,6 @@
"update that replaces a directory"
sbox.build()
-
wc_dir = sbox.wc_dir
# Delete a directory
@@ -859,7 +845,7 @@
# Update to revision 1 replaces the directory
outlines, errlines = svntest.main.run_svn(None, 'up', '-r', '1', wc_dir)
if errlines:
- return 1
+ raise svntest.Failure
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak(repos_rev=3)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@@ -870,7 +856,6 @@
"update with explicit file target"
sbox.build()
-
wc_dir = sbox.wc_dir
expected_disk = svntest.main.greek_state.copy()
@@ -909,8 +894,8 @@
"receive prop update to file scheduled for deletion"
sbox.build()
-
wc_dir = sbox.wc_dir
+
other_wc = sbox.add_wc_path('other')
# Make the "other" working copy.
@@ -952,20 +937,21 @@
expected_status.tweak('iota', status='D ')
# Do the update and check the results in three ways.
- return svntest.actions.run_and_verify_update(other_wc,
- expected_output,
- expected_disk,
- expected_status)
- return 0
+ svntest.actions.run_and_verify_update(other_wc,
+ expected_output,
+ expected_disk,
+ expected_status)
#----------------------------------------------------------------------
def update_receive_illegal_name(sbox):
"bail when receive a file or dir named .svn"
+
sbox.build()
+ wc_dir = sbox.wc_dir
# This tests the revision 4334 fix for issue #1068.
- wc_dir = sbox.wc_dir
+
legal_url = svntest.main.current_repo_url + '/A/D/G/svn'
illegal_url = svntest.main.current_repo_url + '/A/D/G/.svn'
# Ha! The client doesn't allow us to mkdir a '.svn' but it does
@@ -989,8 +975,8 @@
"update missing dir to rev in which it is absent"
sbox.build()
-
wc_dir = sbox.wc_dir
+
E_path = os.path.join(wc_dir, 'A', 'B', 'E')
H_path = os.path.join(wc_dir, 'A', 'D', 'H')
@@ -1058,7 +1044,6 @@
"another \"hudson\" problem: updates that delete"
sbox.build()
-
wc_dir = sbox.wc_dir
# Delete/commit gamma thus making it 'deleted'
@@ -1200,6 +1185,7 @@
# incomplete ("!" in status).
sbox.build()
wc_dir = sbox.wc_dir
+
C_url = svntest.main.current_repo_url + '/A/C'
svntest.main.safe_rmtree(wc_dir)
@@ -1222,7 +1208,6 @@
"update target till it's gone, then get it back"
sbox.build()
-
wc_dir = sbox.wc_dir
iota_path = os.path.join(wc_dir, 'iota')
Index: subversion/tests/clients/cmdline/utf8_tests.py
===================================================================
--- subversion/tests/clients/cmdline/utf8_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/utf8_tests.py (working copy)
@@ -50,9 +50,7 @@
def basic_utf8_conversion(sbox):
"conversion of paths and logs to/from utf8"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make sure the test runs in an ISO-8859-1 environment. Otherwise,
@@ -76,18 +74,15 @@
i18n_filename))
if errlines:
print "Failed to schedule i18n filename for addition"
- return 1
+ raise svntest.Failure
outlines, inlines = svntest.main.run_svn(None, # no error expected
'commit', '-m', i18n_logmsg,
wc_dir)
if errlines:
print "Failed to commit i18n filename"
- return 1
+ raise svntest.Failure
-
- return 0
-
# Here's how the test should really work:
# 1. sh LC_ALL=ISO-8859-1 svn commit <filename> -m "<logmsg>"
Index: subversion/tests/clients/cmdline/trans_tests.py
===================================================================
--- subversion/tests/clients/cmdline/trans_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/trans_tests.py (working copy)
@@ -179,7 +179,6 @@
"commit new files with keywords active from birth"
sbox.build()
-
wc_dir = sbox.wc_dir
setup_working_copy (wc_dir)
@@ -315,7 +314,6 @@
"update modified file with eol-style 'native'"
sbox.build()
-
wc_dir = sbox.wc_dir
# Replace contents of rho and set eol translation to 'native'
Index: subversion/tests/clients/cmdline/commit_tests.py
===================================================================
--- subversion/tests/clients/cmdline/commit_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/commit_tests.py (working copy)
@@ -117,10 +117,8 @@
expected_status = get_standard_state(wc_dir)
# Verify status -- all local mods should be present.
- if svntest.actions.run_and_verify_status(wc_dir, expected_status):
- return 1
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
- return 0
######################################################################
# Tests
@@ -133,13 +131,11 @@
def commit_one_file(sbox):
"commit one file"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make standard slew of changes to working copy.
- if make_standard_slew_of_changes(wc_dir): return 1
+ make_standard_slew_of_changes(wc_dir)
omega_path = os.path.join(wc_dir, 'A', 'D', 'H', 'omega')
@@ -154,13 +150,13 @@
expected_status.tweak('A/D/H/omega', wc_rev=2, status=' ')
# Commit the one file.
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- omega_path)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ omega_path)
#----------------------------------------------------------------------
@@ -168,13 +164,11 @@
def commit_one_new_file(sbox):
"commit one newly added file"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make standard slew of changes to working copy.
- if make_standard_slew_of_changes(wc_dir): return 1
+ make_standard_slew_of_changes(wc_dir)
gloo_path = os.path.join(wc_dir, 'A', 'D', 'H', 'gloo')
@@ -189,13 +183,13 @@
expected_status.tweak('A/D/H/gloo', wc_rev=2, status=' ')
# Commit the one file.
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- gloo_path)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ gloo_path)
#----------------------------------------------------------------------
@@ -203,13 +197,11 @@
def commit_one_new_binary_file(sbox):
"commit one newly added binary file"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make standard slew of changes to working copy.
- if make_standard_slew_of_changes(wc_dir): return 1
+ make_standard_slew_of_changes(wc_dir)
gloo_path = os.path.join(wc_dir, 'A', 'D', 'H', 'gloo')
svntest.main.run_svn(None, 'propset', 'svn:mime-type',
@@ -226,13 +218,13 @@
expected_status.tweak('A/D/H/gloo', wc_rev=2, status=' ')
# Commit the one file.
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- gloo_path)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ gloo_path)
#----------------------------------------------------------------------
@@ -240,9 +232,7 @@
def commit_multiple_targets(sbox):
"commit multiple targets"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# This test will commit three targets: psi, B, and pi. In that order.
@@ -285,13 +275,13 @@
# A/D/G should still have a local property set, too.
expected_status.tweak('A/D/G', status=' M')
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- psi_path, AB_path, pi_path)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ psi_path, AB_path, pi_path)
#----------------------------------------------------------------------
@@ -299,9 +289,7 @@
def commit_multiple_targets_2(sbox):
"commit multiple targets, 2nd variation"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# This test will commit three targets: psi, B, omega and pi. In that order.
@@ -346,27 +334,25 @@
# A/D/G should still have a local property set, too.
expected_status.tweak('A/D/G', status=' M')
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- psi_path, AB_path,
- omega_path, pi_path)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ psi_path, AB_path,
+ omega_path, pi_path)
#----------------------------------------------------------------------
def commit_inclusive_dir(sbox):
"commit wc_dir/A/D -- includes D. (anchor=A, tgt=D)"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make standard slew of changes to working copy.
- if make_standard_slew_of_changes(wc_dir): return 1
+ make_standard_slew_of_changes(wc_dir)
# Create expected output tree.
D_path = os.path.join(wc_dir, 'A', 'D')
@@ -397,26 +383,24 @@
expected_status.tweak('A/D/H/chi', 'A/D/H/gloo', wc_rev=2, status=' ')
# Commit the one file.
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- D_path)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ D_path)
#----------------------------------------------------------------------
def commit_top_dir(sbox):
"commit wc_dir -- (anchor=wc_dir, tgt={})"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make standard slew of changes to working copy.
- if make_standard_slew_of_changes(wc_dir): return 1
+ make_standard_slew_of_changes(wc_dir)
# Create expected output tree.
top_path = wc_dir
@@ -462,13 +446,13 @@
'A/D/H/gloo', wc_rev=2, status=' ')
# Commit the one file.
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ wc_dir)
#----------------------------------------------------------------------
@@ -489,23 +473,21 @@
def commit_unversioned_thing(sbox):
"committing unversioned object produces error"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Create an unversioned file in the wc.
svntest.main.file_append(os.path.join(wc_dir, 'blorg'), "nothing to see")
# Commit a non-existent file and *expect* failure:
- return svntest.actions.run_and_verify_commit (wc_dir,
- None,
- None,
- "Can't find an entry",
- None, None,
- None, None,
- os.path.join(wc_dir,'blorg'))
-
+ svntest.actions.run_and_verify_commit (wc_dir,
+ None,
+ None,
+ "Can't find an entry",
+ None, None,
+ None, None,
+ os.path.join(wc_dir,'blorg'))
+
#----------------------------------------------------------------------
# regression test for bug #391
@@ -513,9 +495,7 @@
def nested_dir_replacements(sbox):
"replace two nested dirs, verify empty contents"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Delete and re-add A/D (a replacement), and A/D/H (another replace).
@@ -546,8 +526,7 @@
'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi', 'A/D/gamma',
status='D ')
- if svntest.actions.run_and_verify_status(wc_dir, expected_status):
- return 1
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Build expected post-commit trees:
@@ -569,13 +548,13 @@
'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi', 'A/D/gamma')
# Commit from the top of the working copy and verify output & status.
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ wc_dir)
#----------------------------------------------------------------------
@@ -587,9 +566,7 @@
def hudson_part_1(sbox):
"hudson prob 1.0: delete file, commit, update"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Remove gamma from the working copy.
@@ -607,12 +584,11 @@
expected_status.remove('A/D/gamma')
# Commit the deletion of gamma and verify.
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
# Now gamma should be marked as `deleted' under the hood. When we
# update, we should no output, and a perfect, virginal status list
@@ -629,10 +605,10 @@
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
expected_status.remove('A/D/gamma')
- return svntest.actions.run_and_verify_update(wc_dir,
- expected_output,
- expected_disk,
- expected_status)
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status)
#----------------------------------------------------------------------
@@ -643,9 +619,7 @@
def hudson_part_1_variation_1(sbox):
"hudson prob 1.1: delete dir, commit, update"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Remove H from the working copy.
@@ -663,12 +637,11 @@
expected_status.remove('A/D/H', 'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi')
# Commit the deletion of H and verify.
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
# Now H should be marked as `deleted' under the hood. When we
# update, we should no see output, and a perfect, virginal status
@@ -685,10 +658,10 @@
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
expected_status.remove('A/D/H', 'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi')
- return svntest.actions.run_and_verify_update(wc_dir,
- expected_output,
- expected_disk,
- expected_status)
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status)
#----------------------------------------------------------------------
@@ -699,9 +672,7 @@
def hudson_part_1_variation_2(sbox):
"hudson prob 1.2: delete, commit, re-add, commit"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Remove gamma from the working copy.
@@ -719,12 +690,11 @@
expected_status.remove('A/D/gamma')
# Commit the deletion of gamma and verify.
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
# Now gamma should be marked as `deleted' under the hood.
# Go ahead and re-add gamma, so that is *also* scheduled for addition.
@@ -737,8 +707,7 @@
expected_status.tweak(wc_rev=1)
expected_status.tweak('A/D/gamma', wc_rev=0, status='A ')
- if svntest.actions.run_and_verify_status(wc_dir, expected_status):
- return 1
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Create expected commit output.
expected_output = svntest.wc.State(wc_dir, {
@@ -750,11 +719,11 @@
expected_status.tweak(wc_rev=1)
expected_status.tweak('A/D/gamma', wc_rev=3)
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
#----------------------------------------------------------------------
@@ -767,9 +736,7 @@
def hudson_part_2(sbox):
"hudson prob 2.0: prop commit on old dir fails"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Remove gamma from the working copy.
@@ -788,12 +755,11 @@
expected_status.remove('A/D/gamma')
# Commit the deletion of gamma and verify.
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
# Now gamma should be marked as `deleted' under the hood, at
# revision 2. Meanwhile, A/D is still lagging at revision 1.
@@ -802,13 +768,13 @@
svntest.main.run_svn(None, 'ps', 'foo', 'bar', D_path)
# Commit and *expect* a repository Merge failure:
- return svntest.actions.run_and_verify_commit (wc_dir,
- None,
- None,
- "out.of.date",
- None, None,
- None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ None,
+ None,
+ "out.of.date",
+ None, None,
+ None, None,
+ wc_dir)
#----------------------------------------------------------------------
@@ -822,9 +788,7 @@
def hudson_part_2_1(sbox):
"hudson prob 2.1: move files, update empty dir"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Move all the files in H to G
@@ -895,9 +859,7 @@
def hook_test(sbox):
"hook testing"
- if sbox.build():
- return 1
-
+ sbox.build()
# Get paths to the working copy and repository
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
@@ -937,9 +899,8 @@
# Make sure we got the right output.
if output != expected_output:
- return 1
+ raise SVNUnexpectedOutput("Output does not match expectation")
- return 0
#----------------------------------------------------------------------
@@ -951,9 +912,7 @@
def merge_mixed_revisions(sbox):
"commit mixed-rev wc (no erroneous merge error)"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make some convenient paths.
@@ -979,12 +938,11 @@
expected_status.tweak(wc_rev=1)
expected_status.tweak('iota', 'A/D/H/chi', wc_rev=2)
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
# 2. svn up A/D/H
@@ -1000,11 +958,10 @@
'psi' : Item("This is the file 'psi'."),
})
expected_output = svntest.wc.State(wc_dir, { })
- if svntest.actions.run_and_verify_update (H_path,
- expected_output,
- expected_disk,
- expected_status):
- return 1
+ svntest.actions.run_and_verify_update (H_path,
+ expected_output,
+ expected_disk,
+ expected_status)
# 3. echo "moo" >> iota; svn ci iota
@@ -1018,12 +975,11 @@
wc_rev=2)
expected_status.tweak('iota', wc_rev=3)
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
# 4. echo "moo" >> A/D/H/chi; svn ci A/D/H/chi
@@ -1036,12 +992,11 @@
expected_status.tweak('A/D/H/chi', wc_rev=4)
expected_status.tweak('A/D/H', 'A/D/H/omega', 'A/D/H/psi', wc_rev=2)
expected_status.tweak('iota', wc_rev=3)
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
# 5. echo "moo" >> iota; svn ci iota
svntest.main.file_append(iota_path, "moomoo")
@@ -1053,12 +1008,11 @@
expected_status.tweak('A/D/H', 'A/D/H/omega', 'A/D/H/psi', wc_rev=2)
expected_status.tweak('A/D/H/chi', wc_rev=4)
expected_status.tweak('iota', wc_rev=5)
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
# At this point, here is what our tree should look like:
# _ 1 ( 5) working_copies/commit_tests-10
@@ -1098,20 +1052,18 @@
expected_status.tweak('iota', 'A/D/H/omega', wc_rev=6)
expected_status.tweak('A/D/H', 'A/D/H/psi', wc_rev=2)
expected_status.tweak('A/D/H/chi', wc_rev=4)
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
#----------------------------------------------------------------------
def commit_uri_unsafe(sbox):
"commit files and dirs with URI-unsafe characters"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Note: on Windows, files can't have angle brackets in them, so we
@@ -1188,11 +1140,11 @@
for item in expected_output.desc.keys():
expected_status.add({ item : Item(wc_rev=2, repos_rev=2, status=' ') })
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
#----------------------------------------------------------------------
@@ -1200,9 +1152,7 @@
def commit_deleted_edited(sbox):
"commit deleted yet edited files"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make some convenient paths.
@@ -1229,20 +1179,18 @@
expected_status.remove('iota', 'A/mu')
expected_status.tweak(wc_rev=1)
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
#----------------------------------------------------------------------
def commit_in_dir_scheduled_for_addition(sbox):
"commit a file inside dir scheduled for addition"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
A_path = os.path.join(wc_dir, 'A')
@@ -1253,14 +1201,13 @@
# Commit a copied thing inside an added-with-history directory,
# expecting a specific error to occur!
- if svntest.actions.run_and_verify_commit (wc_dir,
- None,
- None,
- "unversioned",
- None, None,
- None, None,
- mu_path):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ None,
+ None,
+ "unversioned",
+ None, None,
+ None, None,
+ mu_path)
Q_path = os.path.join(wc_dir, 'Q')
bloo_path = os.path.join(Q_path, 'bloo')
@@ -1271,13 +1218,13 @@
# Commit a regular added thing inside an added directory,
# expecting a specific error to occur!
- return svntest.actions.run_and_verify_commit (wc_dir,
- None,
- None,
- "not versioned",
- None, None,
- None, None,
- bloo_path)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ None,
+ None,
+ "not versioned",
+ None, None,
+ None, None,
+ bloo_path)
#----------------------------------------------------------------------
@@ -1285,9 +1232,7 @@
def commit_rmd_and_deleted_file(sbox):
"commit deleted (and missing) file"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -1297,19 +1242,15 @@
# Commit, hoping to see no errors
out, err = svntest.main.run_svn(None, 'commit', '-m', 'logmsg', mu_path)
if len(err) != 0:
- return 1
+ raise SVNUnexpectedStderr("Output on stderr where none expected")
- return 0
-
#----------------------------------------------------------------------
# Issue #644 which failed over ra_dav.
def commit_add_file_twice(sbox):
"issue 644 attempt to add a file twice"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Create a file
@@ -1331,14 +1272,13 @@
expected_status.tweak('A/D/H/gloo', wc_rev=2, status=' ')
# Commit should succeed
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ wc_dir)
# Update to state before commit
svntest.main.run_svn(None, 'up', '-r', '1', wc_dir)
@@ -1349,13 +1289,13 @@
svntest.main.run_svn(None, 'add', gloo_path)
# Commit and *expect* a failure:
- return svntest.actions.run_and_verify_commit (wc_dir,
- None,
- None,
- "already exists",
- None, None,
- None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ None,
+ None,
+ "already exists",
+ None, None,
+ None, None,
+ wc_dir)
#----------------------------------------------------------------------
@@ -1367,8 +1307,8 @@
"commit from a dir with a longer name than the wc"
sbox.build()
-
wc_dir = sbox.wc_dir
+
was_dir = os.getcwd()
abs_wc_dir = os.path.join(was_dir, wc_dir)
@@ -1405,31 +1345,30 @@
def commit_with_lock(sbox):
"try to commit when directory is locked"
- if sbox.build():
- return 1
-
+ sbox.build()
# modify gamma and lock its directory
wc_dir = sbox.wc_dir
+
D_path = os.path.join(wc_dir, 'A', 'D')
gamma_path = os.path.join(D_path, 'gamma')
svntest.main.file_append(gamma_path, "modified gamma")
svntest.actions.lock_admin_dir(D_path)
# this commit should fail
- if svntest.actions.run_and_verify_commit(wc_dir,
- None,
- None,
- 'already-locked',
- None, None,
- None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit(wc_dir,
+ None,
+ None,
+ 'already-locked',
+ None, None,
+ None, None,
+ wc_dir)
# unlock directory
outlines, errlines = svntest.main.run_svn(None, 'cleanup', D_path)
if errlines:
- return 1
+ raise SVNUnexpectedStderr("Output on stderr where none expected")
+
# this commit should succeed
expected_output = svntest.wc.State(wc_dir, {
'A/D/gamma' : Item(verb='Sending'),
@@ -1437,16 +1376,14 @@
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak(repos_rev=2) # post-commit status
expected_status.tweak('A/D/gamma', wc_rev=2)
- if svntest.actions.run_and_verify_commit(wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ wc_dir)
-
#----------------------------------------------------------------------
# Explicitly commit the current directory. This did at one point fail
@@ -1491,9 +1428,7 @@
def failed_commit(sbox):
"commit with conflicts and check txn in repo"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make the other working copy
@@ -1510,19 +1445,18 @@
# Commit both working copies. The second commit should fail.
output, errput = svntest.main.run_svn(None, 'commit', '-m', 'log', wc_dir)
if errput:
- return 1
+ raise SVNUnexpectedStderr("Output on stderr where none expected")
output, errput = svntest.main.run_svn(1, 'commit', '-m', 'log', other_wc_dir)
if not errput:
- return 1
+ raise SVNUnexpectedStderr("No output on stderr where some expected")
# Now list the txns in the repo. The list should be empty.
output, errput = svntest.main.run_svnadmin('lstxns', sbox.repo_dir)
- if svntest.actions.compare_and_display_lines(
+ svntest.actions.compare_and_display_lines(
"Error running 'svnadmin lstxns'.",
- 'STDERR', [], errput):
- return 1
- return svntest.actions.compare_and_display_lines(
+ 'STDERR', [], errput)
+ svntest.actions.compare_and_display_lines(
"Output of 'svnadmin lstxns' is unexpected.",
'STDOUT', [], output)
@@ -1536,9 +1470,7 @@
def commit_multiple_wc(sbox):
"attempted commit from multiple wc fails"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Checkout a second working copy
@@ -1551,7 +1483,7 @@
svntest.main.wc_passwd,
url, wc2_dir)
if len (stderr_lines) != 0:
- return 1
+ raise SVNUnexpectedStderr("Output on stderr where none expected")
# Modify both working copies
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -1562,32 +1494,26 @@
# Verify modified status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/mu', status='M ')
- if svntest.actions.run_and_verify_status(wc_dir, expected_status):
- return 1
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
expected_status2 = svntest.actions.get_virginal_state(wc2_dir, 1)
expected_status2.tweak('A/B/lambda', status='M ')
- if svntest.actions.run_and_verify_status(wc2_dir, expected_status2):
- return 1
+ svntest.actions.run_and_verify_status(wc2_dir, expected_status2)
# Commit should fail, even though one target is a "child" of the other.
output, errput = svntest.main.run_svn("Not locked", 'commit', '-m', 'log',
wc_dir, wc2_dir)
if not errput:
- return 1
+ raise SVNUnexpectedStderr("No output on stderr where some expected")
# Verify status unchanged
- if svntest.actions.run_and_verify_status(wc_dir, expected_status):
- return 1
- if svntest.actions.run_and_verify_status(wc2_dir, expected_status2):
- return 1
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.run_and_verify_status(wc2_dir, expected_status2)
def commit_symlink(sbox):
"committing a symlink should fail"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
newfile_path = os.path.join(wc_dir, 'newfile')
@@ -1599,13 +1525,12 @@
os.symlink('linktarget', newfile_path)
out, err = svntest.main.run_svn(1, 'ci', '-m', 'log msg', wc_dir)
- if err:
- return 0
- else:
- return 1
+ if not err:
+ raise SVNUnexpectedStderr("No output on stderr where some expected")
def commit_nonrecursive(sbox):
"commit named targets with -N (issues #1195, #1239)"
+
sbox.build()
wc_dir = sbox.wc_dir
@@ -1812,9 +1737,7 @@
def commit_out_of_date_deletions(sbox):
"commit deletion of out-of-date file or dir"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
@@ -1836,14 +1759,13 @@
expected_status.tweak(wc_rev=1)
expected_status.tweak('A/D/H/omega', 'A/C', wc_rev=2, status=' ')
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- wc_dir):
- return 1
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ wc_dir)
# Now, in the second working copy, schedule both omega and C for deletion.
omega_path = os.path.join(wc_backup, 'A', 'D', 'H', 'omega')
@@ -1860,7 +1782,7 @@
out_of_date_error = 1;
if out_of_date_error == 0:
- return 1
+ raise svntest.Failure
# Attempt to delete directory C. This should return an (expected)
# out-of-dateness error.
@@ -1872,18 +1794,14 @@
out_of_date_error = 1;
if out_of_date_error == 0:
- return 1
+ raise svntest.Failure
- return 0
-
-
def commit_with_bad_log_message(sbox):
"commit with a log message containing bad data"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
iota_path = os.path.join(wc_dir, 'iota')
log_msg_path = os.path.join(wc_dir, 'log-message')
@@ -1894,16 +1812,14 @@
svntest.main.file_append(log_msg_path, '\x00')
# Commit and expect an error.
- if svntest.actions.run_and_verify_commit(wc_dir,
- None, None,
- "contains a zero byte",
- None, None,
- None, None,
- '-F', log_msg_path,
- iota_path):
- return 1
+ svntest.actions.run_and_verify_commit(wc_dir,
+ None, None,
+ "contains a zero byte",
+ None, None,
+ None, None,
+ '-F', log_msg_path,
+ iota_path)
-
def from_wc_top_with_bad_editor(sbox):
"commit with invalid external editor cmd"
Index: subversion/tests/clients/cmdline/svnlook_tests.py
===================================================================
--- subversion/tests/clients/cmdline/svnlook_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/svnlook_tests.py (working copy)
@@ -47,7 +47,6 @@
"test 'svnlook youngest' subcommand"
sbox.build()
-
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
@@ -69,14 +68,13 @@
expected_status.tweak(wc_rev=1)
expected_status.tweak('A/mu', 'A/D/G/rho', wc_rev=2)
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- wc_dir):
- raise svntest.Failure
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ wc_dir)
# Youngest revision should now be 2. Let's verify that.
output, errput = svntest.main.run_svnlook("youngest", repo_dir)
@@ -116,18 +114,16 @@
'A/B/E2' : Item(status=' ', wc_rev=2, repos_rev=2),
'A/B/E2/beta' : Item(status=' ', wc_rev=2, repos_rev=2),
})
- if svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None,
- None, None,
- None, None,
- wc_dir):
- raise svntest.Failure
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ None, None,
+ None, None,
+ wc_dir)
output, errput = svntest.main.run_svnlook("dirs-changed", repo_dir)
- if errput:
- raise svntest.Failure
+ if errput: raise svntest.Failure
# Okay. No failure, but did we get the right output?
if len(output) != 2:
@@ -162,8 +158,7 @@
if errput: raise svntest.Failure
output, errput = svntest.main.run_svnlook("diff", repo_dir)
- if errput:
- raise svntest.Failure
+ if errput: raise svntest.Failure
# Okay. No failure, but did we get the right output?
if len(output) != len(expected_output):
Index: subversion/tests/clients/cmdline/schedule_tests.py
===================================================================
--- subversion/tests/clients/cmdline/schedule_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/schedule_tests.py (working copy)
@@ -64,11 +64,9 @@
def add_files(sbox):
"schedule: add some files"
+ sbox.build()
wc_dir = sbox.wc_dir
- if svntest.actions.make_repo_and_wc(sbox):
- return 1
-
# Create some files, then schedule them for addition
delta_path = os.path.join(wc_dir, 'delta')
zeta_path = os.path.join(wc_dir, 'A', 'B', 'zeta')
@@ -88,18 +86,16 @@
'A/D/G/epsilon' : Item(status='A ', wc_rev=0, repos_rev=1),
})
- return svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
#----------------------------------------------------------------------
def add_directories(sbox):
"schedule: add some directories"
+ sbox.build()
wc_dir = sbox.wc_dir
-
- if svntest.actions.make_repo_and_wc(sbox):
- return 1
-
+
# Create some directories, then schedule them for addition
X_path = os.path.join(wc_dir, 'X')
Y_path = os.path.join(wc_dir, 'A', 'C', 'Y')
@@ -119,18 +115,16 @@
'A/D/H/Z' : Item(status='A ', wc_rev=0, repos_rev=1),
})
- return svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
#----------------------------------------------------------------------
def nested_adds(sbox):
"schedule: add some nested files and directories"
+ sbox.build()
wc_dir = sbox.wc_dir
- if svntest.actions.make_repo_and_wc(sbox):
- return 1
-
# Create some directories then schedule them for addition
X_path = os.path.join(wc_dir, 'X')
Y_path = os.path.join(wc_dir, 'A', 'C', 'Y')
@@ -178,15 +172,15 @@
'A/D/H/Z/zeta' : Item(status='A ', wc_rev=0, repos_rev=1),
})
- return svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
#----------------------------------------------------------------------
def add_executable(sbox):
"schedule: add some executable files"
- if sbox.build():
- return 1
+ sbox.build()
+
def runTest(wc_dir, fileName, perm, executable):
fileName = os.path.join(wc_dir, fileName)
if executable:
@@ -215,11 +209,9 @@
def delete_files(sbox):
"schedule: delete some files"
+ sbox.build()
wc_dir = sbox.wc_dir
- if svntest.actions.make_repo_and_wc(sbox):
- return 1
-
# Schedule some files for deletion
iota_path = os.path.join(wc_dir, 'iota')
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -233,18 +225,16 @@
expected_status.tweak('iota', 'A/mu', 'A/D/G/rho', 'A/D/H/omega',
status='D ')
- return svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
#----------------------------------------------------------------------
def delete_dirs(sbox):
"schedule: delete some directories"
+ sbox.build()
wc_dir = sbox.wc_dir
- if svntest.actions.make_repo_and_wc(sbox):
- return 1
-
# Schedule some directories for deletion (this is recursive!)
E_path = os.path.join(wc_dir, 'A', 'B', 'E')
F_path = os.path.join(wc_dir, 'A', 'B', 'F')
@@ -265,7 +255,7 @@
'A/D/H', 'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi',
status='D ')
- return svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
#######################################################################
@@ -275,11 +265,9 @@
def revert_add_files(sbox):
"revert: add some files"
+ add_files(sbox)
wc_dir = sbox.wc_dir
- if add_files(sbox):
- return 1
-
# Revert our changes recursively from wc_dir.
delta_path = os.path.join(wc_dir, 'delta')
zeta_path = os.path.join(wc_dir, 'A', 'B', 'zeta')
@@ -292,27 +280,23 @@
# Make sure we got the right output.
if len(errput) > 0:
print errput
- return 1
+ raise svntest.Failure
### do we really need to sort these?
- output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
+ output = _tweak_paths(output) # FIXME: see comment at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
- return 1
+ raise svntest.Failure
- return 0
-
#----------------------------------------------------------------------
def revert_add_directories(sbox):
"revert: add some directories"
+ add_directories(sbox)
wc_dir = sbox.wc_dir
- if add_directories(sbox):
- return 1
-
# Revert our changes recursively from wc_dir.
X_path = os.path.join(wc_dir, 'X')
Y_path = os.path.join(wc_dir, 'A', 'C', 'Y')
@@ -325,27 +309,23 @@
# Make sure we got the right output.
if len(errput) > 0:
print errput
- return 1
+ raise svntest.Failure
### do we really need to sort these?
output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
- return 1
+ raise svntest.Failure
- return 0
-
#----------------------------------------------------------------------
def revert_nested_adds(sbox):
"revert: add some nested files and directories"
+ nested_adds(sbox)
wc_dir = sbox.wc_dir
- if nested_adds(sbox):
- return 1
-
# Revert our changes recursively from wc_dir.
X_path = os.path.join(wc_dir, 'X')
Y_path = os.path.join(wc_dir, 'A', 'C', 'Y')
@@ -358,26 +338,23 @@
# Make sure we got the right output.
if len(errput) > 0:
print errput
- return 1
+ raise svntest.Failure
### do we really need to sort these?
output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
- return 1
+ raise svntest.Failure
- return 0
-
#----------------------------------------------------------------------
def revert_add_executable(sbox):
"revert: add some executable files"
- if add_executable(sbox):
- return 1
-
+ add_executable(sbox)
wc_dir = sbox.wc_dir
+
all_path = os.path.join(wc_dir, 'all_exe')
none_path = os.path.join(wc_dir, 'none_exe')
user_path = os.path.join(wc_dir, 'user_exe')
@@ -396,27 +373,23 @@
# Make sure we got the right output.
if len(errput) > 0:
print errput
- return 1
+ raise svntest.Failure
### do we really need to sort these?
output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
- return 1
+ raise svntest.Failure
- return 0
-
#----------------------------------------------------------------------
def revert_delete_files(sbox):
"revert: delete some files"
+ delete_files(sbox)
wc_dir = sbox.wc_dir
- if delete_files(sbox):
- return 1
-
# Revert our changes recursively from wc_dir.
iota_path = os.path.join(wc_dir, 'iota')
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -431,27 +404,23 @@
# Make sure we got the right output.
if len(errput) > 0:
print errput
- return 1
+ raise svntest.Failure
### do we really need to sort these?
output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
- return 1
+ raise svntest.Failure
- return 0
-
#----------------------------------------------------------------------
def revert_delete_dirs(sbox):
"revert: delete some directories"
+ delete_dirs(sbox)
wc_dir = sbox.wc_dir
- if delete_dirs(sbox):
- return 1
-
# Revert our changes recursively from wc_dir.
E_path = os.path.join(wc_dir, 'A', 'B', 'E')
F_path = os.path.join(wc_dir, 'A', 'B', 'F')
@@ -474,18 +443,15 @@
# Make sure we got the right output.
if len(errput) > 0:
print errput
- return 1
+ raise svntest.Failure
### do we really need to sort these?
- output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
+ output = _tweak_paths(output) # FIXME: see comment at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
- return 1
+ raise svntest.Failure
- return 0
-
-
#######################################################################
# Stage III - Commit of modifications made in Stage 1
#
@@ -493,66 +459,55 @@
def commit_add_files(sbox):
"commit: add some files"
- if add_files(sbox):
- return 1
+ add_files(sbox)
- return 1
- return 0
+ raise svntest.Failure
#----------------------------------------------------------------------
def commit_add_directories(sbox):
"commit: add some directories"
- if add_directories(sbox):
- return 1
+ add_directories(sbox)
- return 1
- return 0
+ raise svntest.Failure
#----------------------------------------------------------------------
def commit_nested_adds(sbox):
"commit: add some nested files and directories"
- if nested_adds(sbox):
- return 1
+ nested_adds(sbox)
- return 1
- return 0
+ raise svntest.Failure
#----------------------------------------------------------------------
def commit_add_executable(sbox):
"commit: add some executable files"
- if add_executable(sbox):
- return 1
+ add_executable(sbox)
- return 1
- return 0
+ raise svntest.Failure
+
#----------------------------------------------------------------------
def commit_delete_files(sbox):
"commit: delete some files"
- if delete_files(sbox):
- return 1
+ delete_files(sbox)
- return 1
- return 0
+ raise svntest.Failure
#----------------------------------------------------------------------
def commit_delete_dirs(sbox):
"commit: delete some directories"
- if delete_dirs(sbox):
- return 1
+ delete_dirs(sbox)
- return 1
- return 0
+ raise svntest.Failure
#----------------------------------------------------------------------
# Regression test for issue #863:
@@ -566,11 +521,9 @@
def unschedule_missing_added(sbox):
"unschedule addition on missing items"
+ sbox.build()
wc_dir = sbox.wc_dir
- if svntest.actions.make_repo_and_wc(sbox):
- return 1
-
# Create some files and dirs, then schedule them for addition
file1_path = os.path.join(wc_dir, 'file1')
file2_path = os.path.join(wc_dir, 'file2')
@@ -591,8 +544,7 @@
'dir2' : Item(status='A ', wc_rev=0, repos_rev=1),
})
- if svntest.actions.run_and_verify_status(wc_dir, expected_status):
- return 1
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Poof, all 4 added things are now missing in action.
os.remove(file1_path)
@@ -606,11 +558,8 @@
# 'svn st' should now show absolutely zero local mods.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- if svntest.actions.run_and_verify_status(wc_dir, expected_status):
- return 1
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
- return 0
-
#----------------------------------------------------------------------
# Regression test for issue #962:
#
@@ -620,11 +569,9 @@
def delete_missing(sbox):
"schedule and commit deletion on missing items"
+ sbox.build
wc_dir = sbox.wc_dir
- if svntest.actions.make_repo_and_wc(sbox):
- return 1
-
mu_path = os.path.join(wc_dir, 'A', 'mu')
H_path = os.path.join(wc_dir, 'A', 'D', 'H')
@@ -635,7 +582,7 @@
# Now schedule them for deletion anyway, and make sure no error is output.
stdout, stderr = svntest.main.run_svn(None, 'rm', mu_path, H_path)
if len(stderr) != 0:
- return 1
+ raise svntest.Failure
# Commit the deletions.
expected_output = svntest.wc.State(wc_dir, {
@@ -648,11 +595,11 @@
'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi')
expected_status.tweak(wc_rev=1)
- return svntest.actions.run_and_verify_commit (wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_dir)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_dir)
########################################################################
# Run the tests
Index: subversion/tests/clients/cmdline/merge_tests.py
===================================================================
--- subversion/tests/clients/cmdline/merge_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/merge_tests.py (working copy)
@@ -98,7 +98,6 @@
## we're only interested in rho here.)
sbox.build()
-
wc_dir = sbox.wc_dir
# url = os.path.join(svntest.main.test_area_url, sbox.repo_dir)
@@ -368,7 +367,6 @@
"merge and add new files/dirs with history"
sbox.build()
-
wc_dir = sbox.wc_dir
C_path = os.path.join(wc_dir, 'A', 'C')
@@ -498,7 +496,6 @@
"merge that deletes items"
sbox.build()
-
wc_dir = sbox.wc_dir
# Rev 2 copy B to B2
@@ -608,7 +605,6 @@
"some simple property merges"
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a property to a file and a directory
@@ -617,7 +613,7 @@
outlines, errlines = svntest.main.run_svn(None, 'propset', 'foo', 'foo_val',
alpha_path)
if errlines:
- return 1
+ raise svntest.Failure
outlines, errlines = svntest.main.run_svn(None, 'propset', 'foo', 'foo_val',
E_path)
if errlines:
@@ -794,7 +790,6 @@
"merge should not die if a target file is absent"
sbox.build()
-
wc_dir = sbox.wc_dir
# Copy G to a new directory, Q. Create Q/newfile. Commit a change
@@ -839,7 +834,6 @@
"merge on deleted directory in target"
sbox.build()
-
wc_dir = sbox.wc_dir
# Copy B to a new directory, I. Modify B/E/alpha, Remove I/E. Now
@@ -884,7 +878,6 @@
## See http://subversion.tigris.org/issues/show_bug.cgi?id=1249. ##
sbox.build()
-
wc_dir = sbox.wc_dir
# Simple test. Make three directories with the same content.
@@ -941,8 +934,8 @@
"merge one file (issue #1150)"
sbox.build()
-
wc_dir = sbox.wc_dir
+
rho_rel_path = os.path.join('A', 'D', 'G', 'rho')
rho_path = os.path.join(wc_dir, rho_rel_path)
G_path = os.path.join(wc_dir, 'A', 'D', 'G')
@@ -1012,7 +1005,6 @@
"merging a file with no explicit target path"
sbox.build()
-
wc_dir = sbox.wc_dir
# Change mu for revision 2
@@ -1083,7 +1075,6 @@
"merge operations using PREV revision"
sbox.build()
-
wc_dir = sbox.wc_dir
# Change mu for revision 2
@@ -1175,7 +1166,6 @@
"merge change into unchanged binary file"
sbox.build()
-
wc_dir = sbox.wc_dir
# Add a binary file to the project
@@ -1255,6 +1245,7 @@
sbox.build()
wc_dir = sbox.wc_dir
+
trunk_url = svntest.main.current_repo_url + '/A/B/E';
# Create a branch
@@ -1293,7 +1284,6 @@
"merge should skip over unversioned obstructions"
sbox.build()
-
wc_dir = sbox.wc_dir
C_path = os.path.join(wc_dir, 'A', 'C')
Index: subversion/tests/clients/cmdline/externals_tests.py
===================================================================
--- subversion/tests/clients/cmdline/externals_tests.py (revision 6841)
+++ subversion/tests/clients/cmdline/externals_tests.py (working copy)
@@ -67,8 +67,7 @@
remove a previous incarnation of the other repository.
"""
- if sbox.build():
- return 1
+ sbox.build()
svntest.main.safe_rmtree(sbox.wc_dir) # The test itself will recreate this
@@ -94,7 +93,7 @@
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, wc_init_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
# Make revisions 2 through 5, but don't bother with pre- and
# post-commit status checks.
@@ -102,26 +101,26 @@
svntest.main.file_append(mu_path, "\nAdded to mu in revision 2.\n")
out_lines, err_lines = svntest.main.run_svn \
(None, 'ci', '-m', 'log msg', '--quiet', wc_init_dir)
- if (err_lines): return 1
+ if (err_lines): raise svntest.Failure
svntest.main.file_append(pi_path, "\nAdded to pi in revision 3.\n")
out_lines, err_lines = svntest.main.run_svn \
(None, 'ci', '-m', 'log msg', '--quiet', wc_init_dir)
- if (err_lines): return 1
+ if (err_lines): raise svntest.Failure
svntest.main.file_append(lambda_path, "\nAdded to lambda in revision 4.\n")
out_lines, err_lines = svntest.main.run_svn \
(None, 'ci', '-m', 'log msg', '--quiet', wc_init_dir)
- if (err_lines): return 1
+ if (err_lines): raise svntest.Failure
svntest.main.file_append(omega_path, "\nAdded to omega in revision 5.\n")
out_lines, err_lines = svntest.main.run_svn \
(None, 'ci', '-m', 'log msg', '--quiet', wc_init_dir)
- if (err_lines): return 1
+ if (err_lines): raise svntest.Failure
# Get the whole working copy to revision 5.
out_lines, err_lines = svntest.main.run_svn(None, 'up', wc_init_dir)
- if (err_lines): return 1
+ if (err_lines): raise svntest.Failure
# Now copy the initial repository to create the "other" repository,
# the one to which the first repository's `svn:externals' properties
@@ -138,7 +137,7 @@
svntest.main.file_append(tmp_f, externals_desc)
out_lines, err_lines = svntest.main.run_svn \
(None, 'pset', '-F', tmp_f, 'svn:externals', B_path)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
os.remove(tmp_f)
@@ -155,7 +154,7 @@
svntest.main.file_append(tmp_f, externals_desc)
out_lines, err_lines = svntest.main.run_svn \
(None, 'pset', '-F', tmp_f, 'svn:externals', D_path)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
os.remove(tmp_f)
@@ -170,11 +169,11 @@
expected_status.tweak(repos_rev=6)
expected_status.tweak('A/B', 'A/D', wc_rev=6, status=' ')
- return svntest.actions.run_and_verify_commit(wc_init_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- wc_init_dir)
+ svntest.actions.run_and_verify_commit(wc_init_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ wc_init_dir)
def change_external(path, new_val):
@@ -186,7 +185,7 @@
(None, 'pset', '-F', tmp_f, 'svn:externals', path)
out_lines, err_lines = svntest.main.run_svn \
(None, 'ci', '-m', 'log msg', '--quiet', path)
- if (err_lines): return 1
+ if (err_lines): raise svntest.Failure
os.remove(tmp_f)
@@ -207,8 +206,7 @@
def checkout_with_externals(sbox):
"test checkouts with externals"
- if externals_test_setup(sbox):
- return 1
+ externals_test_setup(sbox)
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
@@ -220,7 +218,7 @@
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
# Probe the working copy a bit, see if it's as expected.
exdir_G_path = os.path.join(wc_dir, "A/B/exdir_G")
@@ -235,54 +233,41 @@
beta_path = os.path.join(blah_path, "beta")
if (not os.path.exists(exdir_G_path)):
- print "Probing for", exdir_G_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " exdir_G_path " failed.")
if (not os.path.exists(exdir_G_pi_path)):
- print "Probing for", exdir_G_pi_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " exdir_G_pi_path " failed.")
if (not os.path.exists(exdir_H_path)):
- print "Probing for", exdir_H_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " exdir_H_path " failed.")
if (not os.path.exists(exdir_H_omega_path)):
- print "Probing for", exdir_H_omega_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " exdir_H_omega_path " failed.")
if (not os.path.exists(x_path)):
- print "Probing for", x_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " x_path " failed.")
if (not os.path.exists(y_path)):
- print "Probing for", y_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " y_path " failed.")
if (not os.path.exists(z_path)):
- print "Probing for", z_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " z_path " failed.")
if (not os.path.exists(z_path)):
- print "Probing for", z_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " z_path " failed.")
if (not os.path.exists(alpha_path)):
- print "Probing for", alpha_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " alpha_path " failed.")
if (not os.path.exists(beta_path)):
- print "Probing for", beta_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " beta_path " failed.")
# Pick a file at random, make sure it has the expected contents.
fp = open(exdir_H_omega_path, 'r')
lines = fp.readlines()
if not ((len(lines) == 1) and (lines[0] == "This is the file 'omega'.")):
- print "Unexpected contents for rev 1 of", exdir_H_omega_path
- return 1
+ raise svntest.Failure("Unexpected contents for rev 1 of "
+ exdir_H_omega_path)
- return 0
-
#----------------------------------------------------------------------
def update_receive_new_external(sbox):
"update to receive a new external module"
- if externals_test_setup(sbox):
- return 1
-
+ externals_test_setup(sbox)
wc_dir = sbox.wc_dir
+
other_wc_dir = sbox.add_wc_path('other')
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
@@ -294,14 +279,14 @@
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
out_lines, err_lines = svntest.main.run_svn \
(None, 'checkout',
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
# Add one new external item to the property on A/D. The new item is
# "exdir_E", deliberately added in the middle not at the end.
@@ -322,25 +307,20 @@
# Update the other working copy, see if we get the new item.
out_lines, err_lines = svntest.main.run_svn (None, 'up', other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
exdir_E_path = os.path.join(other_wc_dir, "A", "D", "exdir_E")
if (not os.path.exists(exdir_E_path)):
- print "Probing for", exdir_E_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " exdir_E_path " failed.")
- return 0
-
-
#----------------------------------------------------------------------
def update_lose_external(sbox):
"update to lose an external module"
- if externals_test_setup(sbox):
- return 1
-
+ externals_test_setup(sbox)
wc_dir = sbox.wc_dir
+
other_wc_dir = sbox.add_wc_path('other')
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
@@ -352,14 +332,14 @@
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
out_lines, err_lines = svntest.main.run_svn \
(None, 'checkout',
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
# Lose one new external item from A/D. The lost item is
# "exdir_A", chosen because there are two other externals underneath
@@ -390,56 +370,44 @@
# Update other working copy, see if lose & preserve things appropriately
out_lines, err_lines = svntest.main.run_svn (None, 'up', other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
exdir_A_path = os.path.join(other_wc_dir, "A", "D", "exdir_A")
if (not os.path.exists(exdir_A_path)):
- print "Probing for", exdir_A_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " exdir_A_path " failed.")
mu_path = os.path.join(other_wc_dir, "A", "D", "exdir_A", "mu")
if (os.path.exists(mu_path)):
- print mu_path, "unexpectedly still exists."
- return 1
+ raise svntest.Failure(mu_path " unexpectedly still exists.")
B_path = os.path.join(other_wc_dir, "A", "D", "exdir_A", "B")
if (os.path.exists(B_path)):
- print B_path, "unexpectedly still exists."
- return 1
+ raise svntest.Failure(B_path " unexpectedly still exists.")
C_path = os.path.join(other_wc_dir, "A", "D", "exdir_A", "C")
if (os.path.exists(C_path)):
- print C_path, "unexpectedly still exists."
- return 1
+ raise svntest.Failure(C_path " unexpectedly still exists.")
D_path = os.path.join(other_wc_dir, "A", "D", "exdir_A", "D")
if (os.path.exists(D_path)):
- print D_path, "unexpectedly still exists."
- return 1
+ raise svntest.Failure(D_path " unexpectedly still exists.")
G_path = os.path.join(other_wc_dir, "A", "D", "exdir_A", "G")
if (not os.path.exists(G_path)):
- print "Probing for", G_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " G_path " failed.")
H_path = os.path.join(other_wc_dir, "A", "D", "exdir_A", "H")
if (not os.path.exists(H_path)):
- print "Probing for", H_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " H_path " failed.")
- return 0
-
-
-
#----------------------------------------------------------------------
def update_change_pristine_external(sbox):
"update change to an unmodified external module"
- if externals_test_setup(sbox):
- return 1
-
+ externals_test_setup(sbox)
wc_dir = sbox.wc_dir
+
other_wc_dir = sbox.add_wc_path('other')
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
@@ -451,14 +419,14 @@
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
out_lines, err_lines = svntest.main.run_svn \
(None, 'checkout',
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
# Change the "x/y/z/blah" external on A/D to point to a different
# URL. Since no changes were made to the old checked-out external,
@@ -478,30 +446,24 @@
# Update other working copy, see if get the right change.
out_lines, err_lines = svntest.main.run_svn (None, 'up', other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
xyzb_path = os.path.join(other_wc_dir, "x", "y", "z", "blah")
alpha_path = os.path.join(xyzb_path, "alpha")
if (os.path.exists(alpha_path)):
- print alpha_path, "unexpectedly still exists."
- return 1
+ raise svntest.Failure(alpha_path " unexpectedly still exists.")
beta_path = os.path.join(xyzb_path, "beta")
if (os.path.exists(beta_path)):
- print beta_path, "unexpectedly still exists."
- return 1
+ raise svntest.Failure(beta_path " unexpectedly still exists.")
- return 0
-
-
def update_change_modified_external(sbox):
"update changes to a modified external module"
- if externals_test_setup(sbox):
- return 1
-
+ externals_test_setup(sbox)
wc_dir = sbox.wc_dir
+
other_wc_dir = sbox.add_wc_path('other')
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
@@ -513,14 +475,14 @@
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
out_lines, err_lines = svntest.main.run_svn \
(None, 'checkout',
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
# Make a couple of mods in the "x/y/z/blah/" external.
alpha_path = os.path.join(other_wc_dir, "A", "D",
@@ -548,30 +510,24 @@
# Update other working copy, see if get the right change.
out_lines, err_lines = svntest.main.run_svn (None, 'up', other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
xyzb_path = os.path.join(other_wc_dir, "x", "y", "z", "blah")
alpha_path = os.path.join(xyzb_path, "alpha")
if (os.path.exists(alpha_path)):
- print alpha_path, "unexpectedly still exists."
- return 1
+ raise svntest.Failure(alpha_path " unexpectedly still exists.")
beta_path = os.path.join(xyzb_path, "beta")
if (os.path.exists(beta_path)):
- print beta_path, "unexpectedly still exists."
- return 1
+ raise svntest.Failure(beta_path " unexpectedly still exists.")
- return 0
-
-
def update_receive_change_under_external(sbox):
"update changes under an external module"
- if externals_test_setup(sbox):
- return 1
-
+ externals_test_setup(sbox)
wc_dir = sbox.wc_dir
+
other_wc_dir = sbox.add_wc_path('other')
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
@@ -583,14 +539,14 @@
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
repo_url, wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
out_lines, err_lines = svntest.main.run_svn \
(None, 'checkout',
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
other_repo_url, other_wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
# Commit some modifications from the other_wc.
other_gamma_path = os.path.join(other_wc_dir, 'A', 'D', 'gamma')
@@ -602,14 +558,12 @@
expected_status = svntest.actions.get_virginal_state(other_wc_dir, 5)
expected_status.tweak(repos_rev=6)
expected_status.tweak('A/D/gamma', wc_rev=6)
- if svntest.actions.run_and_verify_commit(other_wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- other_wc_dir):
- print "commit from other working copy failed"
- return 1
-
+ svntest.actions.run_and_verify_commit(other_wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ other_wc_dir)
+
# Now update the regular wc to see if we get the change. Note that
# none of the module *properties* in this wc have been changed; only
# the source repository of the modules has received a change, and
@@ -619,7 +573,7 @@
# notifications, so don't bother parsing it, just run update
# directly.
out_lines, err_lines = svntest.main.run_svn (None, 'up', wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
external_gamma_path = os.path.join(wc_dir, 'A', 'D', 'exdir_A', 'D', 'gamma')
fp = open(external_gamma_path, 'r')
@@ -627,8 +581,8 @@
if not ((len(lines) == 2)
and (lines[0] == "This is the file 'gamma'.\n")
and (lines[1] == "New text in other gamma.")):
- print "Unexpected contents for externally modified ", external_gamma_path
- return 1
+ raise svntest.Failure("Unexpected contents for externally modified "
+ external_gamma_path)
fp.close()
# Commit more modifications
@@ -642,17 +596,15 @@
expected_status.tweak(repos_rev=7)
expected_status.tweak('A/D/gamma', wc_rev=6)
expected_status.tweak('A/D/G/rho', wc_rev=7)
- if svntest.actions.run_and_verify_commit(other_wc_dir,
- expected_output,
- expected_status,
- None, None, None, None, None,
- other_wc_dir):
- print "Commit from other working copy failed"
- return 1
+ svntest.actions.run_and_verify_commit(other_wc_dir,
+ expected_output,
+ expected_status,
+ None, None, None, None, None,
+ other_wc_dir)
out_lines, err_lines = svntest.main.run_svn (None, 'up',
os.path.join(wc_dir, "A", "B"))
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
external_rho_path = os.path.join(wc_dir, 'A', 'B', 'exdir_G', 'rho')
fp = open(external_rho_path, 'r')
@@ -660,21 +612,18 @@
if not ((len(lines) == 2)
and (lines[0] == "This is the file 'rho'.\n")
and (lines[1] == "New text in other rho.")):
- print "Unexpected contents for externally modified ", external_rho_path
- return 1
+ raise svntest.Failure("Unexpected contents for externally modified "
+ external_rho_path)
fp.close()
- return 0
-
#----------------------------------------------------------------------
def modify_and_update_receive_new_external(sbox):
"commit and update additional externals"
- if externals_test_setup(sbox):
- return 1
-
+ externals_test_setup(sbox)
wc_dir = sbox.wc_dir
+
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
other_repo_url = repo_url + ".other"
@@ -686,7 +635,7 @@
'--password',
svntest.main.wc_passwd,
repo_url, wc_dir)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
# Add one more external item
B_path = os.path.join(wc_dir, "A/B")
@@ -699,7 +648,7 @@
svntest.main.file_append(tmp_f, externals_desc)
out_lines, err_lines = svntest.main.run_svn(None, 'pset', '-F', tmp_f,
'svn:externals', B_path)
- if err_lines: return 1
+ if err_lines: raise svntest.Failure
os.remove(tmp_f)
# Now cd into A/B and try updating
@@ -709,25 +658,22 @@
# Once upon a time there was a core-dump here
out_lines, err_lines = svntest.main.run_svn (None, 'up')
if err_lines or not out_lines:
- print "update failed"
- return 1
+ raise svntest.Failure("update failed")
finally:
os.chdir(was_cwd)
exdir_Z_path = os.path.join(B_path, "exdir_Z")
if not os.path.exists(exdir_Z_path):
- print "Probing for", exdir_Z_path, "failed."
- return 1
+ raise svntest.Failure("Probing for " exdir_Z_path " failed.")
#----------------------------------------------------------------------
def disallow_parent_directory_reference(sbox):
"error if external target dir refers to '..'"
- if sbox.build():
- return 1
-
+ sbox.build()
wc_dir = sbox.wc_dir
+
wc_other = sbox.wc_dir + '.other'
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
@@ -741,7 +687,7 @@
svntest.main.wc_passwd,
repo_url, wc_other)
if err_lines:
- return 1
+ raise svntest.Failure
# Set up some illegal externals in the original WC.
def set_externals_for_path(path, val, dir):
@@ -750,7 +696,7 @@
out_lines, err_lines = svntest.main.run_svn \
(None, 'pset', '-F', tmp_f, 'svn:externals', path)
if err_lines:
- return 1
+ raise svntest.Failure
os.remove(tmp_f)
B_path = os.path.join(wc_dir, 'A', 'B')
@@ -767,7 +713,7 @@
out_lines, err_lines = svntest.main.run_svn \
(None, 'ci', '-m', 'log msg', '--quiet', wc_dir)
if (err_lines):
- return 1
+ raise svntest.Failure
# Update the corresponding parts of the other working copy,
# expecting errors.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Aug 24 11:04:56 2003