This patch gets the tests recognizing Window's local patch separator.
There are still four tests that fail -- one is commit-22 which has been
failing for me for a while, and at least one other is a legit bug. In
Windows, if you "svn commit -F path\to\versioned\file" you don't get the
warning. It only recognizes the versioned file if forward slashes are used.
Does this look reasonable? If so, I'll track down the last couple of
failures.
DJ
Index: subversion/tests/clients/cmdline/diff_tests.py
===================================================================
--- subversion/tests/clients/cmdline/diff_tests.py (revision 7075)
+++ subversion/tests/clients/cmdline/diff_tests.py (working copy)
@@ -38,6 +38,9 @@
def check_diff_output(diff_output, name, diff_type):
"check diff output"
+# On Windows, diffs still display / rather than \ in paths
+ if svntest.main.windows == 1:
+ name = name.replace('\\', '/')
i_re = re.compile('^Index:')
d_re = re.compile('^Index: (\\./)?' + name)
p_re = re.compile('^--- (\\./)?' + name)
Index: subversion/tests/clients/cmdline/copy_tests.py
===================================================================
--- subversion/tests/clients/cmdline/copy_tests.py (revision 7075)
+++ subversion/tests/clients/cmdline/copy_tests.py (working copy)
@@ -400,8 +400,7 @@
# Use 'svn cp -r 1 URL URL' to resurrect the deleted directory, where
# the two URLs are identical. This used to trigger a failure.
- url = svntest.main.test_area_url + '/' \
- + svntest.main.current_repo_dir + '/A/D/G'
+ url = svntest.main.current_repo_url + '/A/D/G'
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
'--username', svntest.main.wc_author,
'--password', svntest.main.wc_passwd,
@@ -604,8 +603,7 @@
# REPOS to WC copy of file with properties
rho_url_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho_url')
- rho_url = svntest.main.test_area_url + '/' \
- + svntest.main.current_repo_dir + '/A/D/G/rho'
+ rho_url = svntest.main.current_repo_url + '/A/D/G/rho'
svntest.actions.run_and_verify_svn(None, None, [],
'copy', rho_url, rho_url_path)
@@ -930,7 +928,7 @@
sbox.build()
- root = svntest.main.test_area_url + '/' + svntest.main.current_repo_dir
+ root = svntest.main.current_repo_url
mu = root + '/A/mu'
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
Index: subversion/tests/clients/cmdline/basic_tests.py
===================================================================
--- subversion/tests/clients/cmdline/basic_tests.py (revision 7075)
+++ subversion/tests/clients/cmdline/basic_tests.py (working copy)
@@ -1079,8 +1079,7 @@
wc_dir)
# Now try to checkout revision 1 of A/D.
- url = svntest.main.test_area_url + '/' + svntest.main.current_repo_dir + \
- '/A/D'
+ url = svntest.main.current_repo_url + '/A/D'
wc2 = os.path.join (sbox.wc_dir, 'new_D')
svntest.actions.run_and_verify_svn("error checking out r1 of A/D",
None, [], 'co', '-r', '1',
@@ -1164,7 +1163,7 @@
svntest.main.file_append(new_path, "some text")
# import new files into repository
- url = os.path.join(svntest.main.current_repo_url, "dirA/dirB/new_file")
+ url = svntest.main.current_repo_url + "/dirA/dirB/new_file"
output, errput = svntest.actions.run_and_verify_svn(
'Cannot change node kind', None, [], 'import',
'--username', svntest.main.wc_author,
@@ -1503,7 +1502,7 @@
open(foo_o_path, 'w')
# import new dir into repository
- url = os.path.join(svntest.main.current_repo_url, 'dir')
+ url = svntest.main.current_repo_url + '/dir'
output, errput = svntest.actions.run_and_verify_svn(
None, None, [], 'import',
Index: subversion/tests/clients/cmdline/trans_tests.py
===================================================================
--- subversion/tests/clients/cmdline/trans_tests.py (revision 7075)
+++ subversion/tests/clients/cmdline/trans_tests.py (working copy)
@@ -29,19 +29,6 @@
Item = svntest.wc.StateItem
-# FIXME: Someday we'll create expected output with the right kind
-# of path separator; but the client doesn't consistently
-# use local style in output yet.
-def _tweak_paths(list):
- if os.sep != "/":
- tweaked_list = []
- for line in list:
- tweaked_list.append(string.replace(line, os.sep, "/"))
- return tweaked_list
- else:
- return list
-
-
######################################################################
# THINGS TO TEST
#
@@ -439,8 +426,6 @@
expected_output = ["Sending " + foo_path + "\n",
"Transmitting file data .\n",
"Committed revision 3.\n"]
- # FIXME: see commend at _tweak_paths
- expected_output = _tweak_paths(expected_output)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'ci', '-m', 'log msg', foo_path)
Index: subversion/tests/clients/cmdline/schedule_tests.py
===================================================================
--- subversion/tests/clients/cmdline/schedule_tests.py (revision 7075)
+++ subversion/tests/clients/cmdline/schedule_tests.py (working copy)
@@ -30,19 +30,6 @@
Item = svntest.wc.StateItem
-# FIXME: Someday we'll create expected output with the right kind
-# of path separator; but the client doesn't consistently
-# use local style in output yet.
-def _tweak_paths(list):
- if os.sep != "/":
- tweaked_list = []
- for line in list:
- tweaked_list.append(string.replace(line, os.sep, "/"))
- return tweaked_list
- else:
- return list
-
-
######################################################################
# Tests
#
@@ -281,7 +268,6 @@
'--recursive', wc_dir)
### do we really need to sort these?
- output = _tweak_paths(output) # FIXME: see comment at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
@@ -307,7 +293,6 @@
'--recursive', wc_dir)
### do we really need to sort these?
- output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
@@ -332,7 +317,6 @@
'revert',
'--recursive', wc_dir)
### do we really need to sort these?
- output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
@@ -363,7 +347,6 @@
'--recursive', wc_dir)
### do we really need to sort these?
- expected_output = _tweak_paths(expected_output)
output.sort()
expected_output.sort()
if output != expected_output:
@@ -390,7 +373,6 @@
'revert',
'--recursive', wc_dir)
### do we really need to sort these?
- output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
@@ -425,7 +407,6 @@
'revert',
'--recursive', wc_dir)
### do we really need to sort these?
- output = _tweak_paths(output) # FIXME: see commend at _tweak_paths
output.sort()
expected_output.sort()
if output != expected_output:
Index: subversion/tests/clients/cmdline/svntest/actions.py
===================================================================
--- subversion/tests/clients/cmdline/svntest/actions.py (revision 7075)
+++ subversion/tests/clients/cmdline/svntest/actions.py (working copy)
@@ -76,6 +76,8 @@
# build a URL for doing an import.
url = main.test_area_url + '/' + main.pristine_dir
+ if main.windows == 1:
+ url = url.replace('\\', '/')
# import the greek tree, using l:foo/p:bar
### todo: svn should not be prompting for auth info when using
Index: subversion/tests/clients/cmdline/svntest/main.py
===================================================================
--- subversion/tests/clients/cmdline/svntest/main.py (revision 7075)
+++ subversion/tests/clients/cmdline/svntest/main.py (working copy)
@@ -81,32 +81,6 @@
windows = 1
file_schema_prefix = 'file:///'
_exe = '.exe'
-
- # svn on windows doesn't support backslashes in path names
- _os_path_abspath_orig = os.path.abspath
- def _os_path_abspath(arg):
- path = _os_path_abspath_orig(arg)
- return path.replace('\\', '/')
- os.path.abspath = _os_path_abspath
-
- _os_path_join_orig = os.path.join
- def _os_path_join(*args):
- path = apply(_os_path_join_orig, args)
- return path.replace('\\', '/')
- os.path.join = _os_path_join
-
- _os_path_normpath_orig = os.path.normpath
- def _os_path_normpath(arg):
- path = _os_path_normpath_orig(arg)
- return path.replace('\\', '/')
- os.path.normpath = _os_path_normpath
-
- _os_path_dirname_orig = os.path.dirname
- def _os_path_dirname(arg):
- path = _os_path_dirname_orig(arg)
- return path.replace('\\', '/')
- os.path.dirname = _os_path_dirname
-
else:
windows = 0
file_schema_prefix = 'file://'
@@ -131,7 +105,10 @@
# Global URL to testing area. Default to ra_local, current working dir.
test_area_url = file_schema_prefix + os.path.abspath(os.getcwd())
+if windows == 1:
+ test_area_url = test_area_url.replace('\\', '/')
+
# Where we want all the repositories and working copies to live.
# Each test will have its own!
general_repo_dir = "repositories"
@@ -382,6 +359,8 @@
global current_repo_dir, current_repo_url
current_repo_dir = repo_dir
current_repo_url = test_area_url + '/' + repo_dir
+ if windows == 1:
+ current_repo_url = current_repo_url.replace('\\', '/')
######################################################################
@@ -395,6 +374,8 @@
self.wc_dir = os.path.join(general_wc_dir, self.name)
self.repo_dir = os.path.join(general_repo_dir, self.name)
self.repo_url = test_area_url + '/' + self.repo_dir
+ if windows == 1:
+ self.repo_url = self.repo_url.replace('\\', '/')
self.test_paths = [self.wc_dir, self.repo_dir]
def build(self):
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 17 06:12:35 2003