You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/08/16 12:18:03 UTC
svn commit: r1373783 [47/50] - in /subversion/branches/compressed-pristines:
./ build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/emacs/ contrib/client-side/svn-push/
contrib/client-side/svnmerge/ cont...
Modified: subversion/branches/compressed-pristines/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/cmdline/update_tests.py?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/compressed-pristines/subversion/tests/cmdline/update_tests.py Thu Aug 16 10:17:48 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.
@@ -310,7 +310,6 @@ def update_binary_file_2(sbox):
#----------------------------------------------------------------------
-@XFail()
@Issue(4128)
def update_binary_file_3(sbox):
"update locally modified file to equal versions"
@@ -322,7 +321,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.
@@ -367,7 +366,7 @@ def update_binary_file_3(sbox):
# Create expected output tree for an update to rev 2.
expected_output = svntest.wc.State(wc_dir, {
- 'A/theta' : Item(status=' '),
+ 'A/theta' : Item(status='G '),
})
# Create expected disk tree for the update
@@ -403,10 +402,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 +459,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 +518,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 +565,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 +618,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 +728,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 +808,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 +885,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 +951,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 +1024,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 +1040,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 +1063,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 +1148,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 +1232,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 +1254,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 +1304,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 +1391,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 +1425,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 +1469,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 +1509,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 +1552,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 +1575,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 +1626,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 +1644,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 +1689,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 +1709,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 +1788,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 +1837,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 +1968,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 +2066,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 +2114,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 +2253,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 +2579,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 +2709,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 +2921,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 +2937,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 +3055,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 +3223,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 +3724,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 +3818,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')
@@ -3915,8 +3914,12 @@ def update_accept_conflicts(sbox):
# Accept the pre-update base file.
svntest.actions.run_and_verify_svn(None,
["Updating '%s':\n" % (mu_path_backup),
- 'G %s\n' % (mu_path_backup,),
- 'Updated to revision 2.\n'],
+ 'C %s\n' % (mu_path_backup,),
+ 'Updated to revision 2.\n',
+ 'Summary of conflicts:\n',
+ ' Text conflicts: 1\n',
+ "Resolved conflicted state of '%s'\n"
+ % (mu_path_backup)],
[],
'update', '--accept=base',
mu_path_backup)
@@ -3925,8 +3928,12 @@ def update_accept_conflicts(sbox):
# Accept the user's working file.
svntest.actions.run_and_verify_svn(None,
["Updating '%s':\n" % (alpha_path_backup),
- 'G %s\n' % (alpha_path_backup,),
- 'Updated to revision 2.\n'],
+ 'C %s\n' % (alpha_path_backup,),
+ 'Updated to revision 2.\n',
+ 'Summary of conflicts:\n',
+ ' Text conflicts: 1\n',
+ "Resolved conflicted state of '%s'\n"
+ % (alpha_path_backup)],
[],
'update', '--accept=mine-full',
alpha_path_backup)
@@ -3935,8 +3942,12 @@ def update_accept_conflicts(sbox):
# Accept their file.
svntest.actions.run_and_verify_svn(None,
["Updating '%s':\n" % (beta_path_backup),
- 'G %s\n' % (beta_path_backup,),
- 'Updated to revision 2.\n'],
+ 'C %s\n' % (beta_path_backup,),
+ 'Updated to revision 2.\n',
+ 'Summary of conflicts:\n',
+ ' Text conflicts: 1\n',
+ "Resolved conflicted state of '%s'\n"
+ % (beta_path_backup)],
[],
'update', '--accept=theirs-full',
beta_path_backup)
@@ -3947,8 +3958,12 @@ def update_accept_conflicts(sbox):
# svn to exit with an exit code of 0.
svntest.actions.run_and_verify_svn2(None,
["Updating '%s':\n" % (pi_path_backup),
- 'G %s\n' % (pi_path_backup,),
- 'Updated to revision 2.\n'],
+ 'C %s\n' % (pi_path_backup,),
+ 'Updated to revision 2.\n',
+ 'Summary of conflicts:\n',
+ ' Text conflicts: 1\n',
+ "Resolved conflicted state of '%s'\n"
+ % (pi_path_backup)],
"system(.*) returned.*", 0,
'update', '--accept=edit',
pi_path_backup)
@@ -4057,7 +4072,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")
@@ -4096,14 +4111,27 @@ interactive-conflicts = true
wc_dir, '--config-dir', config_dir)
# Now update -r1 again. Hopefully we don't get a checksum error!
- expected_output = svntest.wc.State(wc_dir, {})
+ expected_output = svntest.wc.State(wc_dir, {
+ 'iota': Item(verb="Skipped"),
+ })
+
+ # The interactive callback aborts, so the file remains in conflict.
+ expected_disk.tweak('iota', contents="This is the file 'iota'.\n"
+ "<<<<<<< .mine\n"
+ "Local mods to r1 text.\n"
+ "=======\n"
+ "Appended text in r2.\n"
+ ">>>>>>> .r2\n"),
+ expected_disk.add({
+ 'iota.r1' : Item(contents="This is the file 'iota'.\n"),
+ 'iota.r2' : Item(contents="This is the file 'iota'.\n"
+ "Appended text in r2.\n"),
+ 'iota.mine' : Item(contents="This is the file 'iota'.\n"
+ "Local mods to r1 text.\n"),
+ })
- # note: it's possible that the correct disk here should be the
- # merged file?
- expected_disk.tweak('iota', contents=("This is the file 'iota'.\n"
- "Local mods to r1 text.\n"))
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- expected_status.tweak('iota', status='M ')
+ expected_status.tweak('iota', status='C ', wc_rev=2)
svntest.actions.run_and_verify_update(wc_dir,
expected_output,
@@ -4155,7 +4183,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)
@@ -4421,7 +4449,7 @@ def tree_conflicts_on_update_1_2(sbox):
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .file.*/F/alpha@2'
- + ' Source right: .none.*/F/alpha@3$',
+ + ' Source right: .none.*(/F/alpha@3)?$',
},
'DF/D1' : {
'Tree conflict' :
@@ -4439,7 +4467,7 @@ def tree_conflicts_on_update_1_2(sbox):
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/D/D1@2'
- + ' Source right: .none.*/D/D1@3$',
+ + ' Source right: .none.*(/D/D1@3)?$',
},
'DD/D1' : {
'Tree conflict' :
@@ -4504,37 +4532,37 @@ def tree_conflicts_on_update_2_1(sbox):
'Tree conflict' :
'^local edit, incoming delete upon update'
+ ' Source left: .file.*/F/alpha@2'
- + ' Source right: .none.*/F/alpha@3$',
+ + ' Source right: .none.*(/F/alpha@3)?$',
},
'DF/D1' : {
'Tree conflict' :
'^local edit, incoming delete upon update'
+ ' Source left: .dir.*/DF/D1@2'
- + ' Source right: .none.*/DF/D1@3$',
+ + ' Source right: .none.*(/DF/D1@3)?$',
},
'DDF/D1' : {
'Tree conflict' :
'^local edit, incoming delete upon update'
+ ' Source left: .dir.*/DDF/D1@2'
- + ' Source right: .none.*/DDF/D1@3$',
+ + ' Source right: .none.*(/DDF/D1@3)?$',
},
'D/D1' : {
'Tree conflict' :
'^local edit, incoming delete upon update'
+ ' Source left: .dir.*/D/D1@2'
- + ' Source right: .none.*/D/D1@3$',
+ + ' Source right: .none.*(/D/D1@3)?$',
},
'DD/D1' : {
'Tree conflict' :
'^local edit, incoming delete upon update'
+ ' Source left: .dir.*/DD/D1@2'
- + ' Source right: .none.*/DD/D1@3$',
+ + ' Source right: .none.*(/DD/D1@3)?$',
},
'DDD/D1' : {
'Tree conflict' :
'^local edit, incoming delete upon update'
+ ' Source left: .dir.*/DDD/D1@2'
- + ' Source right: .none.*/DDD/D1@3$',
+ + ' Source right: .none.*(/DDD/D1@3)?$',
},
}
@@ -4612,37 +4640,37 @@ def tree_conflicts_on_update_2_2(sbox):
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .file.*/F/alpha@2'
- + ' Source right: .none.*/F/alpha@3$',
+ + ' Source right: .none.*(/F/alpha@3)?$',
},
'DF/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/DF/D1@2'
- + ' Source right: .none.*/DF/D1@3$',
+ + ' Source right: .none.*(/DF/D1@3)?$',
},
'DDF/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/DDF/D1@2'
- + ' Source right: .none.*/DDF/D1@3$',
+ + ' Source right: .none.*(/DDF/D1@3)?$',
},
'D/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/D/D1@2'
- + ' Source right: .none.*/D/D1@3$',
+ + ' Source right: .none.*(/D/D1@3)?$',
},
'DD/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/DD/D1@2'
- + ' Source right: .none.*/DD/D1@3$',
+ + ' Source right: .none.*(/DD/D1@3)?$',
},
'DDD/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/DDD/D1@2'
- + ' Source right: .none.*/DDD/D1@3$',
+ + ' Source right: .none.*(/DDD/D1@3)?$',
},
}
@@ -4774,37 +4802,37 @@ def tree_conflicts_on_update_3(sbox):
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .file.*/F/alpha@2'
- + ' Source right: .none.*/F/alpha@3$',
+ + ' Source right: .none.*(/F/alpha@3)?$',
},
'DF/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/DF/D1@2'
- + ' Source right: .none.*/DF/D1@3$',
+ + ' Source right: .none.*(/DF/D1@3)?$',
},
'DDF/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/DDF/D1@2'
- + ' Source right: .none.*/DDF/D1@3$',
+ + ' Source right: .none.*(/DDF/D1@3)?$',
},
'D/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/D/D1@2'
- + ' Source right: .none.*/D/D1@3$',
+ + ' Source right: .none.*(/D/D1@3)?$',
},
'DD/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/DD/D1@2'
- + ' Source right: .none.*/DD/D1@3$',
+ + ' Source right: .none.*(/DD/D1@3)?$',
},
'DDD/D1' : {
'Tree conflict' :
'^local delete, incoming delete upon update'
+ ' Source left: .dir.*/DDD/D1@2'
- + ' Source right: .none.*/DDD/D1@3$',
+ + ' Source right: .none.*(/DDD/D1@3)?$',
},
}
@@ -4846,7 +4874,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 +5107,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 +5301,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 +5354,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 +5392,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)
@@ -5492,6 +5520,7 @@ def update_to_HEAD_plus_1(sbox):
None, None,
None, None, None, wc_dir, '-r', '2')
+@XFail()
def update_moved_dir_leaf_del(sbox):
"update locally moved dir with leaf del"
sbox.build()
@@ -5526,6 +5555,7 @@ def update_moved_dir_leaf_del(sbox):
None, None, None,
None, None, 1)
+@XFail()
def update_moved_dir_edited_leaf_del(sbox):
"update locally moved dir with edited leaf del"
sbox.build()
@@ -5564,6 +5594,7 @@ def update_moved_dir_edited_leaf_del(sbo
None, None, None,
None, None, 1)
+@XFail()
def update_moved_dir_file_add(sbox):
"update locally moved dir with incoming file"
sbox.build()
@@ -5606,6 +5637,7 @@ def update_moved_dir_file_add(sbox):
None, None, None,
None, None, 1)
+@XFail()
def update_moved_dir_dir_add(sbox):
"update locally moved dir with incoming dir"
sbox.build()
@@ -5793,6 +5825,62 @@ def update_nested_move_text_mod(sbox):
None, None, None,
None, None, 1)
+def update_with_parents_and_exclude(sbox):
+ "bring a subtree in over an excluded path"
+
+ sbox.build(read_only = True)
+ wc_dir = sbox.wc_dir
+
+ # Now we are going to exclude A
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A' : Item(status='D '),
+ })
+
+ expected_status = svntest.wc.State(wc_dir, {
+ '' : Item(status=' ', wc_rev='1'),
+ 'iota' : Item(status=' ', wc_rev='1'),
+ })
+
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ None,
+ expected_status,
+ None, None, None,
+ None, None, False,
+ '--set-depth', 'exclude',
+ sbox.ospath('A'))
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A' : Item(status='A '),
+ 'A/B' : Item(status='A '),
+ 'A/B/F' : Item(status='A '),
+ 'A/B/E' : Item(status='A '),
+ 'A/B/E/beta' : Item(status='A '),
+ 'A/B/E/alpha' : Item(status='A '),
+ 'A/B/lambda' : Item(status='A '),
+ })
+
+ expected_status = svntest.wc.State(wc_dir, {
+ '' : Item(status=' ', wc_rev='1'),
+ 'A' : Item(status=' ', wc_rev='1'),
+ 'A/B' : Item(status=' ', wc_rev='1'),
+ 'A/B/F' : Item(status=' ', wc_rev='1'),
+ 'A/B/E' : Item(status=' ', wc_rev='1'),
+ 'A/B/E/beta' : Item(status=' ', wc_rev='1'),
+ 'A/B/E/alpha' : Item(status=' ', wc_rev='1'),
+ 'A/B/lambda' : Item(status=' ', wc_rev='1'),
+ 'iota' : Item(status=' ', wc_rev='1'),
+ })
+
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ None,
+ expected_status,
+ None, None, None,
+ None, None, False,
+ '--parents',
+ sbox.ospath('A/B'))
+
#######################################################################
# Run the tests
@@ -5868,6 +5956,7 @@ test_list = [ None,
update_binary_file_3,
update_move_text_mod,
update_nested_move_text_mod,
+ update_with_parents_and_exclude,
]
if __name__ == '__main__':
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_client/client-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_client/client-test.c Thu Aug 16 10:17:48 2012
@@ -33,6 +33,7 @@
#include "svn_client.h"
#include "svn_repos.h"
#include "svn_subst.h"
+#include "private/svn_wc_private.h"
#include "../svn_test.h"
#include "../svn_test_fs.h"
@@ -689,7 +690,7 @@ test_youngest_common_ancestor(const svn_
repos_url, repos_uuid, 2, "iota", pool),
svn_client__pathrev_create_with_relpath(
repos_url, repos_uuid, 2, "A/iota", pool),
- ctx, pool, pool));
+ NULL, ctx, pool, pool));
SVN_TEST_STRING_ASSERT(svn_client__pathrev_relpath(yc_ancestor, pool),
"iota");
SVN_TEST_ASSERT(yc_ancestor->rev == 1);
@@ -713,13 +714,95 @@ test_youngest_common_ancestor(const svn_
repos_url, repos_uuid, 0, "", pool),
svn_client__pathrev_create_with_relpath(
repos_url, repos_uuid, 3, "A/ROOT", pool),
- ctx, pool, pool));
+ NULL, ctx, pool, pool));
SVN_TEST_STRING_ASSERT(svn_client__pathrev_relpath(yc_ancestor, pool), "");
SVN_TEST_ASSERT(yc_ancestor->rev == 0);
return SVN_NO_ERROR;
}
+static svn_error_t *
+test_externals_parse(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+ int i;
+ struct external_info
+ {
+ const char *line;
+ const char *url;
+ const char *local_path;
+ svn_revnum_t peg_rev;
+ svn_revnum_t rev;
+
+ } items[] = {
+ {
+ "dir http://server/svn/a",
+ "http://server/svn/a",
+ "dir"
+ },
+ {
+ "/svn/home dir",
+ "u://svr/svn/home",
+ "dir"
+ },
+ {
+ "//server/home dir",
+ "u://server/home",
+ "dir"
+ },
+ {
+ "../../../../home dir",
+ "u://svr/svn/home",
+ "dir",
+ },
+ {
+ "^/../repB/tools/scripts scripts",
+ "u://svr/svn/cur/repB/tools/scripts",
+ "scripts"
+ },
+ {
+ "^/../repB/tools/README.txt scripts/README.txt",
+ "u://svr/svn/cur/repB/tools/README.txt",
+ "scripts/README.txt"
+ },
+ };
+
+
+ for (i = 0; i < sizeof(items) / sizeof(items[0]); i++)
+ {
+ apr_array_header_t *results;
+ svn_wc_external_item2_t *external_item;
+ const char *resolved_url;
+ SVN_ERR(svn_wc_parse_externals_description3(&results, "/my/current/dir",
+ items[i].line, FALSE, pool));
+
+ SVN_TEST_ASSERT(results && results->nelts == 1);
+
+ external_item = APR_ARRAY_IDX(results, 0, svn_wc_external_item2_t *);
+
+ SVN_ERR(svn_wc__resolve_relative_external_url(&resolved_url,
+ external_item,
+ "u://svr/svn/cur/dir",
+ "u://svr/svn/cur/dir/sd/fl",
+ pool, pool));
+
+ SVN_TEST_STRING_ASSERT(resolved_url, items[i].url);
+ SVN_TEST_STRING_ASSERT(external_item->target_dir, items[i].local_path);
+
+ if (items[i].peg_rev != 0)
+ SVN_TEST_ASSERT(external_item->peg_revision.value.number
+ == items[i].peg_rev);
+ if (items[i].rev != 0)
+ SVN_TEST_ASSERT(external_item->revision.value.number == items[i].rev);
+ SVN_TEST_ASSERT(svn_uri_is_canonical(resolved_url, pool));
+ }
+
+
+ return SVN_NO_ERROR;
+
+}
+
+
+
/* ========================================================================== */
@@ -737,5 +820,6 @@ struct svn_test_descriptor_t test_funcs[
SVN_TEST_OPTS_PASS(test_16k_add, "test adding 16k files"),
#endif
SVN_TEST_OPTS_PASS(test_youngest_common_ancestor, "test youngest_common_ancestor"),
+ SVN_TEST_OPTS_PASS(test_externals_parse, "test svn_wc_parse_externals_description3"),
SVN_TEST_NULL
};
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/random-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/random-test.c Thu Aug 16 10:17:48 2012
@@ -189,7 +189,7 @@ generate_random_file(apr_uint32_t maxlen
{
const int ch = (random_bytes
? (unsigned)random_bytes[r % bytes_range]
- : r % bytes_range);
+ : (int)(r % bytes_range));
if (buf == end)
{
apr_size_t ignore_length;
@@ -198,7 +198,7 @@ generate_random_file(apr_uint32_t maxlen
buf = file_buffer;
}
- *buf++ = ch;
+ *buf++ = (char)ch;
r = r * 1103515245 + 12345;
}
}
@@ -336,10 +336,11 @@ random_test(apr_pool_t *pool)
delta_pool);
/* Make stage 1: create the text delta. */
- svn_txdelta(&txdelta_stream,
- svn_stream_from_aprfile(source, delta_pool),
- svn_stream_from_aprfile(target, delta_pool),
- delta_pool);
+ svn_txdelta2(&txdelta_stream,
+ svn_stream_from_aprfile(source, delta_pool),
+ svn_stream_from_aprfile(target, delta_pool),
+ FALSE,
+ delta_pool);
SVN_ERR(svn_txdelta_send_txstream(txdelta_stream,
handler,
@@ -421,15 +422,17 @@ do_random_combine_test(apr_pool_t *pool,
/* Make stage 1: create the text deltas. */
- svn_txdelta(&txdelta_stream_A,
- svn_stream_from_aprfile(source, delta_pool),
- svn_stream_from_aprfile(middle, delta_pool),
- delta_pool);
-
- svn_txdelta(&txdelta_stream_B,
- svn_stream_from_aprfile(middle_copy, delta_pool),
- svn_stream_from_aprfile(target, delta_pool),
- delta_pool);
+ svn_txdelta2(&txdelta_stream_A,
+ svn_stream_from_aprfile(source, delta_pool),
+ svn_stream_from_aprfile(middle, delta_pool),
+ FALSE,
+ delta_pool);
+
+ svn_txdelta2(&txdelta_stream_B,
+ svn_stream_from_aprfile(middle_copy, delta_pool),
+ svn_stream_from_aprfile(target, delta_pool),
+ FALSE,
+ delta_pool);
{
svn_txdelta_window_t *window_A;
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/svndiff-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/svndiff-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/svndiff-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/svndiff-test.c Thu Aug 16 10:17:48 2012
@@ -75,10 +75,11 @@ main(int argc, char **argv)
if (argc == 4)
version = atoi(argv[3]);
- svn_txdelta(&txdelta_stream,
- svn_stream_from_aprfile(source_file, pool),
- svn_stream_from_aprfile(target_file, pool),
- pool);
+ svn_txdelta2(&txdelta_stream,
+ svn_stream_from_aprfile(source_file, pool),
+ svn_stream_from_aprfile(target_file, pool),
+ FALSE,
+ pool);
err = svn_stream_for_stdout(&stdout_stream, pool);
if (err)
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/vdelta-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/vdelta-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/vdelta-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/vdelta-test.c Thu Aug 16 10:17:48 2012
@@ -28,6 +28,7 @@
#include "../svn_test.h"
+#include "svn_ctype.h"
#include "svn_delta.h"
#include "svn_error.h"
#include "svn_pools.h"
@@ -59,10 +60,11 @@ do_one_diff(apr_file_t *source_file, apr
*count = 0;
*len = 0;
- svn_txdelta(&delta_stream,
- svn_stream_from_aprfile(source_file, fpool),
- svn_stream_from_aprfile(target_file, fpool),
- fpool);
+ svn_txdelta2(&delta_stream,
+ svn_stream_from_aprfile(source_file, fpool),
+ svn_stream_from_aprfile(target_file, fpool),
+ FALSE,
+ fpool);
do {
svn_error_t *err;
err = svn_txdelta_next_window(&delta_window, delta_stream, wpool);
@@ -82,75 +84,17 @@ do_one_diff(apr_file_t *source_file, apr
}
-static apr_file_t *
-open_binary_read(const char *path, apr_pool_t *pool)
-{
- apr_status_t apr_err;
- apr_file_t *fp;
-
- apr_err = apr_file_open(&fp, path, (APR_READ | APR_BINARY),
- APR_OS_DEFAULT, pool);
-
- if (apr_err)
- {
- fprintf(stderr, "unable to open \"%s\" for reading\n", path);
- exit(1);
- }
-
- return fp;
-}
-
-
-int
-main(int argc, char **argv)
+static void
+do_one_test_cycle(apr_file_t *source_file_A, apr_file_t *target_file_A,
+ apr_file_t *source_file_B, apr_file_t *target_file_B,
+ int quiet, apr_pool_t *pool)
{
- apr_file_t *source_file_A = NULL;
- apr_file_t *target_file_A = NULL;
int count_A = 0;
apr_off_t len_A = 0;
- apr_file_t *source_file_B = NULL;
- apr_file_t *target_file_B = NULL;
int count_B = 0;
apr_off_t len_B = 0;
- apr_pool_t *pool;
- int quiet = 0;
-
- if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'q')
- {
- quiet = 1;
- --argc; ++argv;
- }
-
- apr_initialize();
- pool = svn_pool_create(NULL);
-
- if (argc == 2)
- {
- target_file_A = open_binary_read(argv[1], pool);
- }
- else if (argc == 3)
- {
- source_file_A = open_binary_read(argv[1], pool);
- target_file_A = open_binary_read(argv[2], pool);
- }
- else if (argc == 4)
- {
- source_file_A = open_binary_read(argv[1], pool);
- target_file_A = open_binary_read(argv[2], pool);
- source_file_B = open_binary_read(argv[2], pool);
- target_file_B = open_binary_read(argv[3], pool);
- }
- else
- {
- fprintf(stderr,
- "Usage: vdelta-test [-q] <target>\n"
- " or: vdelta-test [-q] <source> <target>\n"
- " or: vdelta-test [-q] <source> <intermediate> <target>\n");
- exit(1);
- }
-
do_one_diff(source_file_A, target_file_A,
&count_A, &len_A, quiet, pool, "A ", stdout);
@@ -181,14 +125,16 @@ main(int argc, char **argv)
apr_file_seek(target_file_B, APR_SET, &offset);
}
- svn_txdelta(&stream_A,
- svn_stream_from_aprfile(source_file_A, fpool),
- svn_stream_from_aprfile(target_file_A, fpool),
- fpool);
- svn_txdelta(&stream_B,
- svn_stream_from_aprfile(source_file_B, fpool),
- svn_stream_from_aprfile(target_file_B, fpool),
- fpool);
+ svn_txdelta2(&stream_A,
+ svn_stream_from_aprfile(source_file_A, fpool),
+ svn_stream_from_aprfile(target_file_A, fpool),
+ FALSE,
+ fpool);
+ svn_txdelta2(&stream_B,
+ svn_stream_from_aprfile(source_file_B, fpool),
+ svn_stream_from_aprfile(target_file_B, fpool),
+ FALSE,
+ fpool);
for (count_AB = 0; count_AB < count_B; ++count_AB)
{
@@ -219,6 +165,98 @@ main(int argc, char **argv)
fprintf(stdout, "AB: (LENGTH %" APR_OFF_T_FMT " +%d)\n",
len_AB, count_AB);
}
+}
+
+
+static apr_file_t *
+open_binary_read(const char *path, apr_pool_t *pool)
+{
+ apr_status_t apr_err;
+ apr_file_t *fp;
+
+ apr_err = apr_file_open(&fp, path, (APR_READ | APR_BINARY),
+ APR_OS_DEFAULT, pool);
+
+ if (apr_err)
+ {
+ fprintf(stderr, "unable to open \"%s\" for reading\n", path);
+ exit(1);
+ }
+
+ return fp;
+}
+
+
+int
+main(int argc, char **argv)
+{
+ apr_file_t *source_file_A = NULL;
+ apr_file_t *target_file_A = NULL;
+
+ apr_file_t *source_file_B = NULL;
+ apr_file_t *target_file_B = NULL;
+
+ apr_pool_t *pool;
+ int quiet = 0;
+ int repeat = 1;
+
+ while (argc > 1)
+ {
+ const char *const arg = argv[1];
+ if (arg[0] != '-')
+ break;
+
+ if (arg[1] == 'q')
+ quiet = 1;
+ else if (svn_ctype_isdigit(arg[1]))
+ repeat = atoi(arg + 1);
+ else
+ break;
+ --argc; ++argv;
+ }
+
+ apr_initialize();
+ pool = svn_pool_create(NULL);
+
+ if (argc == 2)
+ {
+ target_file_A = open_binary_read(argv[1], pool);
+ }
+ else if (argc == 3)
+ {
+ source_file_A = open_binary_read(argv[1], pool);
+ target_file_A = open_binary_read(argv[2], pool);
+ }
+ else if (argc == 4)
+ {
+ source_file_A = open_binary_read(argv[1], pool);
+ target_file_A = open_binary_read(argv[2], pool);
+ source_file_B = open_binary_read(argv[2], pool);
+ target_file_B = open_binary_read(argv[3], pool);
+ }
+ else
+ {
+ fprintf(stderr,
+ "Usage: vdelta-test [-q] [-<repeat>] <target>\n"
+ " or: vdelta-test [-q] [-<repeat>] <source> <target>\n"
+ " or: vdelta-test [-q] [-<repeat>] "
+ "<source> <intermediate> <target>\n");
+ exit(1);
+ }
+
+ while (0 < repeat--)
+ {
+ apr_off_t offset = 0;
+
+ do_one_test_cycle(source_file_A, target_file_A,
+ source_file_B, target_file_B,
+ quiet, pool);
+
+ if (source_file_A) apr_file_seek(source_file_A, APR_SET, &offset);
+ if (target_file_A) apr_file_seek(target_file_A, APR_SET, &offset);
+ if (source_file_B) apr_file_seek(source_file_B, APR_SET, &offset);
+ if (target_file_B) apr_file_seek(target_file_B, APR_SET, &offset);
+ }
if (source_file_A) apr_file_close(source_file_A);
if (target_file_A) apr_file_close(target_file_A);
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/window-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/window-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/window-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_delta/window-test.c Thu Aug 16 10:17:48 2012
@@ -29,6 +29,7 @@
#include "svn_error.h"
#include "svn_delta.h"
+#include "private/svn_subr_private.h"
static svn_error_t *
stream_window_test(apr_pool_t *pool)
@@ -69,7 +70,7 @@ stream_window_test(apr_pool_t *pool)
target_str.len = 109000;
target_stream = svn_stream_from_string(&target_str, pool);
- svn_txdelta(&txstream, source_stream, target_stream, pool);
+ svn_txdelta2(&txstream, source_stream, target_stream, TRUE, pool);
while (1)
{
@@ -82,8 +83,8 @@ stream_window_test(apr_pool_t *pool)
/* ### examine the window */
}
- actual = svn_checksum__from_digest(svn_txdelta_md5_digest(txstream),
- svn_checksum_md5, pool);
+ actual = svn_checksum__from_digest_md5(svn_txdelta_md5_digest(txstream),
+ pool);
printf(" actual: %s\n", svn_checksum_to_cstring(actual, pool));
if (!svn_checksum_match(expected, actual))
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_diff/diff-diff3-test.c Thu Aug 16 10:17:48 2012
@@ -2405,7 +2405,7 @@ test_wrap(apr_pool_t *pool)
char rdata[(1<<17) + 4+3+3+1];
svn_string_t left, right;
svn_diff_file_options_t *diff_opts = svn_diff_file_options_create(pool);
- diff_opts->ignore_space = TRUE;
+ diff_opts->ignore_space = svn_diff_file_ignore_space_change;
/* Two long lines. */
memset(ldata, '@', 1<<17);
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_fs/locks-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_fs/locks-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_fs/locks-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_fs/locks-test.c Thu Aug 16 10:17:48 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/compressed-pristines/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_fs_fs/fs-pack-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_fs_fs/fs-pack-test.c Thu Aug 16 10:17:48 2012
@@ -30,6 +30,7 @@
#include "svn_pools.h"
#include "svn_props.h"
#include "svn_fs.h"
+#include "private/svn_string_private.h"
#include "../svn_test_fs.h"
@@ -199,6 +200,77 @@ create_packed_filesystem(const char *dir
return svn_fs_pack(dir, pack_notify, &pnb, NULL, NULL, pool);
}
+/* Create a packed FSFS filesystem for revprop tests at REPO_NAME with
+ * MAX_REV revisions and the given SHARD_SIZE and OPTS. Return it in *FS.
+ * Use POOL for allocations.
+ */
+static svn_error_t *
+prepare_revprop_repo(svn_fs_t **fs,
+ const char *repo_name,
+ int max_rev,
+ int shard_size,
+ const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *txn_root;
+ const char *conflict;
+ svn_revnum_t after_rev;
+ apr_pool_t *subpool;
+
+ /* Create the packed FS and open it. */
+ SVN_ERR(create_packed_filesystem(repo_name, opts, max_rev, shard_size, pool));
+ SVN_ERR(svn_fs_open(fs, repo_name, NULL, pool));
+
+ subpool = svn_pool_create(pool);
+ /* Do a commit to trigger packing. */
+ SVN_ERR(svn_fs_begin_txn(&txn, *fs, max_rev, subpool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
+ SVN_ERR(svn_test__set_file_contents(txn_root, "iota", "new-iota", subpool));
+ SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, subpool));
+ SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(after_rev));
+ svn_pool_destroy(subpool);
+
+ /* Pack the repository. */
+ SVN_ERR(svn_fs_pack(repo_name, NULL, NULL, NULL, NULL, pool));
+
+ return SVN_NO_ERROR;
+}
+
+/* For revision REV, return a short log message allocated in POOL.
+ */
+static svn_string_t *
+default_log(svn_revnum_t rev, apr_pool_t *pool)
+{
+ return svn_string_createf(pool, "Default message for rev %ld", rev);
+}
+
+/* For revision REV, return a long log message allocated in POOL.
+ */
+static svn_string_t *
+large_log(svn_revnum_t rev, apr_size_t length, apr_pool_t *pool)
+{
+ svn_stringbuf_t *temp = svn_stringbuf_create_ensure(100000, pool);
+ int i, count = (int)(length - 50) / 6;
+
+ svn_stringbuf_appendcstr(temp, "A ");
+ for (i = 0; i < count; ++i)
+ svn_stringbuf_appendcstr(temp, "very, ");
+
+ svn_stringbuf_appendcstr(temp,
+ apr_psprintf(pool, "very long message for rev %ld, indeed", rev));
+
+ return svn_stringbuf__morph_into_string(temp);
+}
+
+/* For revision REV, return a long log message allocated in POOL.
+ */
+static svn_string_t *
+huge_log(svn_revnum_t rev, apr_pool_t *pool)
+{
+ return large_log(rev, 90000, pool);
+}
+
/*** Tests ***/
@@ -404,18 +476,13 @@ commit_packed_fs(const svn_test_opts_t *
/* ------------------------------------------------------------------------ */
#define REPO_NAME "test-repo-get-set-revprop-packed-fs"
#define SHARD_SIZE 4
-#define MAX_REV 1
+#define MAX_REV 10
static svn_error_t *
get_set_revprop_packed_fs(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 after_rev;
svn_string_t *prop_value;
- apr_pool_t *subpool;
/* Bail (with success) on known-untestable scenarios */
if ((strcmp(opts->fs_type, "fsfs") != 0)
@@ -423,30 +490,179 @@ get_set_revprop_packed_fs(const svn_test
return SVN_NO_ERROR;
/* Create the packed FS and open it. */
- SVN_ERR(create_packed_filesystem(REPO_NAME, opts, MAX_REV, SHARD_SIZE, pool));
- SVN_ERR(svn_fs_open(&fs, REPO_NAME, NULL, pool));
-
- subpool = svn_pool_create(pool);
- /* Do a commit to trigger packing. */
- SVN_ERR(svn_fs_begin_txn(&txn, fs, MAX_REV, subpool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
- SVN_ERR(svn_test__set_file_contents(txn_root, "iota", "new-iota", subpool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, subpool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(after_rev));
- svn_pool_clear(subpool);
-
- /* Pack the repository. */
- SVN_ERR(svn_fs_pack(REPO_NAME, NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+ pool));
- /* Try to get revprop for revision 0. */
+ /* Try to get revprop for revision 0
+ * (non-packed due to special handling). */
SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 0, SVN_PROP_REVISION_AUTHOR,
pool));
- /* Try to change revprop for revision 0. */
+ /* Try to change revprop for revision 0
+ * (non-packed due to special handling). */
SVN_ERR(svn_fs_change_rev_prop(fs, 0, SVN_PROP_REVISION_AUTHOR,
svn_string_create("tweaked-author", pool),
pool));
+ /* verify */
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 0, SVN_PROP_REVISION_AUTHOR,
+ pool));
+ SVN_TEST_STRING_ASSERT(prop_value->data, "tweaked-author");
+
+ /* Try to get packed revprop for revision 5. */
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 5, SVN_PROP_REVISION_AUTHOR,
+ pool));
+
+ /* Try to change packed revprop for revision 5. */
+ SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_AUTHOR,
+ svn_string_create("tweaked-author2", pool),
+ pool));
+
+ /* verify */
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 5, SVN_PROP_REVISION_AUTHOR,
+ pool));
+ SVN_TEST_STRING_ASSERT(prop_value->data, "tweaked-author2");
+
+ return SVN_NO_ERROR;
+}
+#undef REPO_NAME
+#undef MAX_REV
+#undef SHARD_SIZE
+
+/* ------------------------------------------------------------------------ */
+#define REPO_NAME "test-repo-get-set-large-revprop-packed-fs"
+#define SHARD_SIZE 4
+#define MAX_REV 11
+static svn_error_t *
+get_set_large_revprop_packed_fs(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_string_t *prop_value;
+ svn_revnum_t rev;
+
+ /* Bail (with success) on known-untestable scenarios */
+ if ((strcmp(opts->fs_type, "fsfs") != 0)
+ || (opts->server_minor_version && (opts->server_minor_version < 7)))
+ return SVN_NO_ERROR;
+
+ /* Create the packed FS and open it. */
+ SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+ pool));
+
+ /* Set commit messages to different, large values that fill the pack
+ * files but do not exceed the pack size limit. */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ SVN_ERR(svn_fs_change_rev_prop(fs, rev, SVN_PROP_REVISION_LOG,
+ large_log(rev, 15000, pool),
+ pool));
+
+ /* verify */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ {
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+ SVN_PROP_REVISION_LOG, pool));
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ large_log(rev, 15000, pool)->data);
+ }
+
+ /* Put a larger revprop into the last, some middle and the first revision
+ * of a pack. This should cause the packs to split in the middle. */
+ SVN_ERR(svn_fs_change_rev_prop(fs, 3, SVN_PROP_REVISION_LOG,
+ /* rev 0 is not packed */
+ large_log(3, 37000, pool),
+ pool));
+ SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_LOG,
+ large_log(5, 25000, pool),
+ pool));
+ SVN_ERR(svn_fs_change_rev_prop(fs, 8, SVN_PROP_REVISION_LOG,
+ large_log(8, 25000, pool),
+ pool));
+
+ /* verify */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ {
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+ SVN_PROP_REVISION_LOG, pool));
+
+ if (rev == 3)
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ large_log(rev, 37000, pool)->data);
+ else if (rev == 5 || rev == 8)
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ large_log(rev, 25000, pool)->data);
+ else
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ large_log(rev, 15000, pool)->data);
+ }
+
+ return SVN_NO_ERROR;
+}
+#undef REPO_NAME
+#undef MAX_REV
+#undef SHARD_SIZE
+
+/* ------------------------------------------------------------------------ */
+#define REPO_NAME "test-repo-get-set-huge-revprop-packed-fs"
+#define SHARD_SIZE 4
+#define MAX_REV 10
+static svn_error_t *
+get_set_huge_revprop_packed_fs(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_string_t *prop_value;
+ svn_revnum_t rev;
+
+ /* Bail (with success) on known-untestable scenarios */
+ if ((strcmp(opts->fs_type, "fsfs") != 0)
+ || (opts->server_minor_version && (opts->server_minor_version < 7)))
+ return SVN_NO_ERROR;
+
+ /* Create the packed FS and open it. */
+ SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+ pool));
+
+ /* Set commit messages to different values */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ SVN_ERR(svn_fs_change_rev_prop(fs, rev, SVN_PROP_REVISION_LOG,
+ default_log(rev, pool),
+ pool));
+
+ /* verify */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ {
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+ SVN_PROP_REVISION_LOG, pool));
+ SVN_TEST_STRING_ASSERT(prop_value->data, default_log(rev, pool)->data);
+ }
+
+ /* Put a huge revprop into the last, some middle and the first revision
+ * of a pack. They will cause the pack files to split accordingly. */
+ SVN_ERR(svn_fs_change_rev_prop(fs, 3, SVN_PROP_REVISION_LOG,
+ huge_log(3, pool),
+ pool));
+ SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_LOG,
+ huge_log(5, pool),
+ pool));
+ SVN_ERR(svn_fs_change_rev_prop(fs, 8, SVN_PROP_REVISION_LOG,
+ huge_log(8, pool),
+ pool));
+
+ /* verify */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ {
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+ SVN_PROP_REVISION_LOG, pool));
+
+ if (rev == 3 || rev == 5 || rev == 8)
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ huge_log(rev, pool)->data);
+ else
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ default_log(rev, pool)->data);
+ }
+
return SVN_NO_ERROR;
}
#undef REPO_NAME
@@ -533,6 +749,10 @@ struct svn_test_descriptor_t test_funcs[
"commit to a packed FSFS filesystem"),
SVN_TEST_OPTS_PASS(get_set_revprop_packed_fs,
"get/set revprop while packing FSFS filesystem"),
+ SVN_TEST_OPTS_PASS(get_set_large_revprop_packed_fs,
+ "get/set large packed revprops in FSFS"),
+ SVN_TEST_OPTS_PASS(get_set_huge_revprop_packed_fs,
+ "get/set huge packed revprops in FSFS"),
SVN_TEST_OPTS_PASS(recover_fully_packed,
"recover a fully packed filesystem"),
SVN_TEST_NULL
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_repos/repos-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_repos/repos-test.c Thu Aug 16 10:17:48 2012
@@ -1318,9 +1318,8 @@ authz(apr_pool_t *pool)
contents =
"[greek:/dir2//secret]" NL
"* =" NL;
- err = authz_get_handle(&authz_cfg, contents, subpool);
- SVN_TEST_ASSERT_ERROR(err, SVN_ERR_AUTHZ_INVALID_CONFIG);
- svn_error_clear(err);
+ SVN_TEST_ASSERT_ERROR(authz_get_handle(&authz_cfg, contents, subpool),
+ SVN_ERR_AUTHZ_INVALID_CONFIG);
/* That's a wrap! */
svn_pool_destroy(subpool);
@@ -1480,10 +1479,7 @@ test_path_authz(svn_repos_t *repos,
/* Check for potential errors. */
if (path_action->authz_error_expected)
- {
- SVN_TEST_ASSERT_ERROR(err, SVN_ERR_AUTHZ_UNWRITABLE);
- svn_error_clear(err);
- }
+ SVN_TEST_ASSERT_ERROR(err, SVN_ERR_AUTHZ_UNWRITABLE);
else
SVN_ERR(err);
@@ -2260,7 +2256,7 @@ prop_validation(const svn_test_opts_t *o
{
svn_error_t *err;
svn_repos_t *repos;
- const char non_utf8_string[5] = { 'a', 0xff, 'b', '\n', 0 };
+ const char non_utf8_string[5] = { 'a', (char)0xff, 'b', '\n', 0 };
const char *non_lf_string = "a\r\nb\n\rc\rd\n";
apr_pool_t *subpool = svn_pool_create(pool);
Propchange: subversion/branches/compressed-pristines/subversion/tests/libsvn_subr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Aug 16 10:17:48 2012
@@ -36,3 +36,7 @@ auth-test
eol-test
subst_translate-test
spillbuf-test
+named_atomic-test
+named_atomic-proc-test
+io-test
+io-test-temp
Modified: subversion/branches/compressed-pristines/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/libsvn_subr/dirent_uri-test.c Thu Aug 16 10:17:48 2012
@@ -670,6 +670,7 @@ test_dirent_canonicalize(apr_pool_t *poo
{ "foo/../", "foo/.." },
{ "foo/../.", "foo/.." },
{ "foo//.//bar", "foo/bar" },
+ { "//foo", "/foo" },
{ "///foo", "/foo" },
{ "/.//./.foo", "/.foo" },
{ ".///.foo", ".foo" },
@@ -743,6 +744,7 @@ test_relpath_canonicalize(apr_pool_t *po
{ "foo/../", "foo/.." },
{ "foo/../.", "foo/.." },
{ "foo//.//bar", "foo/bar" },
+ { "//foo", "foo" },
{ "///foo", "foo" },
{ "/.//./.foo", ".foo" },
{ ".///.foo", ".foo" },
@@ -882,6 +884,8 @@ static const testcase_canonicalize_t uri
{ "https://SERVER:80/", "https://server:80" },
{ "svn://server:80", "svn://server:80" },
{ "svn://SERVER:443/", "svn://server:443" },
+ { "file:///C%7C/temp/REPOS", "file:///C%7C/temp/REPOS" },
+ { "file:///C|/temp/REPOS", "file:///C%7C/temp/REPOS" },
#ifdef SVN_USE_DOS_PATHS
{ "file:///c:/temp/repos", "file:///C:/temp/repos" },
{ "file:///c:/temp/REPOS", "file:///C:/temp/REPOS" },
@@ -917,6 +921,7 @@ static const testcase_canonicalize_t uri
{ "foo/../", NULL },
{ "foo/../.", NULL },
{ "foo//.//bar", NULL },
+ { "//foo", NULL },
{ "///foo", NULL },
{ "/.//./.foo", NULL },
{ ".///.foo", NULL },
@@ -1004,6 +1009,7 @@ test_dirent_is_canonical(apr_pool_t *poo
{ "foo/../", FALSE },
{ "foo/../.", FALSE },
{ "foo//.//bar", FALSE },
+ { "//foo", FALSE },
{ "///foo", FALSE },
{ "/.//./.foo", FALSE },
{ ".///.foo", FALSE },
@@ -1104,6 +1110,7 @@ test_relpath_is_canonical(apr_pool_t *po
{ "foo/../", FALSE },
{ "foo/../.", FALSE },
{ "foo//.//bar", FALSE },
+ { "//foo", FALSE },
{ "///foo", FALSE },
{ "/.//./.foo", FALSE },
{ ".///.foo", FALSE },
@@ -2017,15 +2024,34 @@ test_dirent_condense_targets(apr_pool_t
const char* common;
apr_array_header_t *hdr = apr_array_make(pool, 8, sizeof(const char*));
apr_array_header_t *condensed;
+ svn_boolean_t skip = FALSE;
for (j = 0; j < COUNT_OF(tests[i].paths); j++)
{
if (tests[i].paths[j] != NULL)
- APR_ARRAY_PUSH(hdr, const char*) = tests[i].paths[j];
+ {
+ APR_ARRAY_PUSH(hdr, const char*) = tests[i].paths[j];
+#ifdef SVN_USE_DOS_PATHS
+ /* For tests that are referencing a D: drive, specifically test
+ if such a drive exists on the system. If not, skip the test
+ (svn_dirent_condense_targets will fail, because
+ apr_filepath_merge will produce an APR_EBADPATH error). */
+ if (strncmp(tests[i].paths[j], "D:", 2) == 0
+ && GetDriveType("D:\\") == DRIVE_NO_ROOT_DIR)
+ {
+ /* There is no D: drive, skip this. */
+ skip = TRUE;
+ break;
+ }
+#endif
+ }
else
break;
}
+ if (skip)
+ continue;
+
SVN_ERR(svn_dirent_condense_targets(&common, &condensed, hdr,
FALSE, pool, pool));