[PATCH 1 of 5] run-tests: test for os.altsep instead of os.name when checking \ for /
Simon Heimberg
simohe at besonet.ch
Sat Jul 13 17:25:11 CDT 2013
# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1373752675 -7200
# Node ID 982668dfa95a3adf94bd166e8a443e887774cd47
# Parent c634510b16e8c57c1bc9451e0947bbd912d6fc75
run-tests: test for os.altsep instead of os.name when checking \ for /
This tells more explicitly what it is about
diff -r c634510b16e8 -r 982668dfa95a tests/run-tests.py
--- a/tests/run-tests.py Sam Jul 13 23:15:05 2013 +0200
+++ b/tests/run-tests.py Sam Jul 13 23:57:55 2013 +0200
@@ -599,7 +599,7 @@
# The only supported special characters are * and ? plus / which also
# matches \ on windows. Escaping of these caracters is supported.
if el + '\n' == l:
- if os.name == 'nt':
+ if os.altsep:
# matching on "/" is not needed for this line
log("\nInfo, unnecessary glob: %s (glob)" % el)
return True
@@ -615,7 +615,7 @@
res += '.*'
elif c == '?':
res += '.'
- elif c == '/' and os.name == 'nt':
+ elif c == '/' and os.altsep:
res += '[/\\\\]'
else:
res += re.escape(c)
More information about the Mercurial-devel
mailing list