You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/06/26 21:28:22 UTC
svn commit: r1354186 [29/33] - in /subversion/branches/inheritable-props: ./
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/directory-i...
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/externals_tests.py?rev=1354186&r1=1354185&r2=1354186&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/externals_tests.py Tue Jun 26 19:26:49 2012
@@ -275,24 +275,24 @@ def checkout_with_externals(sbox):
# Probe the working copy a bit, see if it's as expected.
expected_existing_paths = [
- os.path.join(wc_dir, "A", "B", "gamma"),
- os.path.join(wc_dir, "A", "C", "exdir_G"),
- os.path.join(wc_dir, "A", "C", "exdir_G", "pi"),
- os.path.join(wc_dir, "A", "C", "exdir_H"),
- os.path.join(wc_dir, "A", "C", "exdir_H", "omega"),
- os.path.join(wc_dir, "A", "D", "x"),
- os.path.join(wc_dir, "A", "D", "x", "y"),
- os.path.join(wc_dir, "A", "D", "x", "y", "z"),
- os.path.join(wc_dir, "A", "D", "x", "y", "z", "blah"),
- os.path.join(wc_dir, "A", "D", "x", "y", "z", "blah", "E", "alpha"),
- os.path.join(wc_dir, "A", "D", "x", "y", "z", "blah", "E", "beta"),
+ sbox.ospath('A/B/gamma'),
+ sbox.ospath('A/C/exdir_G'),
+ sbox.ospath('A/C/exdir_G/pi'),
+ sbox.ospath('A/C/exdir_H'),
+ sbox.ospath('A/C/exdir_H/omega'),
+ sbox.ospath('A/D/x'),
+ sbox.ospath('A/D/x/y'),
+ sbox.ospath('A/D/x/y/z'),
+ sbox.ospath('A/D/x/y/z/blah'),
+ sbox.ospath('A/D/x/y/z/blah/E/alpha'),
+ sbox.ospath('A/D/x/y/z/blah/E/beta'),
]
probe_paths_exist(expected_existing_paths)
# Pick a file at random, make sure it has the expected contents.
- for path, contents in ((os.path.join(wc_dir, "A", "C", "exdir_H", "omega"),
+ for path, contents in ((sbox.ospath('A/C/exdir_H/omega'),
"This is the file 'omega'.\n"),
- (os.path.join(wc_dir, "A", "B", "gamma"),
+ (sbox.ospath('A/B/gamma'),
"This is the file 'gamma'.\n")):
if open(path).read() != contents:
raise svntest.Failure("Unexpected contents for rev 1 of " + path)
@@ -333,7 +333,7 @@ def update_receive_new_external(sbox):
"\n"
# Set and commit the property
- change_external(os.path.join(wc_dir, "A/D"), new_externals_desc)
+ change_external(sbox.ospath('A/D'), new_externals_desc)
# Update the other working copy, see if we get the new item.
expected_output = svntest.wc.State(other_wc_dir, {
@@ -391,7 +391,7 @@ def update_lose_external(sbox):
"\n"
# Set and commit the property
- change_external(os.path.join(wc_dir, "A/D"), new_externals_desc)
+ change_external(sbox.ospath('A/D'), new_externals_desc)
# The code should handle a missing local externals item
svntest.main.safe_rmtree(os.path.join(other_wc_dir, "A", "D", "exdir_A", \
@@ -455,7 +455,7 @@ def update_change_pristine_external(sbox
"\n"
# Set and commit the property
- change_external(os.path.join(wc_dir, "A/D"), new_externals_desc)
+ change_external(sbox.ospath('A/D'), new_externals_desc)
# Update other working copy, see if get the right change.
expected_output = svntest.wc.State(other_wc_dir, {
@@ -516,7 +516,7 @@ def update_change_modified_external(sbox
"\n"
# Set and commit the property
- change_external(os.path.join(wc_dir, "A/D"), new_externals_desc)
+ change_external(sbox.ospath('A/D'), new_externals_desc)
# Update other working copy, see if get the right change.
expected_output = svntest.wc.State(other_wc_dir, {
@@ -584,7 +584,7 @@ def update_receive_change_under_external
svntest.actions.run_and_verify_update(wc_dir,
expected_output, None, None)
- external_gamma_path = os.path.join(wc_dir, 'A', 'D', 'exdir_A', 'D', 'gamma')
+ external_gamma_path = sbox.ospath('A/D/exdir_A/D/gamma')
contents = open(external_gamma_path).read()
if contents != ("This is the file 'gamma'.\n"
"New text in other gamma.\n"):
@@ -612,7 +612,7 @@ def update_receive_change_under_external
svntest.actions.run_and_verify_update(sbox.ospath('A/C'),
expected_output, None, None)
- external_rho_path = os.path.join(wc_dir, 'A', 'C', 'exdir_G', 'rho')
+ external_rho_path = sbox.ospath('A/C/exdir_G/rho')
contents = open(external_rho_path).read()
if contents != ("This is the file 'rho'.\n"
"New text in other rho.\n"):
@@ -634,7 +634,7 @@ def modify_and_update_receive_new_extern
repo_url, wc_dir)
# Add one more external item
- B_path = os.path.join(wc_dir, "A/B")
+ B_path = sbox.ospath('A/B')
externals_desc = \
external_url_for["A/D/exdir_A/G/"] + " exdir_G" + \
"\n" + \
@@ -678,11 +678,11 @@ def disallow_dot_or_dotdot_directory_ref
"'.*' is an absolute path or involves '..'.*"
change_external_expect_error(path, val, expected_err)
- B_path = os.path.join(wc_dir, 'A', 'B')
- G_path = os.path.join(wc_dir, 'A', 'D', 'G')
- H_path = os.path.join(wc_dir, 'A', 'D', 'H')
- C_path = os.path.join(wc_dir, 'A', 'C')
- F_path = os.path.join(wc_dir, 'A', 'B', 'F')
+ B_path = sbox.ospath('A/B')
+ G_path = sbox.ospath('A/D/G')
+ H_path = sbox.ospath('A/D/H')
+ C_path = sbox.ospath('A/C')
+ F_path = sbox.ospath('A/B/F')
external_urls = list(external_url_for.values())
@@ -745,28 +745,28 @@ def export_with_externals(sbox):
# Probe the working copy a bit, see if it's as expected.
expected_existing_paths = [
- os.path.join(wc_dir, "A", "C", "exdir_G"),
- os.path.join(wc_dir, "A", "C", "exdir_G", "pi"),
- os.path.join(wc_dir, "A", "C", "exdir_H"),
- os.path.join(wc_dir, "A", "C", "exdir_H", "omega"),
- os.path.join(wc_dir, "A", "D", "x"),
- os.path.join(wc_dir, "A", "D", "x", "y"),
- os.path.join(wc_dir, "A", "D", "x", "y", "z"),
- os.path.join(wc_dir, "A", "D", "x", "y", "z", "blah"),
- os.path.join(wc_dir, "A", "D", "x", "y", "z", "blah", "E", "alpha"),
- os.path.join(wc_dir, "A", "D", "x", "y", "z", "blah", "E", "beta"),
+ sbox.ospath('A/C/exdir_G'),
+ sbox.ospath('A/C/exdir_G/pi'),
+ sbox.ospath('A/C/exdir_H'),
+ sbox.ospath('A/C/exdir_H/omega'),
+ sbox.ospath('A/D/x'),
+ sbox.ospath('A/D/x/y'),
+ sbox.ospath('A/D/x/y/z'),
+ sbox.ospath('A/D/x/y/z/blah'),
+ sbox.ospath('A/D/x/y/z/blah/E/alpha'),
+ sbox.ospath('A/D/x/y/z/blah/E/beta'),
]
probe_paths_exist(expected_existing_paths)
# Pick some files, make sure their contents are as expected.
- exdir_G_pi_path = os.path.join(wc_dir, "A", "C", "exdir_G", "pi")
+ exdir_G_pi_path = sbox.ospath('A/C/exdir_G/pi')
contents = open(exdir_G_pi_path).read()
if contents != ("This is the file 'pi'.\n"
"Added to pi in revision 3.\n"):
raise svntest.Failure("Unexpected contents for rev 1 of " +
exdir_G_pi_path)
- exdir_H_omega_path = os.path.join(wc_dir, "A", "C", "exdir_H", "omega")
+ exdir_H_omega_path = sbox.ospath('A/C/exdir_H/omega')
contents = open(exdir_H_omega_path).read()
if contents != "This is the file 'omega'.\n":
raise svntest.Failure("Unexpected contents for rev 1 of " +
@@ -848,7 +848,7 @@ def external_with_peg_and_op_revision(sb
"\n"
# Set and commit the property.
- change_external(os.path.join(wc_dir, "A/D"), new_externals_desc)
+ change_external(sbox.ospath('A/D'), new_externals_desc)
# Update other working copy, see if we get the right change.
expected_output = svntest.wc.State(wc_dir, {
@@ -859,7 +859,7 @@ def external_with_peg_and_op_revision(sb
expected_output, None, None)
- external_chi_path = os.path.join(wc_dir, 'A', 'D', 'exdir_A', 'H', 'chi')
+ external_chi_path = sbox.ospath('A/D/exdir_A/H/chi')
contents = open(external_chi_path).read()
if contents != "This is the file 'chi'.\n":
raise svntest.Failure("Unexpected contents for externally modified " +
@@ -889,7 +889,7 @@ def new_style_externals(sbox):
"\n"
# Set and commit the property.
- change_external(os.path.join(wc_dir, "A/C"), new_externals_desc)
+ change_external(sbox.ospath('A/C'), new_externals_desc)
# Update other working copy.
expected_output = svntest.wc.State(wc_dir, {
@@ -915,7 +915,7 @@ def disallow_propset_invalid_formatted_e
sbox.build()
wc_dir = sbox.wc_dir
- A_path = os.path.join(wc_dir, 'A')
+ A_path = sbox.ospath('A')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@@ -990,7 +990,7 @@ def old_style_externals_ignore_peg_reg(s
ext = "exdir_G " + external_url_for["A/C/exdir_G"] + "@HEAD\n"
# Set and commit the property.
- change_external(os.path.join(wc_dir, "A"), ext)
+ change_external(sbox.ospath('A'), ext)
# Update the working copy. This should succeed (exitcode 0) but
# should print warnings on the external because the URL with '@HEAD'
@@ -1027,7 +1027,7 @@ def cannot_move_or_remove_file_externals
".*gamma.*; please .* "
"the svn:externals .*",
'rm',
- os.path.join(wc_dir, 'A', 'B', 'gamma'))
+ sbox.ospath('A/B/gamma'))
# Should not be able to move the file external.
svntest.actions.run_and_verify_svn("Able to move file external",
@@ -1036,15 +1036,15 @@ def cannot_move_or_remove_file_externals
".*gamma.*; please .*edit.*"
"svn:externals.*",
'mv',
- os.path.join(wc_dir, 'A', 'B', 'gamma'),
- os.path.join(wc_dir, 'A', 'B', 'gamma1'))
+ sbox.ospath('A/B/gamma'),
+ sbox.ospath('A/B/gamma1'))
# But the directory that contains it can be deleted.
expected_status = svntest.actions.get_virginal_state(wc_dir, 6)
svntest.actions.run_and_verify_svn(None, None, [],
'rm',
- os.path.join(wc_dir, "A", "B"))
+ sbox.ospath('A/B'))
expected_status.tweak('A/B', status='D ')
expected_output = svntest.wc.State(wc_dir, {
@@ -1072,7 +1072,7 @@ def cannot_move_or_remove_file_externals
svntest.actions.run_and_verify_update(wc_dir,
expected_output, None, None)
- open(os.path.join(wc_dir, 'A', 'D', 'gamma')).close()
+ open(sbox.ospath('A/D/gamma')).close()
#----------------------------------------------------------------------
@@ -1139,8 +1139,8 @@ def external_into_path_with_spaces(sbox)
svntest.actions.run_and_verify_update(wc_dir,
expected_output, None, None)
probe_paths_exist([
- os.path.join(wc_dir, 'A', 'copy of D'),
- os.path.join(wc_dir, 'A', 'another copy of D'),
+ sbox.ospath('A/copy of D'),
+ sbox.ospath('A/another copy of D'),
])
#----------------------------------------------------------------------
@@ -1155,7 +1155,7 @@ def binary_file_externals(sbox):
# Add a binary file A/theta, write PNG file data into it.
theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
- 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)
@@ -1175,7 +1175,7 @@ def binary_file_externals(sbox):
# Create a file external on the binary file A/theta
- C = os.path.join(wc_dir, 'A', 'C')
+ C = sbox.ospath('A/C')
external = os.path.join(C, 'external')
externals_prop = "^/A/theta external\n"
@@ -1226,7 +1226,7 @@ def update_lose_file_external(sbox):
# Create a file external in A/C/external on the file A/mu
- C = os.path.join(wc_dir, 'A', 'C')
+ C = sbox.ospath('A/C')
external = os.path.join(C, 'external')
externals_prop = "^/A/mu external\n"
@@ -1296,7 +1296,7 @@ def update_lose_file_external(sbox):
None, None, None, None, None,
True)
- probe_paths_missing([os.path.join(wc_dir, 'A', 'C', 'external')])
+ probe_paths_missing([sbox.ospath('A/C/external')])
#----------------------------------------------------------------------
@@ -1311,8 +1311,8 @@ def switch_relative_external(sbox):
repo_url = sbox.repo_url
# Create a relative external in A/D on ../B
- 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')
A_copy_url = repo_url + '/A_copy'
D_path = os.path.join(A_path, 'D')
ext_path = os.path.join(D_path, 'ext')
@@ -1398,7 +1398,7 @@ def relegate_external(sbox):
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
- A_path = os.path.join(wc_dir, 'A')
+ A_path = sbox.ospath('A')
# setup an external within the same repository
externals_desc = '^/A/B/E external'
@@ -1454,7 +1454,7 @@ def wc_repos_file_externals(sbox):
repo_url = sbox.repo_url
# Add a file A/theta.
- theta_path = os.path.join(wc_dir, 'A', 'theta')
+ theta_path = sbox.ospath('A/theta')
svntest.main.file_write(theta_path, 'theta', 'w')
svntest.main.run_svn(None, 'add', theta_path)
@@ -1475,7 +1475,7 @@ def wc_repos_file_externals(sbox):
# Create a file external on the file A/theta
- C = os.path.join(wc_dir, 'A', 'C')
+ C = sbox.ospath('A/C')
external = os.path.join(C, 'theta')
externals_prop = "^/A/theta theta\n"
@@ -1557,9 +1557,9 @@ def merge_target_with_externals(sbox):
repo_url = sbox.repo_url
# Some paths we'll care about
- A_path = os.path.join(wc_dir, "A")
- A_branch_path = os.path.join(wc_dir, "A-branch")
- A_gamma_branch_path = os.path.join(wc_dir, "A-branch", "D", "gamma")
+ A_path = sbox.ospath('A')
+ A_branch_path = sbox.ospath('A-branch')
+ A_gamma_branch_path = sbox.ospath('A-branch/D/gamma')
svntest.actions.run_and_verify_svn(None, None, [],
'checkout',
@@ -1726,7 +1726,7 @@ def update_external_on_locally_added_dir
svntest.actions.run_and_verify_update(wc_dir,
expected_output, None, None)
- probe_paths_exist([os.path.join(wc_dir, "A", "foo", "exdir_E")])
+ probe_paths_exist([sbox.ospath('A/foo/exdir_E')])
# Test for issue #2267
@Issue(2267)
@@ -1775,7 +1775,7 @@ def switch_external_on_locally_added_dir
# Switch the working copy to the branch, see if we get the new item.
svntest.actions.run_and_verify_svn(None, None, [], 'sw', A_copy_path, wc_dir)
- probe_paths_exist([os.path.join(wc_dir, "foo", "exdir_E")])
+ probe_paths_exist([sbox.ospath('foo/exdir_E')])
@Issue(3819)
def file_external_in_sibling(sbox):
@@ -1986,7 +1986,7 @@ def copy_file_externals(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- X = os.path.join(wc_dir, 'X')
+ X = sbox.ospath('X')
# svn mkdir X
expected_stdout = ['A ' + X + '\n']
@@ -2017,9 +2017,9 @@ def copy_file_externals(sbox):
# svn up
# ''')
- X = os.path.join(wc_dir, 'X')
- X_copy = os.path.join(wc_dir, 'X_copy')
- X_xmu = os.path.join(wc_dir, 'X', 'xmu')
+ X = sbox.ospath('X')
+ X_copy = sbox.ospath('X_copy')
+ X_xmu = sbox.ospath('X/xmu')
# svn ci
expected_output = svntest.wc.State(wc_dir, {
@@ -2155,12 +2155,12 @@ def include_externals(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- A_D_H = os.path.join(wc_dir, 'A', 'D', 'H')
- X = os.path.join(wc_dir, 'X')
- X_Y = os.path.join(wc_dir, 'X', 'Y')
- Xpegged = os.path.join(wc_dir, 'Xpegged')
- Z = os.path.join(wc_dir, 'Z')
- Z_zeta = os.path.join(wc_dir, 'Z', 'zeta')
+ A_D_H = sbox.ospath('A/D/H')
+ X = sbox.ospath('X')
+ X_Y = sbox.ospath('X/Y')
+ Xpegged = sbox.ospath('Xpegged')
+ Z = sbox.ospath('Z')
+ Z_zeta = sbox.ospath('Z/zeta')
# mkdir Z
os.makedirs(Z)
@@ -2291,15 +2291,15 @@ def include_externals(sbox):
# svn status
# """)
- X = os.path.join(wc_dir, 'X')
- X_xG = os.path.join(wc_dir, 'X', 'xG')
- X_xG_pi = os.path.join(wc_dir, 'X', 'xG', 'pi')
- X_xmu = os.path.join(wc_dir, 'X', 'xmu')
- X_Y_xH_chi = os.path.join(wc_dir, 'X', 'Y', 'xH', 'chi')
- X_Y_xH_xZ_zeta = os.path.join(wc_dir, 'X', 'Y', 'xH', 'xZ', 'zeta')
- X_Y_xlambda = os.path.join(wc_dir, 'X', 'Y', 'xlambda')
- Xpegged = os.path.join(wc_dir, 'Xpegged')
- Xpegged_xE_alpha = os.path.join(wc_dir, 'Xpegged', 'xE', 'alpha')
+ X = sbox.ospath('X')
+ X_xG = sbox.ospath('X/xG')
+ X_xG_pi = sbox.ospath('X/xG/pi')
+ X_xmu = sbox.ospath('X/xmu')
+ X_Y_xH_chi = sbox.ospath('X/Y/xH/chi')
+ X_Y_xH_xZ_zeta = sbox.ospath('X/Y/xH/xZ/zeta')
+ X_Y_xlambda = sbox.ospath('X/Y/xlambda')
+ Xpegged = sbox.ospath('Xpegged')
+ Xpegged_xE_alpha = sbox.ospath('Xpegged/xE/alpha')
# svn ci
expected_output = svntest.wc.State(wc_dir, {
@@ -2579,9 +2579,9 @@ def include_immediate_dir_externals(sbox
sbox.build()
wc_dir = sbox.wc_dir
- X = os.path.join(wc_dir, 'X')
- X_XE = os.path.join(wc_dir, 'X', 'XE')
- X_XE_alpha = os.path.join(wc_dir, 'X', 'XE', 'alpha')
+ X = sbox.ospath('X')
+ X_XE = sbox.ospath('X/XE')
+ X_XE_alpha = sbox.ospath('X/XE/alpha')
# svn mkdir X
expected_stdout = ['A ' + X + '\n']
@@ -2701,8 +2701,8 @@ def remap_file_external_with_prop_del(sb
sbox.build()
wc_dir = sbox.wc_dir
- A_path = os.path.join(wc_dir, "A")
- mu_path = os.path.join(wc_dir, "A", "mu")
+ A_path = sbox.ospath('A')
+ mu_path = sbox.ospath('A/mu')
# Add a property to A/mu
svntest.actions.run_and_verify_svn(None, None, [],
@@ -2747,8 +2747,8 @@ def dir_external_with_dash_r_only(sbox):
wc_dir = sbox.wc_dir
url = sbox.repo_url
- A_B_E_alpha = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
- E_ext = os.path.join(wc_dir, 'E_ext')
+ A_B_E_alpha = sbox.ospath('A/B/E/alpha')
+ E_ext = sbox.ospath('E_ext')
# echo 'newer alpha' > A/B/E/alpha
main.file_write(A_B_E_alpha, 'newer alpha\n')
@@ -2810,7 +2810,7 @@ def url_to_wc_copy_of_externals(sbox):
# Create an external A/C/external pointing to ^/A/D/G.
svntest.actions.run_and_verify_svn(None, None, [], 'ps',
'svn:externals', '^/A/D/G external',
- os.path.join(wc_dir, 'A', 'C'))
+ sbox.ospath('A/C'))
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
'create an external', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
@@ -2840,7 +2840,7 @@ def url_to_wc_copy_of_externals(sbox):
# svn-F9E2C0EC' to 'C:\SVN\src-trunk-3\Debug\subversion\tests\cmdline\
# svn-test-work\working_copies\externals_tests-41\External-WC-to-URL-Copy':
# Access is denied.
- external_root_path = os.path.join(wc_dir, "External-WC-to-URL-Copy")
+ external_root_path = sbox.ospath('External-WC-to-URL-Copy')
external_ex_path = os.path.join(wc_dir, "External-WC-to-URL-Copy",
"external")
external_pi_path = os.path.join(wc_dir, "External-WC-to-URL-Copy",
@@ -2862,7 +2862,7 @@ def url_to_wc_copy_of_externals(sbox):
])
exit_code, stdout, stderr = svntest.actions.run_and_verify_svn2(
"OUTPUT", expected_stdout, [], 0, 'copy', repo_url + '/A/C',
- os.path.join(wc_dir, 'External-WC-to-URL-Copy'))
+ sbox.ospath('External-WC-to-URL-Copy'))
########################################################################
# Run the tests
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py?rev=1354186&r1=1354185&r2=1354186&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py Tue Jun 26 19:26:49 2012
@@ -25,7 +25,9 @@
######################################################################
# General modules
-import sys, re, os.path
+import sys, re, os.path, logging
+
+logger = logging.getLogger()
# Our testing module
import svntest
@@ -138,31 +140,31 @@ def run_one_test(sbox, basename, *vararg
actual_stderr = process_lines(actual_stderr)
if exp_stdout != actual_stdout:
- print("Standard output does not match.")
- print("Expected standard output:")
- print("=====")
+ logger.warn("Standard output does not match.")
+ logger.warn("Expected standard output:")
+ logger.warn("=====")
for x in exp_stdout:
- sys.stdout.write(x)
- print("=====")
- print("Actual standard output:")
- print("=====")
+ logger.warn(x)
+ logger.warn("=====")
+ logger.warn("Actual standard output:")
+ logger.warn("=====")
for x in actual_stdout:
- sys.stdout.write(x)
- print("=====")
+ logger.warn(x)
+ logger.warn("=====")
raise svntest.Failure
if exp_stderr != actual_stderr:
- print("Standard error does not match.")
- print("Expected standard error:")
- print("=====")
+ logger.warn("Standard error does not match.")
+ logger.warn("Expected standard error:")
+ logger.warn("=====")
for x in exp_stderr:
- sys.stdout.write(x)
- print("=====")
- print("Actual standard error:")
- print("=====")
+ logger.warn(x)
+ logger.warn("=====")
+ logger.warn("Actual standard error:")
+ logger.warn("=====")
for x in actual_stderr:
- sys.stdout.write(x)
- print("=====")
+ logger.warn(x)
+ logger.warn("=====")
raise svntest.Failure
def getopt_no_args(sbox):
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1354186&r1=1354185&r2=1354186&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Tue Jun 26 19:26:49 2012
@@ -31,15 +31,29 @@ usage: 1. log [PATH][@REV]
and limits the scope of the displayed diff to the specified depth.
Examples:
- svn log
- svn log foo.c
- svn log bar.c@42
- svn log http://www.example.com/repo/project/foo.c
- svn log http://www.example.com/repo/project foo.c bar.c
- svn log http://www.example.com/repo/project@50 foo.c bar.c
- This command shows the log entry for the revision the branch
- ^/branches/foo was created in:
+ Show the latest 5 log messages for the current working copy
+ directory and display paths changed in each commit:
+ svn log -l 5 -v
+
+ Show the log for bar.c as of revision 42:
+ svn log bar.c@42
+
+ Show log messages and diffs for each commit to foo.c:
+ svn log --diff http://www.example.com/repo/project/foo.c
+ (Because the above command uses a full URL it does not require
+ a working copy.)
+
+ Show log messages for the children foo.c and bar.c of the directory
+ '/trunk' as it appeared in revision 50, using the ^/ URL shortcut:
+ svn log ^/trunk@50 foo.c bar.c
+
+ Show the log messages for any incoming changes to foo.c during the
+ next 'svn update':
+ svn log -r BASE:HEAD foo.c
+
+ Show the log message for the revision in which /branches/foo
+ was created:
svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo
Valid options:
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/import_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/import_tests.py?rev=1354186&r1=1354185&r2=1354186&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/import_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/import_tests.py Tue Jun 26 19:26:49 2012
@@ -298,6 +298,7 @@ def import_avoid_empty_revision(sbox):
#----------------------------------------------------------------------
# test for issue 2433: "import" does not handle eol-style correctly
+# and for normalising files with mixed line-endings upon import (r1205193)
@Issue(2433)
def import_eol_style(sbox):
"import should honor the eol-style property"
@@ -315,6 +316,7 @@ enable-auto-props = yes
[auto-props]
*.dsp = svn:eol-style=CRLF
+*.txt = svn:eol-style=native
'''
tmp_dir = os.path.abspath(svntest.main.temp_dir)
config_dir = os.path.join(tmp_dir, 'autoprops_config')
@@ -369,6 +371,26 @@ enable-auto-props = yes
file_path,
'--config-dir', config_dir)
+ # create a file with inconsistent EOLs and eol-style=native, and import it
+ file_name = "test.txt"
+ file_path = file_name
+ imp_dir_path = 'dir2'
+ imp_file_path = os.path.join(imp_dir_path, file_name)
+
+ os.mkdir(imp_dir_path, 0755)
+ svntest.main.file_append_binary(imp_file_path,
+ "This is file test.txt.\n" + \
+ "The second line.\r\n" + \
+ "The third line.\r")
+
+ # The import should succeed and not error out
+ svntest.actions.run_and_verify_svn(None, None, [], 'import',
+ '-m', 'Log message for new import',
+ imp_dir_path,
+ sbox.repo_url,
+ '--config-dir', config_dir)
+
+
#----------------------------------------------------------------------
@Issue(3983)
def import_into_foreign_repo(sbox):
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/lock_tests.py?rev=1354186&r1=1354185&r2=1354186&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/lock_tests.py Tue Jun 26 19:26:49 2012
@@ -26,7 +26,9 @@
######################################################################
# General modules
-import re, os, stat
+import re, os, stat, logging
+
+logger = logging.getLogger()
# Our testing module
import svntest
@@ -79,9 +81,8 @@ def lock_file(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_b)
# lock a file as wc_author
- fname = 'iota'
- file_path = os.path.join(sbox.wc_dir, fname)
- file_path_b = os.path.join(wc_b, fname)
+ file_path = sbox.ospath('iota')
+ file_path_b = sbox.ospath('iota', wc_dir=wc_b)
svntest.main.file_append(file_path, "This represents a binary file\n")
svntest.main.run_svn(None, 'commit',
@@ -133,45 +134,42 @@ def commit_file_keep_lock(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- fname = 'A/mu'
- file_path = os.path.join(sbox.wc_dir, fname)
-
- # lock fname as wc_author
+ # lock 'A/mu' as wc_author
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
- '-m', 'some lock comment', file_path)
+ '-m', 'some lock comment',
+ sbox.ospath('A/mu'))
# make a change and commit it, holding lock
- svntest.main.file_append(file_path, "Tweak!\n")
+ sbox.simple_append('A/mu', 'Tweak!\n')
svntest.main.run_svn(None, 'commit', '-m', '', '--no-unlock',
- file_path)
+ sbox.ospath('A/mu'))
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- expected_status.tweak(fname, wc_rev=2)
- expected_status.tweak(fname, writelocked='K')
+ expected_status.tweak('A/mu', wc_rev=2, writelocked='K')
# Make sure the file is still locked
svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
def commit_file_unlock(sbox):
"commit a file and release lock"
sbox.build()
wc_dir = sbox.wc_dir
- fname = 'A/mu'
- file_path = os.path.join(sbox.wc_dir, fname)
-
- # lock fname as wc_author
+ # lock A/mu and iota as wc_author
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
- '-m', 'some lock comment', file_path)
+ '-m', 'some lock comment',
+ sbox.ospath('A/mu'),
+ sbox.ospath('iota'))
# make a change and commit it, allowing lock to be released
- svntest.main.file_append(file_path, "Tweak!\n")
- svntest.main.run_svn(None, 'commit', '-m', '',
- file_path)
+ sbox.simple_append('A/mu', 'Tweak!\n')
+ sbox.simple_commit()
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- expected_status.tweak(fname, wc_rev=2)
+ expected_status.tweak('A/mu', wc_rev=2)
+ expected_status.tweak('iota', wc_rev=2)
# Make sure the file is unlocked
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@@ -183,20 +181,17 @@ def commit_propchange(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- fname = 'A/mu'
- file_path = os.path.join(sbox.wc_dir, fname)
-
- # lock fname as wc_author
+ # lock A/mu as wc_author
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
- '-m', 'some lock comment', file_path)
+ '-m', 'some lock comment',
+ sbox.ospath('A/mu'))
# make a property change and commit it, allowing lock to be released
- svntest.main.run_svn(None, 'propset', 'blue', 'azul', file_path)
- svntest.main.run_svn(None, 'commit',
- '-m', '', file_path)
+ sbox.simple_propset('blue', 'azul', 'A/mu')
+ sbox.simple_commit('A/mu')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- expected_status.tweak(fname, wc_rev=2)
+ expected_status.tweak('A/mu', wc_rev=2)
# Make sure the file is unlocked
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@@ -222,9 +217,8 @@ def break_lock(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_b)
# lock a file as wc_author
- fname = 'iota'
- file_path = os.path.join(sbox.wc_dir, fname)
- file_path_b = os.path.join(wc_b, fname)
+ file_path = sbox.ospath('iota')
+ file_path_b = sbox.ospath('iota', wc_dir=wc_b)
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
'-m', '', file_path)
@@ -265,9 +259,8 @@ def steal_lock(sbox):
svntest.actions.duplicate_dir(wc_dir, wc_b)
# lock a file as wc_author
- fname = 'iota'
- file_path = os.path.join(sbox.wc_dir, fname)
- file_path_b = os.path.join(wc_b, fname)
+ file_path = sbox.ospath('iota')
+ file_path_b = sbox.ospath('iota', wc_dir=wc_b)
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
'-m', '', file_path)
@@ -295,14 +288,9 @@ def examine_lock(sbox):
"examine the fields of a lockfile for correctness"
sbox.build()
- wc_dir = sbox.wc_dir
-
- fname = 'iota'
- comment = 'This is a lock test.'
- file_path = os.path.join(sbox.wc_dir, fname)
# lock a file as wc_author
- svntest.actions.run_and_validate_lock(file_path,
+ svntest.actions.run_and_validate_lock(sbox.ospath('iota'),
svntest.main.wc_author)
#----------------------------------------------------------------------
@@ -315,21 +303,17 @@ def handle_defunct_lock(sbox):
sbox.build()
wc_dir = sbox.wc_dir
-
- fname = 'iota'
- file_path = os.path.join(sbox.wc_dir, fname)
-
# set up our expected status
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
# lock the file
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
- '-m', '', file_path)
+ '-m', '', sbox.ospath('iota'))
# Make a second copy of the working copy
wc_b = sbox.add_wc_path('_b')
svntest.actions.duplicate_dir(wc_dir, wc_b)
- file_path_b = os.path.join(wc_b, fname)
+ file_path_b = sbox.ospath('iota', wc_dir=wc_b)
# --- Meanwhile, in our other working copy... ---
@@ -339,7 +323,7 @@ def handle_defunct_lock(sbox):
# update the 1st wc, which should clear the lock there
- svntest.main.run_svn(None, 'update', wc_dir)
+ sbox.simple_update()
# Make sure the file is unlocked
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@@ -357,9 +341,9 @@ def enforce_lock(sbox):
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')
+ iota_path = sbox.ospath('iota')
+ lambda_path = sbox.ospath('A/B/lambda')
+ mu_path = sbox.ospath('A/mu')
# svn:needs-lock value should be forced to a '*'
svntest.actions.set_prop('svn:needs-lock', 'foo', iota_path)
@@ -381,8 +365,8 @@ def enforce_lock(sbox):
if ((os.stat(iota_path)[0] & mode)
or (os.stat(lambda_path)[0] & mode)
or (os.stat(mu_path)[0] & mode)):
- print("Setting 'svn:needs-lock' property on a file failed to set")
- print("file mode to read-only.")
+ logger.warn("Setting 'svn:needs-lock' property on a file failed to set")
+ logger.warn("file mode to read-only.")
raise svntest.Failure
# obtain a lock on one of these files...
@@ -391,7 +375,7 @@ def enforce_lock(sbox):
# ...and verify that the write bit gets set...
if not (os.stat(iota_path)[0] & mode):
- print("Locking a file with 'svn:needs-lock' failed to set write bit.")
+ logger.warn("Locking a file with 'svn:needs-lock' failed to set write bit.")
raise svntest.Failure
# ...and unlock it...
@@ -400,13 +384,13 @@ def enforce_lock(sbox):
# ...and verify that the write bit gets unset
if (os.stat(iota_path)[0] & mode):
- print("Unlocking a file with 'svn:needs-lock' failed to unset write bit.")
+ logger.warn("Unlocking a file with 'svn:needs-lock' failed to unset write bit.")
raise svntest.Failure
# Verify that removing the property restores the file to read-write
svntest.main.run_svn(None, 'propdel', 'svn:needs-lock', iota_path)
if not (os.stat(iota_path)[0] & mode):
- print("Deleting 'svn:needs-lock' failed to set write bit.")
+ logger.warn("Deleting 'svn:needs-lock' failed to set write bit.")
raise svntest.Failure
#----------------------------------------------------------------------
@@ -418,30 +402,22 @@ def update_while_needing_lock(sbox):
"update handles svn:needs-lock correctly"
sbox.build()
- wc_dir = sbox.wc_dir
- iota_path = os.path.join(wc_dir, 'iota')
- svntest.main.run_svn(None,
- 'propset', 'svn:needs-lock', 'foo', iota_path)
- svntest.main.run_svn(None,
- 'commit', '-m', 'log msg', iota_path)
- svntest.main.run_svn(None,
- 'up', wc_dir)
+ sbox.simple_propset('svn:needs-lock', 'foo', 'iota')
+ sbox.simple_commit('iota')
+ sbox.simple_update()
# Lock, modify, commit, unlock, to create r3.
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
- '-m', '', iota_path)
- svntest.main.file_append(iota_path, "This line added in r2.\n")
- svntest.main.run_svn(None, 'commit',
- '-m', '', iota_path) # auto-unlocks
+ '-m', '', sbox.ospath('iota'))
+ sbox.simple_append('iota', 'This line added in r2.\n')
+ sbox.simple_commit('iota') # auto-unlocks
# Backdate to r2.
- svntest.main.run_svn(None,
- 'update', '-r2', iota_path)
+ sbox.simple_update(revision=2)
# Try updating forward to r3 again. This is where the bug happened.
- svntest.main.run_svn(None,
- 'update', '-r3', iota_path)
+ sbox.simple_update(revision=3)
#----------------------------------------------------------------------
@@ -456,17 +432,16 @@ def defunct_lock(sbox):
wc_b = sbox.add_wc_path('_b')
svntest.actions.duplicate_dir(wc_dir, wc_b)
- iota_path = os.path.join(wc_dir, 'iota')
- iota_path_b = os.path.join(wc_b, 'iota')
+ iota_path = sbox.ospath('iota')
+ iota_path_b = sbox.ospath('iota', wc_dir=wc_b)
mode = stat.S_IWGRP | stat.S_IWOTH | stat.S_IWRITE
# Set the prop in wc a
- svntest.main.run_svn(None, 'propset', 'svn:needs-lock', 'foo', iota_path)
+ sbox.simple_propset('svn:needs-lock', 'foo', 'iota')
# commit r2
- svntest.main.run_svn(None, 'commit',
- '-m', '', iota_path)
+ sbox.simple_commit('iota')
# update wc_b
svntest.main.run_svn(None, 'update', wc_b)
@@ -484,8 +459,8 @@ def defunct_lock(sbox):
# make sure that iota got set to read-only
if (os.stat(iota_path_b)[0] & mode):
- print("Upon removal of a defunct lock, a file with 'svn:needs-lock'")
- print("was not set back to read-only")
+ logger.warn("Upon removal of a defunct lock, a file with 'svn:needs-lock'")
+ logger.warn("was not set back to read-only")
raise svntest.Failure
@@ -498,14 +473,13 @@ def deleted_path_lock(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = os.path.join(wc_dir, 'iota')
+ iota_path = sbox.ospath('iota')
iota_url = sbox.repo_url + '/iota'
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
'-m', '', iota_path)
- svntest.actions.run_and_verify_svn(None, None, [], 'delete', iota_path)
-
+ sbox.simple_rm('iota')
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
'--no-unlock',
'-m', '', iota_path)
@@ -524,9 +498,9 @@ def lock_unlock(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- pi_path = os.path.join(wc_dir, 'A', 'D', 'G', 'pi')
- rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
- tau_path = os.path.join(wc_dir, 'A', 'D', 'G', 'tau')
+ pi_path = sbox.ospath('A/D/G/pi')
+ rho_path = sbox.ospath('A/D/G/rho')
+ tau_path = sbox.ospath('A/D/G/tau')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau', writelocked='K')
@@ -551,19 +525,17 @@ def deleted_dir_lock(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- parent_dir = os.path.join(wc_dir, 'A', 'D', 'G')
- pi_path = os.path.join(wc_dir, 'A', 'D', 'G', 'pi')
- rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
- tau_path = os.path.join(wc_dir, 'A', 'D', 'G', 'tau')
+ pi_path = sbox.ospath('A/D/G/pi')
+ rho_path = sbox.ospath('A/D/G/rho')
+ tau_path = sbox.ospath('A/D/G/tau')
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
'-m', '', pi_path, rho_path, tau_path)
- svntest.actions.run_and_verify_svn(None, None, [], 'delete', parent_dir)
-
+ sbox.simple_rm('A/D/G') # the parent directory
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
'--no-unlock',
- '-m', '', parent_dir)
+ '-m', '', sbox.ospath('A/D/G'))
#----------------------------------------------------------------------
# III.c : Lock a file and check the output of 'svn stat' from the same
@@ -581,30 +553,27 @@ def lock_status(sbox):
fname = 'iota'
file_path = os.path.join(sbox.wc_dir, fname)
- svntest.main.file_append(file_path, "This is a spreadsheet\n")
- svntest.main.run_svn(None, 'commit',
- '-m', '', file_path)
+ sbox.simple_append('iota', "This is a spreadsheet\n")
+ sbox.simple_commit('iota')
- svntest.main.run_svn(None, 'lock',
- '-m', '', file_path)
+ svntest.main.run_svn(None, 'lock', '-m', '', sbox.ospath('iota'))
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
- expected_status.tweak(fname, wc_rev=2)
- expected_status.tweak(fname, writelocked='K')
+ expected_status.tweak('iota', wc_rev=2, writelocked='K')
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Verify status again after modifying the file
- svntest.main.file_append(file_path, "check stat output after mod")
+ sbox.simple_append('iota', 'check stat output after mod')
- expected_status.tweak(fname, status='M ')
+ expected_status.tweak('iota', status='M ')
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Verify status of lock from another working copy
svntest.main.run_svn(None, 'update', wc_b)
expected_status = svntest.actions.get_virginal_state(wc_b, 2)
- expected_status.tweak(fname, writelocked='O')
+ expected_status.tweak('iota', writelocked='O')
svntest.actions.run_and_verify_status(wc_b, expected_status)
@@ -705,7 +674,7 @@ def lock_non_existent_file(sbox):
if line.find(error_msg) != -1:
break
else:
- print("Error: %s : not found in: %s" % (error_msg, error))
+ logger.warn("Error: %s : not found in: %s" % (error_msg, error))
raise svntest.Failure
#----------------------------------------------------------------------
@@ -744,7 +713,7 @@ def revert_lock(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- iota_path = os.path.join(wc_dir, 'iota')
+ iota_path = sbox.ospath('iota')
mode = stat.S_IWGRP | stat.S_IWOTH | stat.S_IWRITE
@@ -758,8 +727,8 @@ def revert_lock(sbox):
# make sure that iota got set to read-only
if (os.stat(iota_path)[0] & mode):
- print("Committing a file with 'svn:needs-lock'")
- print("did not set the file to read-only")
+ logger.warn("Committing a file with 'svn:needs-lock'")
+ logger.warn("did not set the file to read-only")
raise svntest.Failure
# verify status is as we expect
@@ -773,8 +742,8 @@ def revert_lock(sbox):
# make sure that iota got read-only-ness removed
if (os.stat(iota_path)[0] & mode == 0):
- print("Deleting the 'svn:needs-lock' property ")
- print("did not remove read-only-ness")
+ logger.warn("Deleting the 'svn:needs-lock' property ")
+ logger.warn("did not remove read-only-ness")
raise svntest.Failure
# revert the change
@@ -782,8 +751,8 @@ def revert_lock(sbox):
# make sure that iota got set back to read-only
if (os.stat(iota_path)[0] & mode):
- print("Reverting a file with 'svn:needs-lock'")
- print("did not set the file back to read-only")
+ logger.warn("Reverting a file with 'svn:needs-lock'")
+ logger.warn("did not set the file back to read-only")
raise svntest.Failure
# try propdel and revert from a different directory so
@@ -807,8 +776,8 @@ def revert_lock(sbox):
# make sure it is still writable since we have the lock
if (os.stat(iota_path)[0] & mode == 0):
- print("Reverting a 'svn:needs-lock' file (with lock in wc) ")
- print("did not leave the file writable")
+ logger.warn("Reverting a 'svn:needs-lock' file (with lock in wc) ")
+ logger.warn("did not leave the file writable")
raise svntest.Failure
@@ -863,8 +832,8 @@ def lock_switched_files(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
- lambda_path = os.path.join(wc_dir, 'A', 'B', 'lambda')
+ gamma_path = sbox.ospath('A/D/gamma')
+ lambda_path = sbox.ospath('A/B/lambda')
iota_URL = sbox.repo_url + '/iota'
alpha_URL = sbox.repo_url + '/A/B/E/alpha'
@@ -910,7 +879,7 @@ def lock_uri_encoded(sbox):
# lock a file as wc_author
fname = 'amazing space'
- file_path = os.path.join(wc_dir, fname)
+ file_path = sbox.ospath(fname)
svntest.main.file_append(file_path, "This represents a binary file\n")
svntest.actions.run_and_verify_svn(None, None, [], "add", file_path)
@@ -974,7 +943,7 @@ def lock_and_exebit1(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
+ gamma_path = sbox.ospath('A/D/gamma')
expected_err = ".*svn: warning: W125005: To turn off the svn:needs-lock property,.*"
svntest.actions.run_and_verify_svn2(None, None, expected_err, 0,
@@ -992,8 +961,8 @@ def lock_and_exebit1(sbox):
if (not gamma_stat & mode_r
or gamma_stat & mode_w
or not gamma_stat & mode_x):
- print("Committing a file with 'svn:needs-lock, svn:executable'")
- print("did not set the file to read-only, executable")
+ logger.warn("Committing a file with 'svn:needs-lock, svn:executable'")
+ logger.warn("did not set the file to read-only, executable")
raise svntest.Failure
# lock
@@ -1004,8 +973,8 @@ def lock_and_exebit1(sbox):
if (not gamma_stat & mode_r
or not gamma_stat & mode_w
or not gamma_stat & mode_x):
- print("Locking a file with 'svn:needs-lock, svn:executable'")
- print("did not set the file to read-write, executable")
+ logger.warn("Locking a file with 'svn:needs-lock, svn:executable'")
+ logger.warn("did not set the file to read-write, executable")
raise svntest.Failure
# modify
@@ -1020,8 +989,8 @@ def lock_and_exebit1(sbox):
if (not gamma_stat & mode_r
or gamma_stat & mode_w
or not gamma_stat & mode_x):
- print("Unlocking a file with 'svn:needs-lock, svn:executable'")
- print("did not set the file to read-only, executable")
+ logger.warn("Unlocking a file with 'svn:needs-lock, svn:executable'")
+ logger.warn("did not set the file to read-only, executable")
raise svntest.Failure
# ci
@@ -1033,8 +1002,8 @@ def lock_and_exebit1(sbox):
if (not gamma_stat & mode_r
or gamma_stat & mode_w
or not gamma_stat & mode_x):
- print("Commiting a file with 'svn:needs-lock, svn:executable'")
- print("after unlocking modified file's permissions")
+ logger.warn("Commiting a file with 'svn:needs-lock, svn:executable'")
+ logger.warn("after unlocking modified file's permissions")
raise svntest.Failure
@@ -1051,7 +1020,7 @@ def lock_and_exebit2(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
+ gamma_path = sbox.ospath('A/D/gamma')
expected_err = ".*svn: warning: W125005: To turn off the svn:needs-lock property,.*"
svntest.actions.run_and_verify_svn2(None, None, expected_err, 0,
@@ -1069,8 +1038,8 @@ def lock_and_exebit2(sbox):
if (not gamma_stat & mode_r
or gamma_stat & mode_w
or not gamma_stat & mode_x):
- print("Committing a file with 'svn:needs-lock, svn:executable'")
- print("did not set the file to read-only, executable")
+ logger.warn("Committing a file with 'svn:needs-lock, svn:executable'")
+ logger.warn("did not set the file to read-only, executable")
raise svntest.Failure
# lock
@@ -1081,8 +1050,8 @@ def lock_and_exebit2(sbox):
if (not gamma_stat & mode_r
or not gamma_stat & mode_w
or not gamma_stat & mode_x):
- print("Locking a file with 'svn:needs-lock, svn:executable'")
- print("did not set the file to read-write, executable")
+ logger.warn("Locking a file with 'svn:needs-lock, svn:executable'")
+ logger.warn("did not set the file to read-write, executable")
raise svntest.Failure
# modify
@@ -1097,8 +1066,8 @@ def lock_and_exebit2(sbox):
if (not gamma_stat & mode_r
or gamma_stat & mode_w
or not gamma_stat & mode_x):
- print("Commiting a file with 'svn:needs-lock, svn:executable'")
- print("did not set the file to read-only, executable")
+ logger.warn("Commiting a file with 'svn:needs-lock, svn:executable'")
+ logger.warn("did not set the file to read-only, executable")
raise svntest.Failure
def commit_xml_unsafe_file_unlock(sbox):
@@ -1173,7 +1142,6 @@ def repos_lock_with_info(sbox):
#----------------------------------------------------------------------
@Issue(4126)
-@Skip(svntest.main.is_ra_type_dav_serf) # Issue 4126 unpredictable result
def unlock_already_unlocked_files(sbox):
"(un)lock set of files, one already (un)locked"
@@ -1181,10 +1149,10 @@ def unlock_already_unlocked_files(sbox):
wc_dir = sbox.wc_dir
# Deliberately have no direct child of A as a target
- iota_path = os.path.join(wc_dir, 'iota')
- lambda_path = os.path.join(wc_dir, 'A', 'B', 'lambda')
- alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
- gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
+ iota_path = sbox.ospath('iota')
+ lambda_path = sbox.ospath('A/B/lambda')
+ alpha_path = sbox.ospath('A/B/E/alpha')
+ gamma_path = sbox.ospath('A/D/gamma')
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
'--username', svntest.main.wc_author2,
@@ -1229,8 +1197,8 @@ def info_moved_path(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- fname = os.path.join(wc_dir, "iota")
- fname2 = os.path.join(wc_dir, "iota2")
+ fname = sbox.ospath("iota")
+ fname2 = sbox.ospath("iota2")
# Move iota, creating r2.
svntest.actions.run_and_verify_svn(None, None, [],
@@ -1285,7 +1253,7 @@ def ls_url_encoded(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- dirname = os.path.join(wc_dir, "space dir")
+ dirname = sbox.ospath("space dir")
fname = os.path.join(dirname, "f")
# Create a dir with a space in its name and a file therein.
@@ -1391,7 +1359,7 @@ def unlocked_lock_of_other_user(sbox):
wc_dir = sbox.wc_dir
# lock a file with user jrandom
- pi_path = os.path.join(wc_dir, 'A', 'D', 'G', 'pi')
+ pi_path = sbox.ospath('A/D/G/pi')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/D/G/pi', writelocked='K')
@@ -1439,8 +1407,8 @@ def lock_twice_in_one_wc(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- mu2_path = os.path.join(wc_dir, 'A', 'B', 'mu')
+ mu_path = sbox.ospath('A/mu')
+ mu2_path = sbox.ospath('A/B/mu')
# Create a needs-lock file
svntest.actions.set_prop('svn:needs-lock', '*', mu_path)
@@ -1454,7 +1422,7 @@ def lock_twice_in_one_wc(sbox):
# Switch a second location for the same file in the same working copy
svntest.actions.run_and_verify_svn(None, None, [],
'switch', sbox.repo_url + '/A',
- os.path.join(wc_dir, 'A', 'B'),
+ sbox.ospath('A/B'),
'--ignore-ancestry')
# Lock location 1
@@ -1490,8 +1458,8 @@ def lock_path_not_in_head(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- D_path = os.path.join(wc_dir, 'A', 'D')
- lambda_path = os.path.join(wc_dir, 'A', 'B', 'lambda')
+ D_path = sbox.ospath('A/D')
+ lambda_path = sbox.ospath('A/B/lambda')
# Commit deletion of A/D and A/B/lambda as r2, then update the WC
# back to r1. Then attempt to lock some paths that no longer exist
@@ -1529,9 +1497,9 @@ def verify_path_escaping(sbox):
# Add test paths using two characters that need escaping in a url, but
# are within the normal ascii range
- file1 = os.path.join(wc_dir, 'file #1')
- file2 = os.path.join(wc_dir, 'file #2')
- file3 = os.path.join(wc_dir, 'file #3')
+ file1 = sbox.ospath('file #1')
+ file2 = sbox.ospath('file #2')
+ file3 = sbox.ospath('file #3')
svntest.main.file_write(file1, 'File 1')
svntest.main.file_write(file2, 'File 2')
@@ -1568,9 +1536,9 @@ def replace_and_propset_locked_path(sbox
sbox.build()
wc_dir = sbox.wc_dir
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- G_path = os.path.join(wc_dir, 'A', 'D', 'G')
- rho_path = os.path.join(G_path, 'rho')
+ mu_path = sbox.ospath('A/mu')
+ G_path = sbox.ospath('A/D/G')
+ rho_path = sbox.ospath('A/D/G/rho')
# Lock mu and A/D/G/rho.
svntest.actions.run_and_verify_svn(None, None, [],
@@ -1617,10 +1585,10 @@ def cp_isnt_ro(sbox):
wc_dir = sbox.wc_dir
mu_URL = sbox.repo_url + '/A/mu'
- mu_path = os.path.join(wc_dir, 'A', 'mu')
- mu2_path = os.path.join(wc_dir, 'A', 'mu2')
- mu3_path = os.path.join(wc_dir, 'A', 'mu3')
- kappa_path = os.path.join(wc_dir, 'kappa')
+ mu_path = sbox.ospath('A/mu')
+ mu2_path = sbox.ospath('A/mu2')
+ mu3_path = sbox.ospath('A/mu3')
+ kappa_path = sbox.ospath('kappa')
open(kappa_path, 'w').write("This is the file 'kappa'.\n")
## added file
@@ -1714,7 +1682,7 @@ def block_unlock_if_pre_unlock_hook_fail
svntest.actions.create_failing_hook(repo_dir, "pre-unlock", "error text")
# lock a file.
- pi_path = os.path.join(wc_dir, 'A', 'D', 'G', 'pi')
+ pi_path = sbox.ospath('A/D/G/pi')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/D/G/pi', writelocked='K')
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py?rev=1354186&r1=1354185&r2=1354186&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py Tue Jun 26 19:26:49 2012
@@ -391,25 +391,16 @@ def merge_history_repos(sbox):
svntest.main.run_svn(None, 'ci', '-m',
"Modify 'mu' on branches/c.")
- # Merge branches/c to trunk, which produces a conflict - r17
+ # Merge branches/c to trunk - r17
#
# Mergeinfo changes on /trunk:
# Merged /branches/c:r5-16
os.chdir('trunk')
- svntest.main.run_svn(None, 'merge', '--allow-mixed-revisions',
+ svntest.main.run_svn(None, 'up')
+ svntest.main.run_svn(None, 'merge', '--reintegrate',
os.path.join('..', branch_c) + '@HEAD')
- svntest.main.file_write(os.path.join('A', 'mu'),
- "This is the file 'mu'.\n" +
- "Don't forget to look at 'upsilon', as well.\n" +
- "This is yet more content in 'mu'.",
- "wb")
- # Resolve conflicts, and commit
- svntest.actions.run_and_verify_resolved([os.path.join('A', 'mu'),
- os.path.join('A', 'xi'),
- os.path.join('A', 'upsilon')])
svntest.main.run_svn(None, 'ci', '-m',
- "Merge branches/c to trunk, " +
- "resolving a conflict in 'mu'.",
+ "Merge branches/c to trunk.",
'--username', svntest.main.wc_author2)
os.chdir('..')
@@ -2218,7 +2209,6 @@ def log_xml_old(sbox):
@Issue(4153)
-@XFail(svntest.main.is_ra_type_dav)
def log_diff_moved(sbox):
"log --diff on moved file"
@@ -2234,7 +2224,7 @@ def log_diff_moved(sbox):
mu_at_1 = sbox.repo_url + '/A/mu@1'
mu3_at_3 = sbox.repo_url + '/A/mu3@3'
- r1diff = [make_diff_header('A/mu', 'revision 0', 'revision 1')
+ r1diff = [make_diff_header('mu', 'revision 0', 'revision 1')
+ ["@@ -0,0 +1 @@\n",
"+This is the file 'mu'.\n"]]
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1354186&r1=1354185&r2=1354186&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/merge_reintegrate_tests.py Tue Jun 26 19:26:49 2012
@@ -61,7 +61,7 @@ def basic_reintegrate(sbox):
expected_disk, expected_status = set_up_branch(sbox)
# Make a change on the branch, to A/mu. Commit in r7.
- svntest.main.file_write(os.path.join(wc_dir, "A_COPY", "mu"),
+ svntest.main.file_write(sbox.ospath('A_COPY/mu'),
"Changed on the branch.")
expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
expected_status.tweak('A_COPY/mu', wc_rev=7)
@@ -77,7 +77,7 @@ def basic_reintegrate(sbox):
None, None, None, None, None, True)
# Merge from trunk to branch (ie, r3-6), using normal cherry-harvest.
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
+ A_COPY_path = sbox.ospath('A_COPY')
expected_output = wc.State(A_COPY_path, {
'D/H/psi' : Item(status='U '),
'D/G/rho' : Item(status='U '),
@@ -172,7 +172,7 @@ def basic_reintegrate(sbox):
# *finally*, actually run merge --reintegrate in trunk with the
# branch URL. This should bring in the mu change and the tauprime
# change.
- A_path = os.path.join(wc_dir, "A")
+ A_path = sbox.ospath('A')
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
})
@@ -230,7 +230,7 @@ def basic_reintegrate(sbox):
sbox.repo_url + '/A_MOVED',
'-m', 'Copy A to A_MOVED')
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
- A_MOVED_path = os.path.join(wc_dir, "A_MOVED")
+ A_MOVED_path = sbox.ospath('A_MOVED')
expected_output = wc.State(A_MOVED_path, {
'mu' : Item(status='U '),
})
@@ -285,7 +285,7 @@ def reintegrate_with_rename(sbox):
expected_disk, expected_status = set_up_branch(sbox)
# Make a change on the branch, to A/mu. Commit in r7.
- svntest.main.file_write(os.path.join(wc_dir, "A_COPY", "mu"),
+ svntest.main.file_write(sbox.ospath('A_COPY/mu'),
"Changed on the branch.")
expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
expected_status.tweak('A_COPY/mu', wc_rev=7)
@@ -301,7 +301,7 @@ def reintegrate_with_rename(sbox):
None, None, None, None, None, True)
# Merge from trunk to branch (ie, r3-6), using normal cherry-harvest.
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
+ A_COPY_path = sbox.ospath('A_COPY')
expected_output = wc.State(A_COPY_path, {
'D/H/psi' : Item(status='U '),
'D/G/rho' : Item(status='U '),
@@ -452,7 +452,7 @@ def reintegrate_with_rename(sbox):
# *finally*, actually run merge --reintegrate in trunk with the
# branch URL. This should bring in the mu change and the tauprime
# change.
- A_path = os.path.join(wc_dir, "A")
+ A_path = sbox.ospath('A')
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
'D/G/tauprime' : Item(status='A '),
@@ -527,7 +527,7 @@ def reintegrate_branch_never_merged_to(s
expected_disk, expected_status = set_up_branch(sbox)
# Make a change on the branch, to A_COPY/mu. Commit in r7.
- svntest.main.file_write(os.path.join(wc_dir, "A_COPY", "mu"),
+ svntest.main.file_write(sbox.ospath('A_COPY/mu'),
"Changed on the branch.")
expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
expected_status.tweak('A_COPY/mu', wc_rev=7)
@@ -570,7 +570,7 @@ def reintegrate_branch_never_merged_to(s
# *finally*, actually run merge --reintegrate in trunk with the
# branch URL. This should bring in the mu change and the tauprime
# change.
- A_path = os.path.join(wc_dir, "A")
+ A_path = sbox.ospath('A')
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
'D/G/tauprime' : Item(status='A '),
@@ -655,7 +655,7 @@ def reintegrate_fail_on_modified_wc(sbox
"merge --reintegrate should fail in modified wc"
sbox.build()
wc_dir = sbox.wc_dir
- A_path = os.path.join(wc_dir, "A")
+ A_path = sbox.ospath('A')
mu_path = os.path.join(A_path, "mu")
ignored_expected_disk, ignored_expected_status = set_up_branch(sbox)
svntest.main.file_write(mu_path, "Changed on 'trunk' (the merge target).")
@@ -671,7 +671,7 @@ def reintegrate_fail_on_mixed_rev_wc(sbo
"merge --reintegrate should fail in mixed-rev wc"
sbox.build()
wc_dir = sbox.wc_dir
- A_path = os.path.join(wc_dir, "A")
+ A_path = sbox.ospath('A')
mu_path = os.path.join(A_path, "mu")
ignored_expected_disk, expected_status = set_up_branch(sbox)
# Make and commit a change, in order to get a mixed-rev wc.
@@ -694,7 +694,7 @@ def reintegrate_fail_on_switched_wc(sbox
"merge --reintegrate should fail in switched wc"
sbox.build()
wc_dir = sbox.wc_dir
- A_path = os.path.join(wc_dir, "A")
+ A_path = sbox.ospath('A')
G_path = os.path.join(A_path, "D", "G")
switch_url = sbox.repo_url + "/A/D/H"
expected_disk, expected_status = set_up_branch(sbox)
@@ -749,11 +749,11 @@ def reintegrate_on_shallow_wc(sbox):
expected_disk, expected_status = set_up_branch(sbox, branch_only = True)
# Some paths we'll care about
- A_path = os.path.join(wc_dir, "A")
- A_D_path = os.path.join(wc_dir, "A", "D")
- mu_COPY_path = os.path.join(wc_dir, "A_COPY", "mu")
- psi_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "psi")
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
+ A_path = sbox.ospath('A')
+ A_D_path = sbox.ospath('A/D')
+ mu_COPY_path = sbox.ospath('A_COPY/mu')
+ psi_COPY_path = sbox.ospath('A_COPY/D/H/psi')
+ A_COPY_path = sbox.ospath('A_COPY')
# r3 - Make a change on the A_COPY branch that will be
# reintegrated back to A.
@@ -854,7 +854,7 @@ def reintegrate_fail_on_stale_source(sbo
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
- A_path = os.path.join(wc_dir, "A")
+ A_path = sbox.ospath('A')
mu_path = os.path.join(A_path, "mu")
svntest.main.file_append(mu_path, 'some text appended to mu\n')
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
@@ -931,7 +931,7 @@ def merge_file_with_space_in_its_path(sb
sbox.build()
wc_dir = sbox.wc_dir
- some_dir = os.path.join(wc_dir, "some dir")
+ some_dir = sbox.ospath('some dir')
file1 = os.path.join(some_dir, "file1")
file2 = os.path.join(some_dir, "file2")
@@ -963,36 +963,59 @@ def reintegrate_with_subtree_mergeinfo(s
"merge --reintegrate with subtree mergeinfo"
# Create a standard greek tree, branch A to A_COPY in r2, A to A_COPY_2 in
- # r3, A to A_COPY_3 in r3, and then make some changes under A in r5-8.
+ # r3, A to A_COPY_3 in r4, and then make some changes under A in r5-8.
+ #
+ # A_COPY_3 4---------
+ # /
+ # A -1--------5-6-7-8-
+ # \ \
+ # A_COPY 2-\-----------
+ # \
+ # A_COPY_2 3---------
+
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox, False, 3)
# Some paths we'll care about
- gamma_COPY_3_path = os.path.join(wc_dir, "A_COPY_3", "D", "gamma")
- D_path = os.path.join(wc_dir, "A", "D")
- gamma_path = os.path.join(wc_dir, "A", "D", "gamma")
- mu_COPY_2_path = os.path.join(wc_dir, "A_COPY_2", "mu")
- mu_path = os.path.join(wc_dir, "A", "mu")
- mu_COPY_path = os.path.join(wc_dir, "A_COPY", "mu")
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
- D_COPY_path = os.path.join(wc_dir, "A_COPY")
- beta_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "E", "beta")
- gamma_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "gamma")
- gamma_moved_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "gamma_moved")
- gamma_moved_path = os.path.join(wc_dir, "A", "D", "gamma_moved")
- rho_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "G", "rho")
- omega_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "omega")
- psi_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "psi")
- D_COPY_path = os.path.join(wc_dir, "A_COPY", "D")
- alpha_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "E", "alpha")
- A_path = os.path.join(wc_dir, "A")
+ gamma_COPY_3_path = sbox.ospath('A_COPY_3/D/gamma')
+ D_path = sbox.ospath('A/D')
+ gamma_path = sbox.ospath('A/D/gamma')
+ mu_COPY_2_path = sbox.ospath('A_COPY_2/mu')
+ mu_path = sbox.ospath('A/mu')
+ mu_COPY_path = sbox.ospath('A_COPY/mu')
+ A_COPY_path = sbox.ospath('A_COPY')
+ D_COPY_path = sbox.ospath('A_COPY')
+ beta_COPY_path = sbox.ospath('A_COPY/B/E/beta')
+ gamma_COPY_path = sbox.ospath('A_COPY/D/gamma')
+ gamma_moved_COPY_path = sbox.ospath('A_COPY/D/gamma_moved')
+ gamma_moved_path = sbox.ospath('A/D/gamma_moved')
+ rho_COPY_path = sbox.ospath('A_COPY/D/G/rho')
+ omega_COPY_path = sbox.ospath('A_COPY/D/H/omega')
+ psi_COPY_path = sbox.ospath('A_COPY/D/H/psi')
+ D_COPY_path = sbox.ospath('A_COPY/D')
+ alpha_COPY_path = sbox.ospath('A_COPY/B/E/alpha')
+ A_path = sbox.ospath('A')
# Now set up a situation where we try to reintegrate A_COPY back to A but
# both of these paths have subtree mergeinfo. Iff the mergeinfo on A_COPY
# reflects that the same revisions have been applied across all of A_COPY,
- # then the reintegrate merge should succeed.
+ # then the reintegrate merge should succeed. We'll try that case first.
+ #
+ # A_COPY_3 4--------9---
+ # / \
+ # / \c.
+ # A -1--------5-6-7-8---10-------------------WC--
+ # \ \ (D) \ /r.
+ # \ \ (mu) \s. /
+ # A_COPY 2-\--------------------12---13--14------
+ # \ /c.
+ # \ /
+ # A_COPY_2 3--------------11---
#
+ # Key: c. = cherry-pick, s. = sync, r. = reintegrate.
+ # Note: These diagrams show an overview and do not capture every detail.
+
# r9 - Make a text change to A_COPY_3/D/gamma
svntest.main.file_write(gamma_COPY_3_path, "New content")
expected_output = wc.State(wc_dir, {'A_COPY_3/D/gamma' : Item(verb='Sending')})
@@ -1166,6 +1189,17 @@ def reintegrate_with_subtree_mergeinfo(s
# merge should fail, but should provide a helpful message as to where the
# problems are.
#
+ # A_COPY_3 4--------9---
+ # / \
+ # / \c. [-8]___
+ # A -1---------5-6-7-8---10----------------\-------WC--
+ # \ \ (D) \ \ /r.
+ # \ \ (mu) \s. \c. /
+ # A_COPY 2-\--------------------12---13--14--15--------
+ # \ /c. (D)
+ # \ /
+ # A_COPY_2 3--------------11---
+
# First revert the previous reintegrate merge
svntest.actions.run_and_verify_svn(None, None, [],
'revert', '-R', wc_dir)
@@ -1233,6 +1267,18 @@ def reintegrate_with_subtree_mergeinfo(s
#
# E) Reintegrate 'branch' to 'trunk'. This fails as it appears not all
# of 'trunk' was previously merged to 'branch'
+ #
+ # Step: A B C D E
+ # A_COPY_3 ----9---
+ # / \ (D/g.->
+ # / \c. [-8]___ D/g.m.) (D/g.m.)
+ # A ------------10----------------\------16-------18--------WC
+ # \\ (D) \ \ \ \ /r.
+ # \\ (mu) \s. \c. \s. \s. /
+ # A_COPY -\--------------12---13--14--15-------17-------19------
+ # \ /c. (D)
+ # \ /
+ # A_COPY_2 ---------11---
# r16 - A) REPOS-to-REPOS rename of A/D/gamma to A/D/gamma_moved. Since
# r874258 WC-to-WC moves won't create mergeinfo on the dest if the source
@@ -1403,11 +1449,11 @@ def multiple_reintegrates_from_the_same_
expected_disk, expected_status = set_up_branch(sbox)
# Some paths we'll care about
- A_path = os.path.join(wc_dir, "A")
- mu_path = os.path.join(wc_dir, "A", "mu")
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
- psi_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "psi")
- Feature_branch_path = os.path.join(wc_dir, "A_FEATURE_BRANCH")
+ A_path = sbox.ospath('A')
+ mu_path = sbox.ospath('A/mu')
+ A_COPY_path = sbox.ospath('A_COPY')
+ psi_COPY_path = sbox.ospath('A_COPY/D/H/psi')
+ Feature_branch_path = sbox.ospath('A_FEATURE_BRANCH')
Feature_beta_path = os.path.join(wc_dir, "A_FEATURE_BRANCH", "B", "E",
"beta")
@@ -1593,11 +1639,11 @@ def reintegrate_with_self_referential_me
wc_disk, wc_status = set_up_branch(sbox, nbr_of_branches=0)
# Some paths we'll care about
- A_path = os.path.join(wc_dir, "A")
- A2_path = os.path.join(wc_dir, "A2")
- A2_B_path = os.path.join(wc_dir, "A2", "B")
- A2_1_path = os.path.join(wc_dir, "A2.1")
- A2_1_mu_path = os.path.join(wc_dir, "A2.1", "mu")
+ A_path = sbox.ospath('A')
+ A2_path = sbox.ospath('A2')
+ A2_B_path = sbox.ospath('A2/B')
+ A2_1_path = sbox.ospath('A2.1')
+ A2_1_mu_path = sbox.ospath('A2.1/mu')
# r6 Copy A to A2 and then manually set some self-referential mergeinfo on
# A2/B and A2.
@@ -1723,12 +1769,12 @@ def reintegrate_with_subtree_merges(sbox
expected_disk, expected_status = set_up_branch(sbox)
# Some paths we'll care about
- A_path = os.path.join(wc_dir, "A")
- mu_COPY_path = os.path.join(wc_dir, "A_COPY", "mu")
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
- B_COPY_path = os.path.join(wc_dir, "A_COPY", "B")
- rho_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "G", "rho")
- H_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H")
+ A_path = sbox.ospath('A')
+ mu_COPY_path = sbox.ospath('A_COPY/mu')
+ A_COPY_path = sbox.ospath('A_COPY')
+ B_COPY_path = sbox.ospath('A_COPY/B')
+ rho_COPY_path = sbox.ospath('A_COPY/D/G/rho')
+ H_COPY_path = sbox.ospath('A_COPY/D/H')
# r7 - Make a change on the A_COPY branch that will be
# reintegrated back to A.
@@ -1852,13 +1898,13 @@ def added_subtrees_with_mergeinfo_break_
wc_dir = sbox.wc_dir
# Some paths we'll care about
- A_path = os.path.join(wc_dir, "A")
- nu_path = os.path.join(wc_dir, "A", "C", "nu")
- mu_path = os.path.join(wc_dir, "A", "mu")
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
- lambda_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "lambda")
- A_COPY_2_path = os.path.join(wc_dir, "A_COPY_2")
- nu_COPY_2_path = os.path.join(wc_dir, "A_COPY_2", "C", "nu")
+ A_path = sbox.ospath('A')
+ nu_path = sbox.ospath('A/C/nu')
+ mu_path = sbox.ospath('A/mu')
+ A_COPY_path = sbox.ospath('A_COPY')
+ lambda_COPY_path = sbox.ospath('A_COPY/B/lambda')
+ A_COPY_2_path = sbox.ospath('A_COPY_2')
+ nu_COPY_2_path = sbox.ospath('A_COPY_2/C/nu')
# Branch A@1 to A_COPY and A_COPY_2 in r2 and r3 respectively.
# Make some changes under 'A' in r4-7.
@@ -2048,10 +2094,10 @@ def two_URL_merge_removes_valid_mergeinf
wc_dir = sbox.wc_dir
# Some paths we'll care about
- lambda_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "lambda")
- mu_path = os.path.join(wc_dir, "A", "mu")
- A_COPY_path = os.path.join(wc_dir, "A_COPY")
- A_COPY_2_path = os.path.join(wc_dir, "A_COPY_2")
+ lambda_COPY_path = sbox.ospath('A_COPY/B/lambda')
+ mu_path = sbox.ospath('A/mu')
+ A_COPY_path = sbox.ospath('A_COPY')
+ A_COPY_2_path = sbox.ospath('A_COPY_2')
# Branch A@1 to A_COPY r2
# Branch A@1 to A_COPY_2 in r3.
@@ -2207,14 +2253,14 @@ def reintegrate_creates_bogus_mergeinfo(
sbox.build()
wc_dir=sbox.wc_dir
- mu_path = os.path.join(sbox.wc_dir, "A", "mu")
- lambda_path = os.path.join(sbox.wc_dir, "A", "B", "lambda")
- alpha_path = os.path.join(sbox.wc_dir, "A", "B", "E", "alpha")
- beta_path = os.path.join(sbox.wc_dir, "A", "B", "E", "beta")
- A_path = os.path.join(sbox.wc_dir, "A")
- A_path_1 = os.path.join(sbox.wc_dir, "A@1")
- A_COPY_path = os.path.join(sbox.wc_dir, "A_COPY")
- A_COPY_psi_path = os.path.join(sbox.wc_dir, "A_COPY", "D", "H", "psi")
+ mu_path = sbox.ospath('A/mu')
+ lambda_path = sbox.ospath('A/B/lambda')
+ alpha_path = sbox.ospath('A/B/E/alpha')
+ beta_path = sbox.ospath('A/B/E/beta')
+ A_path = sbox.ospath('A')
+ A_path_1 = sbox.ospath('A@1')
+ A_COPY_path = sbox.ospath('A_COPY')
+ A_COPY_psi_path = sbox.ospath('A_COPY/D/H/psi')
A_COPY_url = sbox.repo_url + "/A_COPY"
# Make 2 commits under /A pushing the repo to rev3
@@ -2297,7 +2343,7 @@ def no_source_subtree_mergeinfo(sbox):
sbox.build()
wc_dir=sbox.wc_dir
- svntest.main.file_write(os.path.join(wc_dir, 'A', 'B', 'E', 'alpha'),
+ svntest.main.file_write(sbox.ospath('A/B/E/alpha'),
'AAA\n' +
'BBB\n' +
'CCC\n')
@@ -2306,32 +2352,32 @@ def no_source_subtree_mergeinfo(sbox):
# Create branch-1
svntest.main.run_svn(None, 'copy',
- os.path.join(wc_dir, 'A', 'B'),
- os.path.join(wc_dir, 'A', 'B1'))
+ sbox.ospath('A/B'),
+ sbox.ospath('A/B1'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
# Create branch-1
svntest.main.run_svn(None, 'copy',
- os.path.join(wc_dir, 'A', 'B'),
- os.path.join(wc_dir, 'A', 'B2'))
+ sbox.ospath('A/B'),
+ sbox.ospath('A/B2'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
# Change on trunk
- svntest.main.file_write(os.path.join(wc_dir, 'A', 'B', 'E', 'alpha'),
+ svntest.main.file_write(sbox.ospath('A/B/E/alpha'),
'AAAxx\n' +
'BBB\n' +
'CCC\n')
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
# Change on branch-1
- svntest.main.file_write(os.path.join(wc_dir, 'A', 'B1', 'E', 'alpha'),
+ svntest.main.file_write(sbox.ospath('A/B1/E/alpha'),
'AAA\n' +
'BBBxx\n' +
'CCC\n')
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
# Change on branch-2
- svntest.main.file_write(os.path.join(wc_dir, 'A', 'B2', 'E', 'alpha'),
+ svntest.main.file_write(sbox.ospath('A/B2/E/alpha'),
'AAA\n' +
'BBB\n' +
'CCCxx\n')
@@ -2339,25 +2385,25 @@ def no_source_subtree_mergeinfo(sbox):
svntest.main.run_svn(None, 'update', wc_dir)
# Merge trunk to branch-1
- svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B1'))
+ svntest.main.run_svn(None, 'merge', '^/A/B', sbox.ospath('A/B1'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
# Reintegrate branch-1 subtree to trunk subtree
svntest.main.run_svn(None, 'merge', '--reintegrate',
- '^/A/B1/E', os.path.join(wc_dir, 'A', 'B', 'E'))
+ '^/A/B1/E', sbox.ospath('A/B/E'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
# Merge trunk to branch-2
- svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B2'))
+ svntest.main.run_svn(None, 'merge', '^/A/B', sbox.ospath('A/B2'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
# Reverse merge branch-1 subtree to branch-2 subtree, this removes
# the subtree mergeinfo from branch 2
svntest.main.run_svn(None, 'merge', '-r8:2',
- '^/A/B1/E', os.path.join(wc_dir, 'A', 'B2', 'E'))
+ '^/A/B1/E', sbox.ospath('A/B2/E'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
@@ -2366,7 +2412,7 @@ def no_source_subtree_mergeinfo(sbox):
sbox.repo_url + '/A/B2/E')
# Merge trunk to branch-2
- svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B2'))
+ svntest.main.run_svn(None, 'merge', '^/A/B', sbox.ospath('A/B2'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
@@ -2378,14 +2424,14 @@ def no_source_subtree_mergeinfo(sbox):
# The error message states revisions /A/B/E:3-11 are missing from
# /A/B2/E and yet the mergeinfo on /A/B2 is /A/B:3-11 and /A/B2/E
# has no mergeinfo.
- expected_output = wc.State(os.path.join(wc_dir, 'A', 'B'), {
+ expected_output = wc.State(sbox.ospath('A/B'), {
'E' : Item(status=' U'),
'E/alpha' : Item(status='U '),
})
- expected_mergeinfo = wc.State(os.path.join(wc_dir, 'A', 'B'), {
+ expected_mergeinfo = wc.State(sbox.ospath('A/B'), {
'' : Item(status=' U'),
})
- expected_elision = wc.State(os.path.join(wc_dir, 'A', 'B'), {
+ expected_elision = wc.State(sbox.ospath('A/B'), {
})
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A/B2:4-12'}),
@@ -2397,18 +2443,18 @@ def no_source_subtree_mergeinfo(sbox):
'F' : Item(),
'lambda' : Item("This is the file 'lambda'.\n"),
})
- expected_skip = wc.State(os.path.join(wc_dir, 'A', 'B'), {
+ expected_skip = wc.State(sbox.ospath('A/B'), {
})
- svntest.actions.run_and_verify_merge(os.path.join(wc_dir, 'A', 'B'),
+ svntest.actions.run_and_verify_merge(sbox.ospath('A/B'),
None, None, '^/A/B2', None,
expected_output, expected_mergeinfo,
expected_elision, expected_disk,
None, expected_skip,
None, None, None, None, None,
1, 1, '--reintegrate',
- os.path.join(wc_dir, 'A', 'B'))
+ sbox.ospath('A/B'))
# For 1.6 testsuite use:
- # svntest.actions.run_and_verify_merge(os.path.join(wc_dir, 'A', 'B'),
+ # svntest.actions.run_and_verify_merge(sbox.ospath('A/B'),
# None, None, '^/A/B2',
# expected_output,
# expected_disk,
@@ -2427,10 +2473,10 @@ def reintegrate_replaced_source(sbox):
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
- A_path = os.path.join(sbox.wc_dir, "A")
- A_COPY_path = os.path.join(sbox.wc_dir, "A_COPY")
- beta_COPY_path = os.path.join(sbox.wc_dir, "A_COPY", "B", "E", "beta")
- mu_COPY_path = os.path.join(sbox.wc_dir, "A_COPY", "mu")
+ A_path = sbox.ospath('A')
+ A_COPY_path = sbox.ospath('A_COPY')
+ beta_COPY_path = sbox.ospath('A_COPY/B/E/beta')
+ mu_COPY_path = sbox.ospath('A_COPY/mu')
# Using cherrypick merges, simulate a series of sync merges from A to
# A_COPY with a replace of A_COPY along the way.
@@ -2601,6 +2647,46 @@ def no_op_reintegrate(sbox):
svntest.main.run_svn(None, 'merge', '--reintegrate',
sbox.repo_url + '/A_COPY', A_path)
+#----------------------------------------------------------------------
+def renamed_branch_reintegrate(sbox):
+ """reintegrate a branch that has been renamed"""
+
+ # The idea of this test is to ensure that the reintegrate merge is able to
+ # cope when one or both of the branches have been renamed.
+ #
+ # A -1-----3-4-5-6----------------------9--------
+ # \ \ / reintegrate
+ # A_COPY 2--------------7-------- /
+ # sync \ /
+ # RENAMED rename 8----------------
+
+ # TODO: Make some changes between the sync/rename/reintegrate steps so
+ # the reintegrate merge actually has to do something.
+ # TODO: Rename the other branch as well.
+
+ # Make A_COPY branch in r2, and do a few more commits to A in r3-6.
+ sbox.build()
+
+ wc_dir = sbox.wc_dir
+ A_path = sbox.ospath('A')
+ A_COPY_path = sbox.ospath('A_COPY')
+ expected_disk, expected_status = set_up_branch(sbox)
+
+ # Sync merge from trunk to branch
+ svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path)
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ # Rename the branch
+ sbox.simple_move('A_COPY', 'RENAMED')
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ # Reintegrate; there are no relevant changes on the branch.
+ # ### TODO: Check the result more carefully than merely that it completed.
+ svntest.main.run_svn(None, 'merge', '--reintegrate',
+ sbox.repo_url + '/RENAMED@8', A_path)
+
########################################################################
# Run the tests
@@ -2626,6 +2712,7 @@ test_list = [ None,
reintegrate_replaced_source,
reintegrate_symlink_deletion,
no_op_reintegrate,
+ renamed_branch_reintegrate,
]
if __name__ == '__main__':
Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py?rev=1354186&r1=1354185&r2=1354186&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py Tue Jun 26 19:26:49 2012
@@ -15216,7 +15216,7 @@ def merge_automatic_conflict_resolution(
'revert', '--recursive', wc_dir)
# Test --accept mine-conflict and mine-full
- expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='U ')})
+ expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='C ')})
expected_disk.tweak('D/H/psi', contents="BASE.\n")
expected_status.tweak('D/H/psi', status=' ')
svntest.actions.run_and_verify_merge(A_COPY_path, '2', '3',
@@ -15251,7 +15251,7 @@ def merge_automatic_conflict_resolution(
'revert', '--recursive', wc_dir)
# Test --accept theirs-conflict and theirs-full
- expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='U ')})
+ expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='C ')})
expected_disk.tweak('D/H/psi', contents="New content")
expected_status.tweak('D/H/psi', status='M ')
svntest.actions.run_and_verify_merge(A_COPY_path, '2', '3',
@@ -15285,7 +15285,7 @@ def merge_automatic_conflict_resolution(
svntest.actions.run_and_verify_svn(None, None, [],
'revert', '--recursive', wc_dir)
# Test --accept base
- expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='U ')})
+ expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='C ')})
expected_elision_output = wc.State(A_COPY_path, {
})
expected_disk.tweak('D/H/psi', contents="This is the file 'psi'.\n")