You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by vm...@apache.org on 2012/05/29 03:39:49 UTC
svn commit: r1343447 [26/27] - in /subversion/branches/javahl-ra: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/ build/win32/
contrib/client-side/emacs/ contrib/server-side/ notes/
notes/api-errata/1.8/ notes/merge-tracking/ sub...
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py Tue May 29 01:39:41 2012
@@ -109,7 +109,7 @@ def update_binary_file(sbox):
# Add a binary file to the project.
theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
# Write PNG file data into 'A/theta'.
- theta_path = os.path.join(wc_dir, 'A', 'theta')
+ theta_path = sbox.ospath('A/theta')
svntest.main.file_write(theta_path, theta_contents, 'wb')
svntest.main.run_svn(None, 'add', theta_path)
@@ -226,9 +226,9 @@ def update_binary_file_2(sbox):
zeta_contents = zeta_contents + zeta_contents
# Write our two files' contents out to disk, in A/theta and A/zeta.
- theta_path = os.path.join(wc_dir, 'A', 'theta')
+ theta_path = sbox.ospath('A/theta')
svntest.main.file_write(theta_path, theta_contents, 'wb')
- zeta_path = os.path.join(wc_dir, 'A', 'zeta')
+ zeta_path = sbox.ospath('A/zeta')
svntest.main.file_write(zeta_path, zeta_contents, 'wb')
# Now, `svn add' those two files.
@@ -322,7 +322,7 @@ def update_binary_file_3(sbox):
theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
# Write our files contents out to disk, in A/theta.
- theta_path = os.path.join(wc_dir, 'A', 'theta')
+ theta_path = sbox.ospath('A/theta')
svntest.main.file_write(theta_path, theta_contents, 'wb')
# Now, `svn add' that file.
@@ -403,10 +403,10 @@ def update_missing(sbox):
wc_dir = sbox.wc_dir
# Remove some files and dirs from the working copy.
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
- E_path = os.path.join(wc_dir, 'A', 'B', 'E')
- H_path = os.path.join(wc_dir, 'A', 'D', 'H')
+ mu_path = sbox.ospath('A/mu')
+ rho_path = sbox.ospath('A/D/G/rho')
+ E_path = sbox.ospath('A/B/E')
+ H_path = sbox.ospath('A/D/H')
# remove two files to verify that they get restored
os.remove(mu_path)
@@ -460,18 +460,18 @@ def update_ignores_added(sbox):
wc_dir = sbox.wc_dir
# Commit something so there's actually a new revision to update to.
- rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
+ rho_path = sbox.ospath('A/D/G/rho')
svntest.main.file_append(rho_path, "More stuff in rho.\n")
svntest.main.run_svn(None,
'ci', '-m', 'log msg', rho_path)
# Create a new file, 'zeta', and schedule it for addition.
- zeta_path = os.path.join(wc_dir, 'A', 'B', 'zeta')
+ zeta_path = sbox.ospath('A/B/zeta')
svntest.main.file_append(zeta_path, "This is the file 'zeta'.\n")
svntest.main.run_svn(None, 'add', zeta_path)
# Schedule another file, say, 'gamma', for replacement.
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
+ gamma_path = sbox.ospath('A/D/gamma')
svntest.main.run_svn(None, 'delete', gamma_path)
svntest.main.file_append(gamma_path, "This is a new 'gamma' now.\n")
svntest.main.run_svn(None, 'add', gamma_path)
@@ -519,8 +519,8 @@ def update_to_rev_zero(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = os.path.join(wc_dir, 'iota')
- A_path = os.path.join(wc_dir, 'A')
+ iota_path = sbox.ospath('iota')
+ A_path = sbox.ospath('A')
# Create expected output tree for an update to rev 0
expected_output = svntest.wc.State(wc_dir, {
@@ -566,7 +566,7 @@ def receive_overlapping_same_change(sbox
wc_dir = sbox.wc_dir
# Modify iota.
- iota_path = os.path.join(wc_dir, 'iota')
+ iota_path = sbox.ospath('iota')
svntest.main.file_append(iota_path, "A change to iota.\n")
# Duplicate locally modified wc, giving us the "other" wc.
@@ -619,8 +619,8 @@ def update_to_resolve_text_conflicts(sbo
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Make a couple of local mods to files which will be committed
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
+ mu_path = sbox.ospath('A/mu')
+ rho_path = sbox.ospath('A/D/G/rho')
svntest.main.file_append(mu_path, 'Original appended text for mu\n')
svntest.main.file_append(rho_path, 'Original appended text for rho\n')
svntest.main.run_svn(None, 'propset', 'Kubla', 'Khan', rho_path)
@@ -729,12 +729,12 @@ def update_delete_modified_files(sbox):
wc_dir = sbox.wc_dir
# Delete a file
- alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
+ alpha_path = sbox.ospath('A/B/E/alpha')
svntest.actions.run_and_verify_svn("Deleting alpha failed", None, [],
'rm', alpha_path)
# Delete a directory containing files
- G_path = os.path.join(wc_dir, 'A', 'D', 'G')
+ G_path = sbox.ospath('A/D/G')
svntest.actions.run_and_verify_svn("Deleting G failed", None, [],
'rm', G_path)
@@ -809,8 +809,8 @@ def update_after_add_rm_deleted(sbox):
wc_dir = sbox.wc_dir
# Delete a file and directory from WC
- alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
- F_path = os.path.join(wc_dir, 'A', 'B', 'F')
+ alpha_path = sbox.ospath('A/B/E/alpha')
+ F_path = sbox.ospath('A/B/F')
svntest.actions.run_and_verify_svn(None, None, [], 'rm', alpha_path, F_path)
# Commit deletion
@@ -886,7 +886,7 @@ def obstructed_update_alters_wc_props(sb
# Create an obstruction, a file in the WC with the same name as
# present in a newer rev of the repo.
#print "Creating obstruction"
- obstruction_parent_path = os.path.join(wc_dir, 'A')
+ obstruction_parent_path = sbox.ospath('A')
obstruction_path = os.path.join(obstruction_parent_path, 'foo')
svntest.main.file_append(obstruction_path, 'an obstruction')
@@ -952,7 +952,7 @@ def update_replace_dir(sbox):
wc_dir = sbox.wc_dir
# Delete a directory
- F_path = os.path.join(wc_dir, 'A', 'B', 'F')
+ F_path = sbox.ospath('A/B/F')
svntest.actions.run_and_verify_svn(None, None, [], 'rm', F_path)
# Commit deletion
@@ -1025,7 +1025,7 @@ def update_single_file(sbox):
expected_disk = svntest.main.greek_state.copy()
# Make a local mod to a file which will be committed
- mu_path = os.path.join(wc_dir, 'A', 'mu')
+ mu_path = sbox.ospath('A/mu')
svntest.main.file_append(mu_path, '\nAppended text for mu')
# Commit.
@@ -1041,7 +1041,7 @@ def update_single_file(sbox):
# At one stage 'svn up file' failed with a parent lock error
was_cwd = os.getcwd()
- os.chdir(os.path.join(wc_dir, 'A'))
+ os.chdir(sbox.ospath('A'))
### Can't get run_and_verify_update to work having done the chdir.
svntest.actions.run_and_verify_svn("update failed", None, [],
@@ -1064,7 +1064,7 @@ def prop_update_on_scheduled_delete(sbox
# Make the "other" working copy.
svntest.actions.duplicate_dir(wc_dir, other_wc)
- iota_path = os.path.join(wc_dir, 'iota')
+ iota_path = sbox.ospath('iota')
other_iota_path = os.path.join(other_wc, 'iota')
svntest.main.run_svn(None, 'propset', 'foo', 'bar', iota_path)
@@ -1149,8 +1149,8 @@ def update_deleted_missing_dir(sbox):
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')
+ E_path = sbox.ospath('A/B/E')
+ H_path = sbox.ospath('A/D/H')
# Create a new revision with directories deleted
svntest.main.run_svn(None, 'rm', E_path)
@@ -1233,7 +1233,7 @@ def another_hudson_problem(sbox):
wc_dir = sbox.wc_dir
# Delete/commit gamma thus making it 'deleted'
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
+ gamma_path = sbox.ospath('A/D/gamma')
svntest.main.run_svn(None, 'rm', gamma_path)
expected_output = svntest.wc.State(wc_dir, {
@@ -1255,7 +1255,7 @@ def another_hudson_problem(sbox):
sbox.repo_url + '/A/D/G')
# Remove corresponding tree from working copy
- G_path = os.path.join(wc_dir, 'A', 'D', 'G')
+ G_path = sbox.ospath('A/D/G')
svntest.main.safe_rmtree(G_path)
# Update missing directory to receive the delete, this should mark G
@@ -1305,8 +1305,8 @@ def update_deleted_targets(sbox):
wc_dir = sbox.wc_dir
# Delete/commit thus creating 'deleted=true' entries
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
- F_path = os.path.join(wc_dir, 'A', 'B', 'F')
+ gamma_path = sbox.ospath('A/D/gamma')
+ F_path = sbox.ospath('A/B/F')
svntest.main.run_svn(None, 'rm', gamma_path, F_path)
expected_output = svntest.wc.State(wc_dir, {
@@ -1392,8 +1392,8 @@ def non_recursive_update(sbox):
wc_dir = sbox.wc_dir
# Commit a change to A/mu and A/D/G/rho
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
+ mu_path = sbox.ospath('A/mu')
+ rho_path = sbox.ospath('A/D/G/rho')
svntest.main.file_append(mu_path, "new")
svntest.main.file_append(rho_path, "new")
@@ -1426,7 +1426,7 @@ def non_recursive_update(sbox):
'-r', '1', wc_dir)
# Non-recursive update of A should change A/mu but not A/D/G/rho
- A_path = os.path.join(wc_dir, 'A')
+ A_path = sbox.ospath('A')
expected_output = svntest.wc.State(wc_dir, {
'A/mu' : Item(status='U '),
@@ -1470,7 +1470,7 @@ def update_to_deletion(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = os.path.join(wc_dir, 'iota')
+ iota_path = sbox.ospath('iota')
# Update iota to rev 0, so it gets removed.
expected_output = svntest.wc.State(wc_dir, {
@@ -1510,7 +1510,7 @@ def update_deletion_inside_out(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- parent_path = os.path.join(wc_dir, 'A', 'B')
+ parent_path = sbox.ospath('A/B')
child_path = os.path.join(parent_path, 'E') # Could be a file, doesn't matter
# Delete the parent directory.
@@ -1553,7 +1553,7 @@ def update_schedule_add_dir(sbox):
wc_dir = sbox.wc_dir
# Delete directory A/D/G in the repository via immediate commit
- G_path = os.path.join(wc_dir, 'A', 'D', 'G')
+ G_path = sbox.ospath('A/D/G')
G_url = sbox.repo_url + '/A/D/G'
svntest.actions.run_and_verify_svn(None, None, [],
'rm', G_url, '-m', 'rev 2')
@@ -1576,7 +1576,7 @@ def update_schedule_add_dir(sbox):
# Do a URL->wc copy, creating a new schedule-add A/D/G.
# (Standard procedure when trying to resurrect the directory.)
- D_path = os.path.join(wc_dir, 'A', 'D')
+ D_path = sbox.ospath('A/D')
svntest.actions.run_and_verify_svn("Copy error:", None, [],
'cp', G_url + '@1', D_path)
@@ -1627,7 +1627,7 @@ def update_to_future_add(sbox):
'-r', '0', wc_dir)
# Update iota to the current HEAD.
- iota_path = os.path.join(wc_dir, 'iota')
+ iota_path = sbox.ospath('iota')
expected_output = svntest.wc.State(wc_dir, {
'iota' : Item(status='A '),
@@ -1645,7 +1645,7 @@ def update_to_future_add(sbox):
iota_path)
# Now try updating the directory into the future
- A_path = os.path.join(wc_dir, 'A')
+ A_path = sbox.ospath('A')
expected_output = svntest.wc.State(wc_dir, {
'A' : Item(status='A '),
@@ -1690,7 +1690,7 @@ def nested_in_read_only(sbox):
raise svntest.Skip('Unsupported in single-db')
# Delete/commit a file
- alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
+ alpha_path = sbox.ospath('A/B/E/alpha')
svntest.actions.run_and_verify_svn(None, None, [], 'rm', alpha_path)
expected_output = svntest.wc.State(wc_dir, {
@@ -1710,7 +1710,7 @@ def nested_in_read_only(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Delete/commit a directory that used to contain the deleted file
- B_path = os.path.join(wc_dir, 'A', 'B')
+ B_path = sbox.ospath('A/B')
svntest.actions.run_and_verify_svn(None, None, [], 'rm', B_path)
expected_output = svntest.wc.State(wc_dir, {
@@ -1789,7 +1789,7 @@ def update_xml_unsafe_dir(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Make a couple of local mods to files
- test_path = os.path.join(wc_dir, ' foo & bar')
+ test_path = sbox.ospath(' foo & bar')
svntest.main.run_svn(None, 'mkdir', test_path)
# Created expected output tree for 'svn ci'
@@ -1838,7 +1838,7 @@ def conflict_markers_matching_eol(sbox):
wc_dir = sbox.wc_dir
filecount = 1
- mu_path = os.path.join(wc_dir, 'A', 'mu')
+ mu_path = sbox.ospath('A/mu')
if os.name == 'nt':
crlf = '\n'
@@ -1969,7 +1969,7 @@ def update_eolstyle_handling(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- mu_path = os.path.join(wc_dir, 'A', 'mu')
+ mu_path = sbox.ospath('A/mu')
if os.name == 'nt':
crlf = '\n'
@@ -2067,8 +2067,8 @@ def update_copy_of_old_rev(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- dir = os.path.join(wc_dir, 'A')
- dir2 = os.path.join(wc_dir, 'A2')
+ dir = sbox.ospath('A')
+ dir2 = sbox.ospath('A2')
file = os.path.join(dir, 'mu')
file2 = os.path.join(dir2, 'mu')
url = sbox.repo_url + '/A/mu'
@@ -2115,21 +2115,21 @@ def forced_update(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Make a couple of local mods to files
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
+ mu_path = sbox.ospath('A/mu')
+ rho_path = sbox.ospath('A/D/G/rho')
svntest.main.file_append(mu_path, 'appended mu text')
svntest.main.file_append(rho_path, 'new appended text for rho')
# Add some files
- nu_path = os.path.join(wc_dir, 'A', 'B', 'F', 'nu')
+ nu_path = sbox.ospath('A/B/F/nu')
svntest.main.file_append(nu_path, "This is the file 'nu'\n")
svntest.main.run_svn(None, 'add', nu_path)
- kappa_path = os.path.join(wc_dir, 'kappa')
+ kappa_path = sbox.ospath('kappa')
svntest.main.file_append(kappa_path, "This is the file 'kappa'\n")
svntest.main.run_svn(None, 'add', kappa_path)
# Add a dir with two files
- I_path = os.path.join(wc_dir, 'A', 'C', 'I')
+ I_path = sbox.ospath('A/C/I')
os.mkdir(I_path)
svntest.main.run_svn(None, 'add', I_path)
upsilon_path = os.path.join(I_path, 'upsilon')
@@ -2254,12 +2254,12 @@ def forced_update_failures(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Add a file
- nu_path = os.path.join(wc_dir, 'A', 'B', 'F', 'nu')
+ nu_path = sbox.ospath('A/B/F/nu')
svntest.main.file_append(nu_path, "This is the file 'nu'\n")
svntest.main.run_svn(None, 'add', nu_path)
# Add a dir
- I_path = os.path.join(wc_dir, 'A', 'C', 'I')
+ I_path = sbox.ospath('A/C/I')
os.mkdir(I_path)
svntest.main.run_svn(None, 'add', I_path)
@@ -2580,8 +2580,8 @@ def update_wc_with_replaced_file(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# we need a change in the repository
- iota_path = os.path.join(wc_dir, 'iota')
- mu_path = os.path.join(wc_dir, 'A', 'mu')
+ iota_path = sbox.ospath('iota')
+ mu_path = sbox.ospath('A/mu')
iota_bu_path = os.path.join(wc_backup, 'iota')
svntest.main.file_append(iota_bu_path, "New line in 'iota'\n")
svntest.main.run_svn(None,
@@ -2710,17 +2710,17 @@ def update_with_obstructing_additions(sb
#
# A/D/H/I/J/eta: Conflicts with the file scheduled for addition in
# the backup WC. No props.
- upsilon_path = os.path.join(wc_dir, 'A', 'B', 'upsilon')
+ upsilon_path = sbox.ospath('A/B/upsilon')
svntest.main.file_append(upsilon_path, "This is the file 'upsilon'\n")
- nu_path = os.path.join(wc_dir, 'A', 'C', 'nu')
+ nu_path = sbox.ospath('A/C/nu')
svntest.main.file_append(nu_path, "This is the file 'nu'\n")
- kappa_path = os.path.join(wc_dir, 'A', 'D', 'kappa')
+ kappa_path = sbox.ospath('A/D/kappa')
svntest.main.file_append(kappa_path, "This is REPOS file 'kappa'\n")
- epsilon_path = os.path.join(wc_dir, 'A', 'D', 'epsilon')
+ epsilon_path = sbox.ospath('A/D/epsilon')
svntest.main.file_append(epsilon_path, "This is REPOS file 'epsilon'\n")
- zeta_path = os.path.join(wc_dir, 'A', 'D', 'zeta')
+ zeta_path = sbox.ospath('A/D/zeta')
svntest.main.file_append(zeta_path, "This is the file 'zeta'\n")
- I_path = os.path.join(wc_dir, 'A', 'D', 'H', 'I')
+ I_path = sbox.ospath('A/D/H/I')
os.mkdir(I_path)
J_path = os.path.join(I_path, 'J')
os.mkdir(J_path)
@@ -2922,9 +2922,9 @@ def update_with_obstructing_additions(sb
# WC to WC copy of A/D/H to A/M, M now scheduled for addition with
# history in WC and pending addition from the repos.
- H_path = os.path.join(wc_dir, 'A', 'D', 'H')
- A_path = os.path.join(wc_dir, 'A')
- M_path = os.path.join(wc_dir, 'A', 'M')
+ H_path = sbox.ospath('A/D/H')
+ A_path = sbox.ospath('A')
+ M_path = sbox.ospath('A/M')
svntest.actions.run_and_verify_svn("Copy error:", None, [],
'cp', H_path, M_path)
@@ -2938,8 +2938,8 @@ def update_with_obstructing_additions(sb
# WC to WC copy of A/D/H/chi to omicron, omicron now scheduled for
# addition with history in WC and pending addition from the repos.
- chi_path = os.path.join(wc_dir, 'A', 'D', 'H', 'chi')
- omicron_path = os.path.join(wc_dir, 'omicron')
+ chi_path = sbox.ospath('A/D/H/chi')
+ omicron_path = sbox.ospath('omicron')
svntest.actions.run_and_verify_svn("Copy error:", None, [],
'cp', chi_path,
@@ -3056,11 +3056,11 @@ def update_conflicted(sbox):
"update conflicted files"
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = os.path.join(wc_dir, 'iota')
- lambda_path = os.path.join(wc_dir, 'A', 'B', 'lambda')
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- D_path = os.path.join(wc_dir, 'A', 'D')
- pi_path = os.path.join(wc_dir, 'A', 'D', 'G', 'pi')
+ iota_path = sbox.ospath('iota')
+ lambda_path = sbox.ospath('A/B/lambda')
+ mu_path = sbox.ospath('A/mu')
+ D_path = sbox.ospath('A/D')
+ pi_path = sbox.ospath('A/D/G/pi')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -3224,20 +3224,20 @@ def mergeinfo_update_elision(sbox):
wc_dir = sbox.wc_dir
# Some paths we'll care about
- alpha_COPY_path = os.path.join(wc_dir, "A", "B_COPY", "E", "alpha")
- alpha_path = os.path.join(wc_dir, "A", "B", "E", "alpha")
- B_COPY_path = os.path.join(wc_dir, "A", "B_COPY")
- E_COPY_path = os.path.join(wc_dir, "A", "B_COPY", "E")
- beta_path = os.path.join(wc_dir, "A", "B", "E", "beta")
- lambda_path = os.path.join(wc_dir, "A", "B", "lambda")
+ alpha_COPY_path = sbox.ospath('A/B_COPY/E/alpha')
+ alpha_path = sbox.ospath('A/B/E/alpha')
+ B_COPY_path = sbox.ospath('A/B_COPY')
+ E_COPY_path = sbox.ospath('A/B_COPY/E')
+ beta_path = sbox.ospath('A/B/E/beta')
+ lambda_path = sbox.ospath('A/B/lambda')
# Make a branch A/B_COPY
expected_stdout = verify.UnorderedOutput([
- "A " + os.path.join(wc_dir, "A", "B_COPY", "lambda") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY", "E") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY", "E", "alpha") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY", "E", "beta") + "\n",
- "A " + os.path.join(wc_dir, "A", "B_COPY", "F") + "\n",
+ "A " + sbox.ospath('A/B_COPY/lambda') + "\n",
+ "A " + sbox.ospath('A/B_COPY/E') + "\n",
+ "A " + sbox.ospath('A/B_COPY/E/alpha') + "\n",
+ "A " + sbox.ospath('A/B_COPY/E/beta') + "\n",
+ "A " + sbox.ospath('A/B_COPY/F') + "\n",
"Checked out revision 1.\n",
"A " + B_COPY_path + "\n",
])
@@ -3725,8 +3725,8 @@ def update_copied_and_deleted_prop(sbox)
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = os.path.join(wc_dir, 'iota')
- iota2_path = os.path.join(wc_dir, 'iota2')
+ iota_path = sbox.ospath('iota')
+ iota2_path = sbox.ospath('iota2')
# Add a property on iota
svntest.actions.run_and_verify_svn(None, None, [],
@@ -3819,13 +3819,13 @@ def update_accept_conflicts(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Make a few local mods to files which will be committed
- iota_path = os.path.join(wc_dir, 'iota')
- lambda_path = os.path.join(wc_dir, 'A', 'B', 'lambda')
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
- beta_path = os.path.join(wc_dir, 'A', 'B', 'E', 'beta')
- pi_path = os.path.join(wc_dir, 'A', 'D', 'G', 'pi')
- rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
+ iota_path = sbox.ospath('iota')
+ lambda_path = sbox.ospath('A/B/lambda')
+ mu_path = sbox.ospath('A/mu')
+ alpha_path = sbox.ospath('A/B/E/alpha')
+ beta_path = sbox.ospath('A/B/E/beta')
+ pi_path = sbox.ospath('A/D/G/pi')
+ rho_path = sbox.ospath('A/D/G/rho')
svntest.main.file_append(lambda_path, 'Their appended text for lambda\n')
svntest.main.file_append(iota_path, 'Their appended text for iota\n')
svntest.main.file_append(mu_path, 'Their appended text for mu\n')
@@ -4057,7 +4057,7 @@ interactive-conflicts = true
config_dir = os.path.join(tmp_dir, 'interactive-conflicts-config')
svntest.main.create_config_dir(config_dir, config_contents)
- iota_path = os.path.join(wc_dir, 'iota')
+ iota_path = sbox.ospath('iota')
# Modify iota and commit for r2.
svntest.main.file_append(iota_path, "Appended text in r2.\n")
@@ -4155,7 +4155,7 @@ def restarted_update_should_delete_dir_p
sbox.build()
wc_dir = sbox.wc_dir
- A_path = os.path.join(wc_dir, 'A')
+ A_path = sbox.ospath('A')
zeta_path = os.path.join(A_path, 'zeta')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -4846,7 +4846,7 @@ def tree_conflict_uc1_update_deleted_tre
]]]
"""
- A = os.path.join(wc_dir, 'A')
+ A = sbox.ospath('A')
def modify_dir(dir):
"""Make some set of local modifications to an existing tree:
@@ -5079,9 +5079,9 @@ def set_deep_depth_on_target_with_shallo
wc_dir = sbox.wc_dir
# Some paths we'll care about
- A_path = os.path.join(wc_dir, "A")
- B_path = os.path.join(wc_dir, "A", "B")
- D_path = os.path.join(wc_dir, "A", "D")
+ A_path = sbox.ospath('A')
+ B_path = sbox.ospath('A/B')
+ D_path = sbox.ospath('A/D')
# Trim the tree: Set A/B to depth empty and A/D to depth immediates.
expected_output = svntest.wc.State(wc_dir, {
@@ -5273,8 +5273,8 @@ def mergeinfo_updates_merge_with_local_m
expected_disk, expected_status = set_up_branch(sbox)
# Some paths we'll care about
- A_path = os.path.join(wc_dir, "A")
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
+ A_path = sbox.ospath('A')
+ A_COPY_path = sbox.ospath('A_COPY')
# Merge -c3 from A to A_COPY at --depth empty, commit as r7.
###
@@ -5326,7 +5326,7 @@ def update_with_excluded_subdir(sbox):
wc_dir = sbox.wc_dir
- G = os.path.join(os.path.join(wc_dir, 'A', 'D', 'G'))
+ G = os.path.join(sbox.ospath('A/D/G'))
# Make the directory 'G' excluded.
expected_output = svntest.wc.State(wc_dir, {
@@ -5364,7 +5364,7 @@ def update_with_file_lock_and_keywords_p
wc_dir = sbox.wc_dir
- mu_path = os.path.join(wc_dir, 'A', 'mu')
+ mu_path = sbox.ospath('A/mu')
svntest.main.file_append(mu_path, '$Id$')
svntest.main.run_svn(None, 'ps', 'svn:keywords', 'Id', mu_path)
svntest.main.run_svn(None, 'lock', mu_path)
Modified: subversion/branches/javahl-ra/subversion/tests/libsvn_fs/locks-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/libsvn_fs/locks-test.c?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/libsvn_fs/locks-test.c (original)
+++ subversion/branches/javahl-ra/subversion/tests/libsvn_fs/locks-test.c Tue May 29 01:39:41 2012
@@ -91,28 +91,24 @@ verify_matching_lock_paths(struct get_lo
}
-/*-----------------------------------------------------------------*/
-
-/** The actual lock-tests called by `make check` **/
-
-
-
-/* Test that we can create a lock--nothing more. */
-static svn_error_t *
-lock_only(const svn_test_opts_t *opts,
- apr_pool_t *pool)
+/* Create a filesystem in a directory called NAME, and populate it with
+ * the standard Greek tree. Set *FS_P to the new filesystem object and
+ * *NEWREV_P to the head revision number. Unwanted outputs may be NULL. */
+static svn_error_t *
+create_greek_fs(svn_fs_t **fs_p,
+ svn_revnum_t *newrev_p,
+ const char *name,
+ const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
svn_fs_t *fs;
svn_fs_txn_t *txn;
svn_fs_root_t *txn_root;
const char *conflict;
svn_revnum_t newrev;
- svn_fs_access_t *access;
- svn_lock_t *mylock;
/* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-lock-only",
- opts, pool));
+ SVN_ERR(svn_test__create_fs(&fs, name, opts, pool));
SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
@@ -121,6 +117,32 @@ lock_only(const svn_test_opts_t *opts,
SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ if (fs_p)
+ *fs_p = fs;
+ if (newrev_p)
+ *newrev_p = newrev;
+ return SVN_NO_ERROR;
+}
+
+
+/*-----------------------------------------------------------------*/
+
+/** The actual lock-tests called by `make check` **/
+
+
+
+/* Test that we can create a lock--nothing more. */
+static svn_error_t *
+lock_only(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_fs_access_t *access;
+ svn_lock_t *mylock;
+
+ SVN_ERR(create_greek_fs(&fs, NULL, "test-repo-lock-only",
+ opts, pool));
+
/* We are now 'bubba'. */
SVN_ERR(svn_fs_create_access(&access, "bubba", pool));
SVN_ERR(svn_fs_set_access(fs, access));
@@ -143,23 +165,11 @@ lookup_lock_by_path(const svn_test_opts_
apr_pool_t *pool)
{
svn_fs_t *fs;
- svn_fs_txn_t *txn;
- svn_fs_root_t *txn_root;
- const char *conflict;
- svn_revnum_t newrev;
svn_fs_access_t *access;
svn_lock_t *mylock, *somelock;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-lookup-lock-by-path",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, NULL, "test-repo-lookup-lock-by-path",
+ opts, pool));
/* We are now 'bubba'. */
SVN_ERR(svn_fs_create_access(&access, "bubba", pool));
@@ -185,25 +195,13 @@ attach_lock(const svn_test_opts_t *opts,
apr_pool_t *pool)
{
svn_fs_t *fs;
- svn_fs_txn_t *txn;
- svn_fs_root_t *txn_root;
- const char *conflict;
- svn_revnum_t newrev;
svn_fs_access_t *access;
svn_lock_t *somelock;
svn_lock_t *mylock;
const char *token;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-attach-lock",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, NULL, "test-repo-attach-lock",
+ opts, pool));
/* We are now 'bubba'. */
SVN_ERR(svn_fs_create_access(&access, "bubba", pool));
@@ -238,25 +236,13 @@ get_locks(const svn_test_opts_t *opts,
apr_pool_t *pool)
{
svn_fs_t *fs;
- svn_fs_txn_t *txn;
- svn_fs_root_t *txn_root;
- const char *conflict;
- svn_revnum_t newrev;
svn_fs_access_t *access;
svn_lock_t *mylock;
struct get_locks_baton_t *get_locks_baton;
apr_size_t i, num_expected_paths;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-get-locks",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, NULL, "test-repo-get-locks",
+ opts, pool));
/* We are now 'bubba'. */
SVN_ERR(svn_fs_create_access(&access, "bubba", pool));
@@ -381,23 +367,11 @@ basic_lock(const svn_test_opts_t *opts,
apr_pool_t *pool)
{
svn_fs_t *fs;
- svn_fs_txn_t *txn;
- svn_fs_root_t *txn_root;
- const char *conflict;
- svn_revnum_t newrev;
svn_fs_access_t *access;
svn_lock_t *mylock, *somelock;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-basic-lock",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, NULL, "test-repo-basic-lock",
+ opts, pool));
/* We are now 'bubba'. */
SVN_ERR(svn_fs_create_access(&access, "bubba", pool));
@@ -440,16 +414,8 @@ lock_credentials(const svn_test_opts_t *
svn_lock_t *mylock;
svn_error_t *err;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-lock-credentials",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, &newrev, "test-repo-lock-credentials",
+ opts, pool));
/* We are now 'bubba'. */
SVN_ERR(svn_fs_create_access(&access, "bubba", pool));
@@ -535,16 +501,8 @@ final_lock_check(const svn_test_opts_t *
svn_lock_t *mylock;
svn_error_t *err;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-final-lock-check",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, &newrev, "test-repo-final-lock-check",
+ opts, pool));
/* Make a new transaction and delete "/A" */
SVN_ERR(svn_fs_begin_txn2(&txn, fs, newrev, SVN_FS_TXN_CHECK_LOCKS, pool));
@@ -595,16 +553,8 @@ lock_dir_propchange(const svn_test_opts_
svn_fs_access_t *access;
svn_lock_t *mylock;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-lock-dir-propchange",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, &newrev, "test-repo-lock-dir-propchange",
+ opts, pool));
/* Become 'bubba' and lock "/A/D/G/rho". */
SVN_ERR(svn_fs_create_access(&access, "bubba", pool));
@@ -645,16 +595,8 @@ lock_expiration(const svn_test_opts_t *o
svn_error_t *err;
struct get_locks_baton_t *get_locks_baton;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-lock-expiration",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, &newrev, "test-repo-lock-expiration",
+ opts, pool));
/* Make a new transaction and change rho. */
SVN_ERR(svn_fs_begin_txn2(&txn, fs, newrev, SVN_FS_TXN_CHECK_LOCKS, pool));
@@ -725,23 +667,11 @@ lock_break_steal_refresh(const svn_test_
apr_pool_t *pool)
{
svn_fs_t *fs;
- svn_fs_txn_t *txn;
- svn_fs_root_t *txn_root;
- const char *conflict;
- svn_revnum_t newrev;
svn_fs_access_t *access;
svn_lock_t *mylock, *somelock;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-steal-refresh",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, NULL, "test-repo-steal-refresh",
+ opts, pool));
/* Become 'bubba' and lock "/A/D/G/rho". */
SVN_ERR(svn_fs_create_access(&access, "bubba", pool));
@@ -813,16 +743,8 @@ lock_out_of_date(const svn_test_opts_t *
svn_lock_t *mylock;
svn_error_t *err;
- /* Prepare a filesystem and a new txn. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-lock-out-of-date",
- opts, pool));
- SVN_ERR(svn_fs_begin_txn2(&txn, fs, 0, SVN_FS_TXN_CHECK_LOCKS, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Create the greek tree and commit it. */
- SVN_ERR(svn_test__create_greek_tree(txn_root, pool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(newrev));
+ SVN_ERR(create_greek_fs(&fs, &newrev, "test-repo-lock-out-of-date",
+ opts, pool));
/* Commit a small change to /A/D/G/rho, creating revision 2. */
SVN_ERR(svn_fs_begin_txn2(&txn, fs, newrev, SVN_FS_TXN_CHECK_LOCKS, pool));
Modified: subversion/branches/javahl-ra/subversion/tests/libsvn_subr/named_atomic-test-common.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/libsvn_subr/named_atomic-test-common.h?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/libsvn_subr/named_atomic-test-common.h (original)
+++ subversion/branches/javahl-ra/subversion/tests/libsvn_subr/named_atomic-test-common.h Tue May 29 01:39:41 2012
@@ -210,7 +210,7 @@ test_pipeline(int id, int count, int ite
apr_itoa(pool,
id),
NULL),
- TRUE));
+ FALSE));
SVN_ERR(svn_named_atomic__get(&atomic_out,
ns,
apr_pstrcat(pool,
@@ -218,10 +218,10 @@ test_pipeline(int id, int count, int ite
apr_itoa(pool,
(id + 1) % count),
NULL),
- TRUE));
+ FALSE));
/* our iteration counter */
- SVN_ERR(svn_named_atomic__get(&atomic_counter, ns, "counter", TRUE));
+ SVN_ERR(svn_named_atomic__get(&atomic_counter, ns, "counter", FALSE));
/* safeguard our execution time. Limit it to 20s */
init_watchdog(&watchdog, atomic_counter, iterations, 20000000);
Modified: subversion/branches/javahl-ra/subversion/tests/libsvn_subr/named_atomic-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/libsvn_subr/named_atomic-test.c?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/libsvn_subr/named_atomic-test.c (original)
+++ subversion/branches/javahl-ra/subversion/tests/libsvn_subr/named_atomic-test.c Tue May 29 01:39:41 2012
@@ -45,37 +45,6 @@ static int hw_thread_count = 0;
* (will be calibrated to about 1s runtime)*/
static int suggested_iterations = 0;
-/* Return FALSE if we can't create SHMs due to missing privileges
- */
-static svn_boolean_t
-has_sufficient_privileges(void)
-{
-#ifdef _WIN32
- static svn_tristate_t result = svn_tristate_unknown;
-
- if (result == svn_tristate_unknown)
- {
- HANDLE handle = CreateFileMappingA(INVALID_HANDLE_VALUE,
- NULL,
- PAGE_READONLY,
- 0,
- 1,
- "Global\\__RandomXZY_svn");
- if (handle != NULL)
- {
- CloseHandle(handle);
- result = svn_tristate_true;
- }
- else
- result = svn_tristate_false;
- }
-
- return result == svn_tristate_true ? TRUE : FALSE;
-#else
- return TRUE;
-#endif
-}
-
/* If possible, translate PROC to a global path and set DIRECTORY to
* the current directory.
*/
@@ -156,25 +125,25 @@ init_test_shm(apr_pool_t *pool)
SVN_ERR(svn_io_open_unique_file3(NULL,
&name_namespace,
NULL,
- svn_io_file_del_none,
+ svn_io_file_del_on_pool_cleanup,
global_pool,
pool));
SVN_ERR(svn_io_open_unique_file3(NULL,
&name_namespace1,
NULL,
- svn_io_file_del_none,
+ svn_io_file_del_on_pool_cleanup,
global_pool,
pool));
SVN_ERR(svn_io_open_unique_file3(NULL,
&name_namespace2,
NULL,
- svn_io_file_del_none,
+ svn_io_file_del_on_pool_cleanup,
global_pool,
pool));
}
/* skip tests if the current user does not have the required privileges */
- if (!has_sufficient_privileges())
+ if (!svn_named_atomic__is_supported())
return svn_error_wrap_apr(SVN_ERR_TEST_SKIPPED,
"user has insufficient privileges");
@@ -211,20 +180,19 @@ init_concurrency_test_shm(apr_pool_t *po
{
svn_atomic_namespace__t *ns;
svn_named_atomic__t *atomic;
- apr_pool_t *scratch = svn_pool_create(pool);
int i;
/* get the two I/O atomics for this thread */
- SVN_ERR(svn_atomic_namespace__create(&ns, name_namespace, scratch));
+ SVN_ERR(svn_atomic_namespace__create(&ns, name_namespace, pool));
/* reset the I/O atomics for all threads */
for (i = 0; i < count; ++i)
{
SVN_ERR(svn_named_atomic__get(&atomic,
ns,
- apr_pstrcat(scratch,
+ apr_pstrcat(pool,
ATOMIC_NAME,
- apr_itoa(scratch, i),
+ apr_itoa(pool, i),
NULL),
TRUE));
SVN_ERR(svn_named_atomic__write(NULL, 0, atomic));
@@ -233,8 +201,6 @@ init_concurrency_test_shm(apr_pool_t *po
SVN_ERR(svn_named_atomic__get(&atomic, ns, "counter", TRUE));
SVN_ERR(svn_named_atomic__write(NULL, 0, atomic));
- apr_pool_clear(scratch);
-
return SVN_NO_ERROR;
}
@@ -407,12 +373,14 @@ calibrate_iterations(apr_pool_t *pool, i
for (calib_iterations = 10; taken < 100000.0; calib_iterations *= 2)
{
- SVN_ERR(init_concurrency_test_shm(pool, count));
+ apr_pool_t *scratch = svn_pool_create(pool);
+ SVN_ERR(init_concurrency_test_shm(scratch, count));
start = apr_time_now();
SVN_ERR(run_procs(pool, TEST_PROC, count, calib_iterations));
taken = (double)(apr_time_now() - start);
+ apr_pool_destroy(scratch);
}
/* scale that to 1s */
@@ -711,10 +679,10 @@ test_namespaces(apr_pool_t *pool)
return SVN_NO_ERROR;
}
-#if APR_HAS_THREADS
static svn_error_t *
test_multithreaded(apr_pool_t *pool)
{
+#if APR_HAS_THREADS
SVN_ERR(init_test_shm(pool));
SVN_ERR(calibrate_concurrency(pool));
@@ -723,8 +691,10 @@ test_multithreaded(apr_pool_t *pool)
SVN_ERR(run_threads(pool, hw_thread_count, suggested_iterations, test_pipeline));
return SVN_NO_ERROR;
-}
+#else
+ return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL);
#endif
+}
static svn_error_t *
test_multiprocess(apr_pool_t *pool)
@@ -762,10 +732,8 @@ struct svn_test_descriptor_t test_funcs[
"basic r/w access to multiple atomics"),
SVN_TEST_PASS2(test_namespaces,
"use different namespaces"),
-#if APR_HAS_THREADS
SVN_TEST_PASS2(test_multithreaded,
"multithreaded access to atomics"),
-#endif
SVN_TEST_PASS2(test_multiprocess,
"multi-process access to atomics"),
SVN_TEST_NULL
Modified: subversion/branches/javahl-ra/subversion/tests/libsvn_subr/string-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/libsvn_subr/string-test.c?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/libsvn_subr/string-test.c (original)
+++ subversion/branches/javahl-ra/subversion/tests/libsvn_subr/string-test.c Tue May 29 01:39:41 2012
@@ -521,7 +521,7 @@ test24(apr_pool_t *pool)
SVN_TEST_ASSERT(length == 1);
SVN_TEST_STRING_ASSERT(buffer, "0");
- length = svn__i64toa(buffer, -0x8000000000000000ll);
+ length = svn__i64toa(buffer, 0x8000000000000000ll);
SVN_TEST_ASSERT(length == 20);
SVN_TEST_STRING_ASSERT(buffer, "-9223372036854775808");
Propchange: subversion/branches/javahl-ra/subversion/tests/libsvn_wc/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue May 29 01:39:41 2012
@@ -9,3 +9,4 @@ entries-compat-test
op-depth-test
wc-lock-tester
wc-incomplete-tester
+wc-queries-test
Modified: subversion/branches/javahl-ra/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/libsvn_wc/op-depth-test.c?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/javahl-ra/subversion/tests/libsvn_wc/op-depth-test.c Tue May 29 01:39:41 2012
@@ -1217,9 +1217,9 @@ insert_dirs(svn_test__sandbox_t *b,
if (nodes->local_relpath[0])
{
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, 2));
- SVN_ERR(svn_sqlite__bindf(stmt, "sissrs",
+ SVN_ERR(svn_sqlite__bindf(stmt, "sdssrs",
nodes->local_relpath,
- (apr_int64_t)nodes->op_depth,
+ nodes->op_depth,
nodes->presence,
nodes->repo_relpath,
nodes->repo_revnum,
@@ -1229,9 +1229,9 @@ insert_dirs(svn_test__sandbox_t *b,
else
{
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, 1));
- SVN_ERR(svn_sqlite__bindf(stmt, "sissr",
+ SVN_ERR(svn_sqlite__bindf(stmt, "sdssr",
nodes->local_relpath,
- (apr_int64_t)nodes->op_depth,
+ nodes->op_depth,
nodes->presence,
nodes->repo_relpath,
nodes->repo_revnum));
@@ -4577,10 +4577,35 @@ move_update(const svn_test_opts_t *opts,
}
static svn_error_t *
+check_moved_to(apr_array_header_t *moved_tos,
+ int i,
+ int op_depth,
+ const char *local_relpath)
+{
+ struct svn_wc__db_moved_to_t *moved_to;
+
+ if (i >= moved_tos->nelts)
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "moved-to %d not found", i);
+
+ moved_to = APR_ARRAY_IDX(moved_tos, i, struct svn_wc__db_moved_to_t *);
+
+ if (moved_to->op_depth != op_depth
+ || strcmp(moved_to->local_relpath, local_relpath))
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "expected: {%d '%s'} found[%d]: {%d '%s'}",
+ op_depth, local_relpath, i,
+ moved_to->op_depth, moved_to->local_relpath);
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
test_scan_delete(const svn_test_opts_t *opts, apr_pool_t *pool)
{
svn_test__sandbox_t b;
const char *moved_to_abspath, *moved_to_op_root_abspath;
+ apr_array_header_t *moved_tos;
SVN_ERR(svn_test__sandbox_create(&b, "scan_delete", opts, pool));
@@ -4639,11 +4664,12 @@ test_scan_delete(const svn_test_opts_t *
SVN_TEST_STRING_ASSERT(moved_to_abspath, wc_path(&b, "X/B"));
SVN_TEST_STRING_ASSERT(moved_to_op_root_abspath, wc_path(&b, "X/B"));
- SVN_ERR(svn_wc__db_final_moved_to(&moved_to_abspath, b.wc_ctx->db,
- wc_path(&b, "A/B/C"), pool, pool));
- SVN_TEST_STRING_ASSERT(moved_to_abspath, wc_path(&b, "Y"));
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B/C"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 2, "X/B/C"));
+ SVN_ERR(check_moved_to(moved_tos, 1, 3, "Y"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 2);
- /* Not clear what this should give: Y or X/B/C or ... ? */
SVN_ERR(svn_wc__db_scan_deletion(NULL, &moved_to_abspath,
NULL, &moved_to_op_root_abspath,
b.wc_ctx->db, wc_path(&b, "A/B/C"),
@@ -4658,7 +4684,6 @@ test_scan_delete(const svn_test_opts_t *
SVN_TEST_STRING_ASSERT(moved_to_abspath, wc_path(&b, "X"));
SVN_TEST_STRING_ASSERT(moved_to_op_root_abspath, wc_path(&b, "X"));
- /* Not clear what this should give: Z or X/B or ... ? */
SVN_ERR(svn_wc__db_scan_deletion(NULL, &moved_to_abspath,
NULL, &moved_to_op_root_abspath,
b.wc_ctx->db, wc_path(&b, "A2/B"),
@@ -4669,6 +4694,279 @@ test_scan_delete(const svn_test_opts_t *
return SVN_NO_ERROR;
}
+static svn_error_t *
+test_follow_moved_to(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+ svn_test__sandbox_t b;
+ apr_array_header_t *moved_tos;
+
+ SVN_ERR(svn_test__sandbox_create(&b, "follow_moved_to", opts, pool));
+
+ SVN_ERR(wc_mkdir(&b, "A1"));
+ SVN_ERR(wc_mkdir(&b, "A1/B"));
+ SVN_ERR(wc_mkdir(&b, "A1/B/C"));
+ SVN_ERR(wc_mkdir(&b, "A1/B/C/D"));
+ SVN_ERR(wc_mkdir(&b, "A1/B/C/D/E"));
+ SVN_ERR(wc_mkdir(&b, "A2"));
+ SVN_ERR(wc_mkdir(&b, "A2/B"));
+ SVN_ERR(wc_mkdir(&b, "A2/B/C"));
+ SVN_ERR(wc_mkdir(&b, "A2/B/C/D"));
+ SVN_ERR(wc_mkdir(&b, "A2/B/C/D/E"));
+ SVN_ERR(wc_mkdir(&b, "A3"));
+ SVN_ERR(wc_mkdir(&b, "A3/B"));
+ SVN_ERR(wc_mkdir(&b, "A3/B/C"));
+ SVN_ERR(wc_mkdir(&b, "A3/B/C/D"));
+ SVN_ERR(wc_mkdir(&b, "A3/B/C/D/E"));
+ SVN_ERR(wc_commit(&b, ""));
+ SVN_ERR(wc_update(&b, "", 1));
+
+ {
+ nodes_row_t nodes[] = {
+ {0, "", "normal", 1, ""},
+ {0, "A1", "normal", 1, "A1"},
+ {0, "A1/B", "normal", 1, "A1/B"},
+ {0, "A1/B/C", "normal", 1, "A1/B/C"},
+ {0, "A1/B/C/D", "normal", 1, "A1/B/C/D"},
+ {0, "A1/B/C/D/E", "normal", 1, "A1/B/C/D/E"},
+ {0, "A2", "normal", 1, "A2"},
+ {0, "A2/B", "normal", 1, "A2/B"},
+ {0, "A2/B/C", "normal", 1, "A2/B/C"},
+ {0, "A2/B/C/D", "normal", 1, "A2/B/C/D"},
+ {0, "A2/B/C/D/E", "normal", 1, "A2/B/C/D/E"},
+ {0, "A3", "normal", 1, "A3"},
+ {0, "A3/B", "normal", 1, "A3/B"},
+ {0, "A3/B/C", "normal", 1, "A3/B/C"},
+ {0, "A3/B/C/D", "normal", 1, "A3/B/C/D"},
+ {0, "A3/B/C/D/E", "normal", 1, "A3/B/C/D/E"},
+ {0}
+ };
+ SVN_ERR(check_db_rows(&b, "", nodes));
+ }
+
+ SVN_ERR(wc_move(&b, "A1", "X"));
+ SVN_ERR(wc_move(&b, "A2", "A1"));
+ SVN_ERR(wc_move(&b, "A3", "A2"));
+ SVN_ERR(wc_move(&b, "X", "A3"));
+ SVN_ERR(wc_move(&b, "A1/B", "X"));
+ SVN_ERR(wc_move(&b, "A2/B", "A1/B"));
+ SVN_ERR(wc_move(&b, "A3/B", "A2/B"));
+ SVN_ERR(wc_move(&b, "X", "A3/B"));
+ SVN_ERR(wc_move(&b, "A1/B/C/D", "X"));
+ SVN_ERR(wc_move(&b, "A2/B/C/D", "A1/B/C/D"));
+ SVN_ERR(wc_move(&b, "A3/B/C/D", "A2/B/C/D"));
+ SVN_ERR(wc_move(&b, "X", "A3/B/C/D"));
+ SVN_ERR(wc_move(&b, "A1/B/C/D/E", "X"));
+ SVN_ERR(wc_move(&b, "A2/B/C/D/E", "A1/B/C/D/E"));
+ SVN_ERR(wc_move(&b, "A3/B/C/D/E", "A2/B/C/D/E"));
+ SVN_ERR(wc_move(&b, "X", "A3/B/C/D/E"));
+
+ {
+ nodes_row_t nodes[] = {
+ {0, "", "normal", 1, ""},
+ {0, "A1", "normal", 1, "A1"},
+ {0, "A1/B", "normal", 1, "A1/B"},
+ {0, "A1/B/C", "normal", 1, "A1/B/C"},
+ {0, "A1/B/C/D", "normal", 1, "A1/B/C/D"},
+ {0, "A1/B/C/D/E", "normal", 1, "A1/B/C/D/E"},
+ {0, "A2", "normal", 1, "A2"},
+ {0, "A2/B", "normal", 1, "A2/B"},
+ {0, "A2/B/C", "normal", 1, "A2/B/C"},
+ {0, "A2/B/C/D", "normal", 1, "A2/B/C/D"},
+ {0, "A2/B/C/D/E", "normal", 1, "A2/B/C/D/E"},
+ {0, "A3", "normal", 1, "A3"},
+ {0, "A3/B", "normal", 1, "A3/B"},
+ {0, "A3/B/C", "normal", 1, "A3/B/C"},
+ {0, "A3/B/C/D", "normal", 1, "A3/B/C/D"},
+ {0, "A3/B/C/D/E", "normal", 1, "A3/B/C/D/E"},
+
+ {1, "A1", "normal", 1, "A2", FALSE, "A3", TRUE},
+ {1, "A1/B", "normal", 1, "A2/B", MOVED_HERE},
+ {1, "A1/B/C", "normal", 1, "A2/B/C", MOVED_HERE},
+ {1, "A1/B/C/D", "normal", 1, "A2/B/C/D", MOVED_HERE},
+ {1, "A1/B/C/D/E", "normal", 1, "A2/B/C/D/E", MOVED_HERE},
+
+ {1, "A2", "normal", 1, "A3", FALSE, "A1", TRUE},
+ {1, "A2/B", "normal", 1, "A3/B", MOVED_HERE},
+ {1, "A2/B/C", "normal", 1, "A3/B/C", MOVED_HERE},
+ {1, "A2/B/C/D", "normal", 1, "A3/B/C/D", MOVED_HERE},
+ {1, "A2/B/C/D/E", "normal", 1, "A3/B/C/D/E", MOVED_HERE},
+
+ {1, "A3", "normal", 1, "A1", FALSE, "A2", TRUE},
+ {1, "A3/B", "normal", 1, "A1/B", MOVED_HERE},
+ {1, "A3/B/C", "normal", 1, "A1/B/C", MOVED_HERE},
+ {1, "A3/B/C/D", "normal", 1, "A1/B/C/D", MOVED_HERE},
+ {1, "A3/B/C/D/E", "normal", 1, "A1/B/C/D/E", MOVED_HERE},
+
+ {2, "A1/B", "normal", 1, "A3/B", FALSE, "A3/B", TRUE},
+ {2, "A1/B/C", "normal", 1, "A3/B/C", MOVED_HERE},
+ {2, "A1/B/C/D", "normal", 1, "A3/B/C/D", MOVED_HERE},
+ {2, "A1/B/C/D/E", "normal", 1, "A3/B/C/D/E", MOVED_HERE},
+
+ {2, "A2/B", "normal", 1, "A1/B", FALSE, "A1/B", TRUE},
+ {2, "A2/B/C", "normal", 1, "A1/B/C", MOVED_HERE},
+ {2, "A2/B/C/D", "normal", 1, "A1/B/C/D", MOVED_HERE},
+ {2, "A2/B/C/D/E", "normal", 1, "A1/B/C/D/E", MOVED_HERE},
+
+ {2, "A3/B", "normal", 1, "A2/B", FALSE, "A2/B", TRUE},
+ {2, "A3/B/C", "normal", 1, "A2/B/C", MOVED_HERE},
+ {2, "A3/B/C/D", "normal", 1, "A2/B/C/D", MOVED_HERE},
+ {2, "A3/B/C/D/E", "normal", 1, "A2/B/C/D/E", MOVED_HERE},
+
+ {4, "A1/B/C/D", "normal", 1, "A1/B/C/D", FALSE, "A3/B/C/D", TRUE},
+ {4, "A1/B/C/D/E", "normal", 1, "A1/B/C/D/E", MOVED_HERE},
+
+ {4, "A2/B/C/D", "normal", 1, "A2/B/C/D", FALSE, "A1/B/C/D", TRUE},
+ {4, "A2/B/C/D/E", "normal", 1, "A2/B/C/D/E", MOVED_HERE},
+
+ {4, "A3/B/C/D", "normal", 1, "A3/B/C/D", FALSE, "A2/B/C/D", TRUE},
+ {4, "A3/B/C/D/E", "normal", 1, "A3/B/C/D/E", MOVED_HERE},
+
+ {5, "A1/B/C/D/E", "normal", 1, "A2/B/C/D/E", FALSE, "A3/B/C/D/E", TRUE},
+ {5, "A2/B/C/D/E", "normal", 1, "A3/B/C/D/E", FALSE, "A1/B/C/D/E", TRUE},
+ {5, "A3/B/C/D/E", "normal", 1, "A1/B/C/D/E", FALSE, "A2/B/C/D/E", TRUE},
+ {0}
+ };
+ SVN_ERR(check_db_rows(&b, "", nodes));
+ }
+
+ /* A1->A3, A3/B->A2/B, A2/B/C/D->A1/B/C/D, A1/B/C/D/E->A3/B/C/D/E */
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A1"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "A3"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A1/B"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "A3/B"));
+ SVN_ERR(check_moved_to(moved_tos, 1, 2, "A2/B"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 2);
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A1/B/C"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "A3/B/C"));
+ SVN_ERR(check_moved_to(moved_tos, 1, 2, "A2/B/C"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 2);
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A1/B/C/D"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "A3/B/C/D"));
+ SVN_ERR(check_moved_to(moved_tos, 1, 2, "A2/B/C/D"));
+ SVN_ERR(check_moved_to(moved_tos, 2, 4, "A1/B/C/D"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 3);
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A1/B/C/D/E"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "A3/B/C/D/E"));
+ SVN_ERR(check_moved_to(moved_tos, 1, 2, "A2/B/C/D/E"));
+ SVN_ERR(check_moved_to(moved_tos, 2, 4, "A1/B/C/D/E"));
+ SVN_ERR(check_moved_to(moved_tos, 3, 5, "A3/B/C/D/E"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 4);
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+mixed_rev_move(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+ svn_test__sandbox_t b;
+ apr_array_header_t *moved_tos;
+
+ SVN_ERR(svn_test__sandbox_create(&b, "mixed_rev_move", opts, pool));
+
+ SVN_ERR(wc_mkdir(&b, "A"));
+ SVN_ERR(wc_commit(&b, ""));
+ SVN_ERR(wc_mkdir(&b, "A/B"));
+ SVN_ERR(wc_commit(&b, ""));
+ SVN_ERR(wc_mkdir(&b, "A/B/C"));
+ SVN_ERR(wc_commit(&b, ""));
+
+ {
+ nodes_row_t nodes[] = {
+ {0, "", "normal", 0, ""},
+ {0, "A", "normal", 1, "A"},
+ {0, "A/B", "normal", 2, "A/B"},
+ {0, "A/B/C", "normal", 3, "A/B/C"},
+ {0}
+ };
+ SVN_ERR(check_db_rows(&b, "", nodes));
+ }
+
+ SVN_ERR(wc_move(&b, "A", "X"));
+
+ {
+ nodes_row_t nodes[] = {
+ {0, "", "normal", 0, ""},
+ {0, "A", "normal", 1, "A"},
+ {0, "A/B", "normal", 2, "A/B"},
+ {0, "A/B/C", "normal", 3, "A/B/C"},
+ {1, "A", "base-deleted", NO_COPY_FROM, "X"},
+ {1, "A/B", "base-deleted", NO_COPY_FROM},
+ {1, "A/B/C", "base-deleted", NO_COPY_FROM},
+ {1, "X", "normal", 1, "A", MOVED_HERE},
+ {1, "X/B", "not-present", 2, "A/B"},
+ {2, "X/B", "normal", 2, "A/B", MOVED_HERE},
+ {2, "X/B/C", "not-present", 3, "A/B/C"},
+ {3, "X/B/C", "normal", 3, "A/B/C", MOVED_HERE},
+ {0}
+ };
+ SVN_ERR(check_db_rows(&b, "", nodes));
+ }
+
+ /* ### These values PASS but I'm not sure they are correct. */
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B/C"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B/C"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "X"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+
+ /* This move doesn't record moved-to */
+ SVN_ERR(wc_move(&b, "X/B", "X/Y"));
+
+ {
+ nodes_row_t nodes[] = {
+ {0, "", "normal", 0, ""},
+ {0, "A", "normal", 1, "A"},
+ {0, "A/B", "normal", 2, "A/B"},
+ {0, "A/B/C", "normal", 3, "A/B/C"},
+ {1, "A", "base-deleted", NO_COPY_FROM, "X"},
+ {1, "A/B", "base-deleted", NO_COPY_FROM},
+ {1, "A/B/C", "base-deleted", NO_COPY_FROM},
+ {1, "X", "normal", 1, "A", MOVED_HERE},
+ {1, "X/B", "not-present", 2, "A/B"},
+ {2, "X/Y", "normal", 2, "A/B"},
+ {2, "X/Y/C", "not-present", NO_COPY_FROM},
+ {3, "X/Y/C", "normal", 3, "A/B/C"},
+ {0}
+ };
+ SVN_ERR(check_db_rows(&b, "", nodes));
+ }
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B/C"), pool, pool));
+ SVN_TEST_ASSERT(moved_tos->nelts == 0);
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B"), pool, pool));
+ SVN_TEST_ASSERT(moved_tos->nelts == 0);
+
+ SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A"), pool, pool));
+ SVN_ERR(check_moved_to(moved_tos, 0, 1, "X"));
+ SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+ return SVN_NO_ERROR;
+}
+
/* ---------------------------------------------------------------------- */
/* The list of test functions */
@@ -4760,7 +5058,11 @@ struct svn_test_descriptor_t test_funcs[
"move_added"),
SVN_TEST_OPTS_XFAIL(move_update,
"move_update"),
- SVN_TEST_OPTS_WIMP(test_scan_delete,
- "scan_delete", "move tracking"),
+ SVN_TEST_OPTS_PASS(test_scan_delete,
+ "scan_delete"),
+ SVN_TEST_OPTS_PASS(test_follow_moved_to,
+ "follow_moved_to"),
+ SVN_TEST_OPTS_PASS(mixed_rev_move,
+ "mixed_rev_move"),
SVN_TEST_NULL
};
Modified: subversion/branches/javahl-ra/subversion/tests/svn_test.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/svn_test.h?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/svn_test.h (original)
+++ subversion/branches/javahl-ra/subversion/tests/svn_test.h Tue May 29 01:39:41 2012
@@ -74,6 +74,9 @@ extern "C" {
} while (0)
/** Handy macro for testing string equality.
+ *
+ * EXPR and/or EXPECTED_EXPR may be NULL which compares equal to NULL and
+ * not equal to any non-NULL string.
*/
#define SVN_TEST_STRING_ASSERT(expr, expected_expr) \
do { \
@@ -82,8 +85,8 @@ extern "C" {
\
if (tst_str2 == NULL && tst_str1 == NULL) \
break; \
- if ( (tst_str2 != NULL && tst_str1 == NULL) \
- || (strcmp(tst_str2, tst_str1) != 0) ) \
+ if ((tst_str1 == NULL) || (tst_str2 == NULL) \
+ || (strcmp(tst_str2, tst_str1) != 0)) \
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, \
"Strings not equal\n Expected: '%s'\n Found: '%s'" \
"\n at %s:%d", \
Modified: subversion/branches/javahl-ra/tools/buildbot/slaves/bb-openbsd/svnbuild.sh
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/buildbot/slaves/bb-openbsd/svnbuild.sh?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/buildbot/slaves/bb-openbsd/svnbuild.sh (original)
+++ subversion/branches/javahl-ra/tools/buildbot/slaves/bb-openbsd/svnbuild.sh Tue May 29 01:39:41 2012
@@ -23,4 +23,4 @@ set -e
set -x
branch="$(basename $(svn info . | grep ^URL | cut -d' ' -f2))"
-(cd .. && gmake BRANCH="$branch")
+(cd .. && gmake BRANCH="$branch" THREADING="no")
Modified: subversion/branches/javahl-ra/tools/buildbot/slaves/centos/svnbuild.sh
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/buildbot/slaves/centos/svnbuild.sh?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/buildbot/slaves/centos/svnbuild.sh (original)
+++ subversion/branches/javahl-ra/tools/buildbot/slaves/centos/svnbuild.sh Tue May 29 01:39:41 2012
@@ -23,6 +23,7 @@
set -x
export MAKEFLAGS=-j4
+export PYTHON=/usr/local/python25/bin/python
echo "========= autogen.sh"
./autogen.sh || exit $?
@@ -30,15 +31,16 @@ echo "========= autogen.sh"
echo "========= configure"
# --with-junit=/usr/share/java/junit.jar
# --with-jdk=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64 \
+# --without-berkeley-db \
./configure --enable-javahl --enable-maintainer-mode \
--with-neon=/usr \
--with-apxs=/usr/sbin/apxs \
- --without-berkeley-db \
+ --with-berkeley-db \
--with-apr=/usr \
--with-apr-util=/usr \
--with-jdk=/opt/java/jdk1.6.0_15 \
--with-junit=/home/bt/junit-4.4.jar \
- --with-sqlite=/home/bt/sqlite-3.6.17/sqlite3.c \
+ --with-sqlite=/home/bt/packages/sqlite-amalgamation-dir/sqlite3.c \
|| exit $?
echo "========= make"
Modified: subversion/branches/javahl-ra/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd (original)
+++ subversion/branches/javahl-ra/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd Tue May 29 01:39:41 2012
@@ -31,12 +31,13 @@ IF NOT EXIST "imports\" (
svn co --username guest --password "" http://sharpsvn.open.collab.net/svn/sharpsvn/trunk/imports imports
)
IF NOT EXIST build\imports.done (
+ svn up imports
copy /y imports\dev-default.build default.build
nant prep-dev %NANTARGS%
IF ERRORLEVEL 1 (
exit /B 1
)
- del release\bin\*svn* release\bin\_*.*
+ del release\bin\*svn* release\bin\_*.* 2>nul:
echo. > build\imports.done
)
@@ -58,6 +59,8 @@ taskkill /im svnsync.exe /f 2> nul:
taskkill /im httpd.exe /f 2> nul:
taskkill /im fs-test.exe /f 2> nul:
taskkill /im op-depth-test.exe /f 2> nul:
+taskkill /im java.exe /f 2> nul:
+taskkill /im perl.exe /f 2> nul:
IF EXIST "%TESTDIR%\tests\subversion\tests\cmdline\httpd\" (
rmdir /s /q "%TESTDIR%\tests\subversion\tests\cmdline\httpd"
)
Modified: subversion/branches/javahl-ra/tools/client-side/bash_completion
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/client-side/bash_completion?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/client-side/bash_completion (original)
+++ subversion/branches/javahl-ra/tools/client-side/bash_completion Tue May 29 01:39:41 2012
@@ -479,7 +479,7 @@ _svn()
[[ $previous = '--extensions' || $previous = '-x' ]] && \
values="--unified --ignore-space-change \
- --ignore-all-space --ignore-eol-style"
+ --ignore-all-space --ignore-eol-style --show-c-functions"
[[ $previous = '--depth' ]] && \
values='empty files immediates infinity'
@@ -494,8 +494,8 @@ _svn()
# from svn help resolve
values='base working mine-full theirs-full'
else # checkout merge switch update
- # not implemented yet: mine-conflict theirs-conflict
- values='postpone base mine-full theirs-full edit launch'
+ values="postpone base mine-full theirs-full edit launch \
+ mine-conflict theirs-conflict"
fi
}
@@ -889,7 +889,8 @@ _svn()
--parents"
;;
patch)
- cmdOpts="$qOpts $pOpts --dry-run --ignore-whitespace --reverse-diff --strip"
+ cmdOpts="$qOpts $pOpts --dry-run --ignore-whitespace \
+ --reverse-diff --strip"
;;
propdel|pdel|pd)
cmdOpts="$qOpts -R --recursive $rOpts $pOpts $cOpts \
Modified: subversion/branches/javahl-ra/tools/dev/benchmarks/large_dirs/create_bigdir.sh
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dev/benchmarks/large_dirs/create_bigdir.sh?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dev/benchmarks/large_dirs/create_bigdir.sh (original)
+++ subversion/branches/javahl-ra/tools/dev/benchmarks/large_dirs/create_bigdir.sh Tue May 29 01:39:41 2012
@@ -124,6 +124,20 @@ run_svn_del() {
fi
}
+run_svn_del_many() {
+ printf "\n" > files.lst
+ sequence=`get_sequence 2 ${1}`
+ for i in $sequence; do
+ printf "$WC/${1}_c/$i\n" >> files.lst
+ done
+
+ if [ "${VALGRIND}" = "" ] ; then
+ time ${SVN} del -q --targets files.lst > /dev/null
+ else
+ ${VALGRIND} ${VG_OUTFILE}="${VG_TOOL}.out.del_many.$1" ${SVN} del -q --targets files.lst > /dev/null
+ fi
+}
+
run_svn_ci() {
if [ "${VALGRIND}" = "" ] ; then
time ${SVN} ci $WC/$1 -m "" -q > /dev/null
@@ -185,12 +199,13 @@ while [ $FILECOUNT -lt $MAXCOUNT ]; do
run_svn_del ${FILECOUNT} 1
printf "\tDeleting files ... \t"
- time sh -c "
- for i in $sequence; do
- ${SVN} del $WC/${FILECOUNT}_c/\$i -q
- done "
+ if [ "$FILECOUNT" == "1" ] ; then
+ printf " skipped (0 files to delete)\n"
+ else
+ run_svn_del_many ${FILECOUNT}
+ fi
- printf "\tCommit deletions ...\t"
+ printf "\tCommit deletions ..\t"
run_svn_ci ${FILECOUNT}_c del
rm -rf $WC
Modified: subversion/branches/javahl-ra/tools/dev/gen-py-errors.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dev/gen-py-errors.py?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dev/gen-py-errors.py (original)
+++ subversion/branches/javahl-ra/tools/dev/gen-py-errors.py Tue May 29 01:39:41 2012
@@ -23,44 +23,87 @@
# ====================================================================
#
#
-# Meant to be run from the root of a Subversion working copy. If anybody
-# wants to do some path magic to improve that use, feel free.
-
-import sys, os
-sys.path.append(os.path.join('subversion', 'bindings', 'swig',
- 'python', 'tests'))
-
+# Locates svn_error_codes.h based on its relative location to this script.
+#
+# Generates to STDOUT. Typically, redirect this into svntest/err.py
+#
-import setup_path
+import sys
+import os
+import re
-header = '''#!/usr/bin/env python
+HEADER = '''#!/usr/bin/env python
### This file automatically generated by tools/dev/gen-py-error.py,
### which see for more information
###
### It is versioned for convenience.
-
'''
+# Established by svn 1.0. May as well hard-code these.
+APR_OS_START_ERROR = 20000
+APR_OS_START_USERERR = APR_OS_START_ERROR + 50000 * 2
+SVN_ERR_CATEGORY_SIZE = 5000
+
+RE_CAT_NAME = re.compile(r'SVN_ERR_([A-Z_]+)_CATEG')
+RE_CAT_VALUE = re.compile(r'\d+')
+
+RE_DEF_NAME = re.compile(r'SVN_ERRDEF\(([A-Z0-9_]+)')
+RE_DEF_VALUE = re.compile(r'SVN_ERR_([A-Z_]+)_CATEG[^0-9]*([0-9]+)')
+
+
+def write_output(codes):
+ print HEADER
+
+ for name, value in codes:
+ # skip SVN_ERR_ on the name
+ print '%s = %d' % (name[8:], value)
+
+
+def main(codes_fname):
+ categ = { }
+ codes = [ ]
+
+ f = open(codes_fname)
+
+ # Parse all the category start values
+ while True:
+ line = f.next()
+ m = RE_CAT_NAME.search(line)
+ if m:
+ name = m.group(1)
+ m = RE_CAT_VALUE.search(f.next())
+ assert m
+ value = int(m.group(0))
+ categ[name] = APR_OS_START_USERERR + value * SVN_ERR_CATEGORY_SIZE
+
+ elif line.strip() == 'SVN_ERROR_START':
+ break
+
+ # Parse each of the error values
+ while True:
+ line = f.next()
+ m = RE_DEF_NAME.search(line)
+ if m:
+ name = m.group(1)
+ line = f.next()
+ m = RE_DEF_VALUE.search(line)
+ if not m:
+ # SVN_ERR_WC_NOT_DIRECTORY is defined as equal to NOT_WORKING_COPY
+ # rather than relative to SVN_ERR_WC_CATEGORY_START
+ #print 'SKIP:', line
+ continue
+ cat = m.group(1)
+ value = int(m.group(2))
+ codes.append((name, categ[cat] + value))
-def write_output(errs, filename):
- out = open(filename, 'w')
- out.write(header)
-
- for name, val in errs:
- out.write('%s = %d\n' % (name, val))
-
- out.close()
-
-
-def main(output_filename):
- import core
+ elif line.strip() == 'SVN_ERROR_END':
+ break
- errs = [e for e in dir(core.svn.core) if e.startswith('SVN_ERR_')]
- codes = []
- for e in errs:
- codes.append((e[8:], getattr(core.svn.core, e)))
- write_output(codes, output_filename)
+ write_output(sorted(codes))
if __name__ == '__main__':
- main(os.path.join('subversion', 'tests', 'cmdline', 'svntest', 'err.py'))
+ this_dir = os.path.dirname(os.path.abspath(__file__))
+ codes_fname = os.path.join(this_dir, os.path.pardir, os.path.pardir,
+ 'subversion', 'include', 'svn_error_codes.h')
+ main(codes_fname)
Modified: subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn Tue May 29 01:39:41 2012
@@ -30,6 +30,7 @@
# |______________________________________________________________|
ENABLE_PERL_BINDINGS ?= yes
+THREADING ?= yes
ENABLE_JAVA_BINDINGS ?= no # they don't build with thread-less APR...
USE_APR_ICONV ?= no # set to yes to use APR iconv instead of GNU iconv
PARALLEL ?= 1
@@ -60,10 +61,10 @@ OBJDIR = $(PWD)/objdir
BDB_MAJOR_VER = 4.7
BDB_VER = $(BDB_MAJOR_VER).25
-APR_VER = 1.4.5
+APR_VER = 1.4.6
APR_ICONV_VER = 1.2.1
GNU_ICONV_VER = 1.14
-APR_UTIL_VER = 1.3.12
+APR_UTIL_VER = 1.4.1
HTTPD_VER = 2.2.22
NEON_VER = 0.29.6
SERF_VER = 1.0.3
@@ -73,7 +74,7 @@ SQLITE_VER = 3071100
LIBMAGIC_VER = 5.11
RUBY_VER = 1.8.7-p358
BZ2_VER = 1.0.6
-PYTHON_VER = 2.7.2
+PYTHON_VER = 2.7.3
BDB_DIST = db-$(BDB_VER).tar.gz
APR_ICONV_DIST = apr-iconv-$(APR_ICONV_VER).tar.gz
@@ -117,7 +118,7 @@ CYRUS_SASL_URL = ftp://ftp.andrew.cmu.ed
LIBMAGIC_URL = ftp://ftp.astron.com/pub/file/$(LIBMAGIC_DIST)
RUBY_URL = http://ftp.ruby-lang.org/pub/ruby/1.8/$(RUBY_DIST)
BZ2_URL = http://bzip.org/$(BZ2_VER)/$(BZ2_DIST)
-PYTHON_URL = http://python.org/ftp/python/2.7.2/$(PYTHON_DIST)
+PYTHON_URL = http://python.org/ftp/python/$(PYTHON_VER)/$(PYTHON_DIST)
BDB_SRCDIR = $(SRCDIR)/db-$(BDB_VER)
APR_SRCDIR = $(SRCDIR)/apr-$(APR_VER)
@@ -292,7 +293,7 @@ $(APR_OBJDIR)/.retrieved:
fi
touch $@
-ifdef THREADING
+ifeq ($(THREADING),yes)
THREADS_FLAG=--enable-threads
else
THREADS_FLAG=--disable-threads
@@ -304,11 +305,6 @@ endif
# configure apr
$(APR_OBJDIR)/.configured: $(APR_OBJDIR)/.retrieved
- cp $(APR_SRCDIR)/build/apr_hints.m4 \
- $(APR_SRCDIR)/build/apr_hints.m4.orig
- cat $(APR_SRCDIR)/build/apr_hints.m4.orig \
- | sed -e '/^.*APR_ADDTO(CPPFLAGS, \[-D_POSIX_THREADS\]).*$$/d' \
- > $(APR_SRCDIR)/build/apr_hints.m4
cd $(APR_SRCDIR) && ./buildconf
cd $(APR_OBJDIR) \
&& env CFLAGS="-O0 -g $(PROFILE_CFLAGS)" GREP="`which grep`" \
@@ -779,7 +775,7 @@ $(SQLITE_OBJDIR)/.retrieved: $(DISTDIR)/
tar -C $(SRCDIR) -zxf $(DISTDIR)/$(SQLITE_DIST)
touch $@
-ifdef THREADING
+ifeq ($(THREADING),yes)
THREADSAFE_FLAG=--enable-threadsafe
else
THREADSAFE_FLAG=--disable-threadsafe
Modified: subversion/branches/javahl-ra/tools/dev/unix-build/README
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dev/unix-build/README?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dev/unix-build/README (original)
+++ subversion/branches/javahl-ra/tools/dev/unix-build/README Tue May 29 01:39:41 2012
@@ -22,12 +22,24 @@ repository.
Usage
=====
-First, choose a directory $(SVN_DEV) to set up the environment. Note
-that this directory cannot be changed later because the script
-hardcodes build and link paths relative to the current working
-directory.
+First, choose a directory $(SVN_DEV) to set up the environment.
+For example, $(SVN_DEV) could be the directory "~/svn".
+Note that this directory cannot be changed later because the script
+hardcodes build and link paths relative to the current working directory.
+
+ $ mkdir $(SVN_DEV)
+
+Now change into this directory and make the Makefile available in it:
+
+ $ cd $(SVN_DEV)
+ $ svn checkout https://svn.apache.org/repos/asf/subversion/trunk/tools/dev/unix-build
+ $ ln -s unix-build/Makefile.svn Makefile
+
+To fetch and build trunk, simply don't pass anything, just run 'make':
+
+ $ cd $(SVN_DEV)
+ $ make
-To fetch and build trunk, simply don't pass anything.
Pass the branch you want to build in BRANCH, e.g.
$ make BRANCH="1.5.x"
You can also pass a tag to build:
@@ -39,19 +51,37 @@ than one working copy of the same branch
When the script has finished fetching and building, it uses
$(SVN_DEV)/prefix to install Subversion libraries and
binaries. $(SVN_DEV)/prefix/svn-trunk (or whatever you choose to
-build) will contain the latest Subversion binaries: you should add
-$(SVN_DEV)/prefix/svn-trunk/bin to your $PATH to use them. The
-Makefile in $(SVN_DEV)/svn-trunk is configured to build with sane
+build) will contain the latest Subversion binaries. You can add
+$(SVN_DEV)/prefix/svn-trunk/bin to your $PATH to use them:
+
+ $ export PATH="$(SVN_DEV)/prefix/svn-trunk/bin:$PATH"
+
+The Makefile in $(SVN_DEV)/svn-trunk is configured to build with sane
options: while developing Subversion, simply `svn up` to pull the
latest changes, `make` and `make install` to install the binaries in
-$(SVN_DEV)/prefix/svn-trunk.
+$(SVN_DEV)/prefix/svn-trunk. This usually works fine. If not, you may
+need to use the 'svn-reset' target and recompile everything.
+
+If at any point, you want to recompile any of the packages with the
+default configuration in Makefile.svn, use the *-clean and *-reset
+target in Makefile.svn before trying to rebuild again. For example:
+
+ $ make svn-clean
+ $ make svn-reset
+ $ make
+
+Or, if you want to recompile svn and all dependencies:
+
+ $ make clean
+ $ make reset
+ $ make
+
+If you want to remove everything including the installed binaries effectively
+returning to the starting point, use the "nuke" target (BE CAREFUL, this will
+remove the 'svn' binary compiled from trunk which you might need to manage
+existing working copies):
-If at any point, you want to re-configure any of the packages to the
-default configuration in Makefile.svn, just run the "<PACKAGE>-reset"
-target in Makefile.svn before trying to rebuild again. If, in the
-extreme case, you want to remove everything including the installed
-binaries effectively returning to the starting point, use the "nuke"
-target.
+ $ make nuke
Extended usage
==============
Modified: subversion/branches/javahl-ra/tools/dev/windows-build/Makefile
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dev/windows-build/Makefile?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dev/windows-build/Makefile (original)
+++ subversion/branches/javahl-ra/tools/dev/windows-build/Makefile Tue May 29 01:39:41 2012
@@ -128,7 +128,7 @@ all2: targetdir
package:
test -d $(SVNDIR)\$(CONFIG)\Subversion\tests\cmdline || mkdir $(SVNDIR)\$(CONFIG)\Subversion\tests\cmdline
test -d $(TARGETDIR)\bin || mkdir $(TARGETDIR)\bin
- for %%i in (svn svnadmin svndumpfilter svnlook svnserve svnsync svnversion svnrdump) do @$(CP) $(CONFIG)\subversion\%%i\%%i.exe $(TARGETDIR)\bin
+ for %%i in (svn svnadmin svndumpfilter svnlook svnserve svnsync svnversion svnrdump svnmucc) do @$(CP) $(CONFIG)\subversion\%%i\%%i.exe $(TARGETDIR)\bin
for %%i in (diff diff3 diff4) do @if exist $(CONFIG)\tools\diff\%%i.exe $(CP) $(CONFIG)\tools\diff\%%i.exe $(TARGETDIR)\bin
$(CP) $(APRDIR)\$(CONFIG)/*.dll $(TARGETDIR)\bin
$(CP) $(APRUTILDIR)\$(CONFIG)/*.dll $(TARGETDIR)\bin
Modified: subversion/branches/javahl-ra/tools/dist/nightly.sh
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dist/nightly.sh?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dist/nightly.sh (original)
+++ subversion/branches/javahl-ra/tools/dist/nightly.sh Tue May 29 01:39:41 2012
@@ -63,7 +63,7 @@ $svn export -r $head $repo/trunk/build/g
# Create the environment
cd roll
echo '----------------building environment------------------'
-../release.py --base-dir ${abscwd}/roll build-env
+../release.py --base-dir ${abscwd}/roll build-env trunk-nightly
# Roll the tarballs
echo '-------------------rolling tarball--------------------'
@@ -72,8 +72,8 @@ cd ..
# Create the information page
echo '-------------------moving results---------------------'
-./release.py --base-dir ${abscwd}/roll post-candidates trunk-nightly $head \
- --target $target
+# ./release.py --base-dir ${abscwd}/roll post-candidates trunk-nightly $head \
+# --target $target
if [ ! -d "$target/dist" ]; then mkdir "$target/dist"; fi
if [ -d "$target/dist/r$head" ]; then rm -r "$target/dist/r$head"; fi
mv roll/deploy $target/dist/r$head
Modified: subversion/branches/javahl-ra/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dist/release.py?rev=1343447&r1=1343446&r2=1343447&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dist/release.py (original)
+++ subversion/branches/javahl-ra/tools/dist/release.py Tue May 29 01:39:41 2012
@@ -84,6 +84,7 @@ tool_versions = {
# Some constants
repos = 'http://svn.apache.org/repos/asf/subversion'
+secure_repos = 'https://svn.apache.org/repos/asf/subversion'
dist_repos = 'https://dist.apache.org/repos/dist'
dist_dev_url = dist_repos + '/dev/subversion'
dist_release_url = dist_repos + '/release/subversion'
@@ -416,14 +417,15 @@ def roll_tarballs(args):
extra_args = '-nightly'
else:
extra_args = '-%s %d' % (args.version.pre, args.version.pre_num)
- logging.info('Building UNIX tarballs')
- run_script(args.verbose, '%s/dist.sh -v %s -pr %s -r %d %s'
- % (sys.path[0], args.version.base, branch, args.revnum,
- extra_args) )
+ # Build Unix last to leave Unix-style svn_version.h for tagging
logging.info('Buildling Windows tarballs')
run_script(args.verbose, '%s/dist.sh -v %s -pr %s -r %d -zip %s'
% (sys.path[0], args.version.base, branch, args.revnum,
extra_args) )
+ logging.info('Building UNIX tarballs')
+ run_script(args.verbose, '%s/dist.sh -v %s -pr %s -r %d %s'
+ % (sys.path[0], args.version.base, branch, args.revnum,
+ extra_args) )
# Move the results to the deploy directory
logging.info('Moving artifacts and calculating checksums')
@@ -478,16 +480,47 @@ def post_candidates(args):
'Post candidate artifacts to the dist development directory.'
logging.info('Importing tarballs to %s' % dist_dev_url)
- proc = subprocess.Popen(['svn', 'import', '-m',
- 'Add %s candidate release artifacts'
- % args.version.base,
- '--auto-props', '--config-option',
- 'config:auto-props:*.asc=svn:eol-style=native',
- get_deploydir(args.base_dir), dist_dev_url])
+ svn_cmd = ['svn', 'import', '-m',
+ 'Add %s candidate release artifacts' % args.version.base,
+ '--auto-props', '--config-option',
+ 'config:auto-props:*.asc=svn:eol-style=native;svn:mime-type=text/plain',
+ get_deploydir(args.base_dir), dist_dev_url]
+ if (args.username):
+ svn_cmd += ['--username', args.username]
+ proc = subprocess.Popen(svn_cmd)
(stdout, stderr) = proc.communicate()
proc.wait()
#----------------------------------------------------------------------
+# Create tag
+
+def create_tag(args):
+ 'Create tag in the repository'
+
+ logging.info('Creating tag for %s' % str(args.version))
+
+ if args.branch:
+ branch = secure_repos + '/' + args.branch
+ else:
+ branch = secure_repos + '/branches/%d.%d.x' % (args.version.major,
+ args.version.minor)
+
+ tag = secure_repos + '/tags/' + str(args.version)
+
+ svnmucc_cmd = ['svnmucc', '-m',
+ 'Tagging release ' + str(args.version)]
+ if (args.username):
+ svnmucc_cmd += ['--username', args.username]
+ svnmucc_cmd += ['cp', str(args.revnum), branch, tag]
+ svnmucc_cmd += ['put', os.path.join(get_deploydir(args.base_dir),
+ 'svn_version.h.dist'),
+ tag + '/subversion/include/svn_version.h']
+
+ # don't redirect stdout/stderr since svnmucc might ask for a password
+ proc = subprocess.Popen(svnmucc_cmd)
+ proc.wait()
+
+#----------------------------------------------------------------------
# Clean dist
def clean_dist(args):
@@ -514,6 +547,8 @@ def clean_dist(args):
svnmucc_cmd = ['svnmucc', '-m', 'Remove old Subversion releases.\n' +
'They are still available at ' +
'http://archive.apache.org/dist/subversion/']
+ if (args.username):
+ svnmucc_cmd += ['--username', args.username]
for k, g in itertools.groupby(sorted(versions),
lambda x: (x.major, x.minor)):
releases = list(g)
@@ -549,6 +584,8 @@ def move_to_dist(args):
filenames.append(entry)
svnmucc_cmd = ['svnmucc', '-m',
'Publish Subversion-%s.' % str(args.version)]
+ if (args.username):
+ svnmucc_cmd += ['--username', args.username]
svnmucc_cmd += ['rm', dist_dev_url + '/' + 'svn_version.h.dist']
for filename in filenames:
svnmucc_cmd += ['mv', dist_dev_url + '/' + filename,
@@ -678,6 +715,8 @@ def check_sigs(args):
good_sigs[verified.key_id[-8:]] = True
else:
sys.stderr.write("BAD SIGNATURE for %s\n" % filename)
+ if verified.key_id:
+ sys.stderr.write(" key id: %s\n" % verified.key_id)
sys.exit(1)
for id in good_sigs.keys():
@@ -760,6 +799,21 @@ def main():
subparser.set_defaults(func=post_candidates)
subparser.add_argument('version', type=Version,
help='''The release label, such as '1.7.0-alpha1'.''')
+ subparser.add_argument('--username',
+ help='''Username for ''' + dist_repos + '''.''')
+
+ # Setup the parser for the create-tag subcommand
+ subparser = subparsers.add_parser('create-tag',
+ help='''Create the release tag.''')
+ subparser.set_defaults(func=create_tag)
+ subparser.add_argument('version', type=Version,
+ help='''The release label, such as '1.7.0-alpha1'.''')
+ subparser.add_argument('revnum', type=int,
+ help='''The revision number to base the release on.''')
+ subparser.add_argument('--branch',
+ help='''The branch to base the release on.''')
+ subparser.add_argument('--username',
+ help='''Username for ''' + secure_repos + '''.''')
# The clean-dist subcommand
subparser = subparsers.add_parser('clean-dist',
@@ -768,6 +822,8 @@ def main():
subparser.set_defaults(func=clean_dist)
subparser.add_argument('--dist-dir',
help='''The directory to clean.''')
+ subparser.add_argument('--username',
+ help='''Username for ''' + dist_repos + '''.''')
# The move-to-dist subcommand
subparser = subparsers.add_parser('move-to-dist',
@@ -777,6 +833,8 @@ def main():
subparser.set_defaults(func=move_to_dist)
subparser.add_argument('version', type=Version,
help='''The release label, such as '1.7.0-alpha1'.''')
+ subparser.add_argument('--username',
+ help='''Username for ''' + dist_repos + '''.''')
# The write-news subcommand
subparser = subparsers.add_parser('write-news',