# HG changeset patch # User Mads Kiilerich # Date 1320632710 -3600 # Node ID 0a583943b4b4b42c7b368c500f190438637e00f5 # Parent 58b7f58ae08c445fb48e1ff3af8079d672d07972 tests: make (glob) on windows accept \ instead of / Globbing is usually used for filenames, so on windows it is reasonable and very convenient that glob patterns accepts '\' or '/' when the pattern specifies '/'. [ original upstream message ] diff -r 58b7f58ae08c -r 0a583943b4b4 tests/run-tests.py --- a/tests/run-tests.py Mon Nov 07 03:24:53 2011 +0100 +++ b/tests/run-tests.py Mon Nov 07 03:25:10 2011 +0100 @@ -530,20 +530,22 @@ return False def globmatch(el, l): - # The only supported special characters are * and ?. Escaping is - # supported. + # The only supported special characters are * and ? plus / which also + # matches \ on windows. Escaping of these caracters is supported. i, n = 0, len(el) res = '' while i < n: c = el[i] i += 1 - if c == '\\' and el[i] in '*?\\': + if c == '\\' and el[i] in '*?\\/': res += el[i - 1:i + 1] i += 1 elif c == '*': res += '.*' elif c == '?': res += '.' + elif c == '/' and os.name == 'nt': + res += '[/\\\\]' else: res += re.escape(c) return rematch(res, l) diff -r 58b7f58ae08c -r 0a583943b4b4 tests/test-keyword.t --- a/tests/test-keyword.t Mon Nov 07 03:24:53 2011 +0100 +++ b/tests/test-keyword.t Mon Nov 07 03:25:10 2011 +0100 @@ -210,7 +210,7 @@ Message-Id: (glob) To: Test - changeset a2392c293916 in $TESTTMP/Test + changeset a2392c293916 in $TESTTMP/Test (glob) details: $TESTTMP/Test?cmd=changeset;node=a2392c293916 description: addsym @@ -233,7 +233,7 @@ Message-Id: (glob) To: Test - changeset ef63ca68695b in $TESTTMP/Test + changeset ef63ca68695b in $TESTTMP/Test (glob) details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b description: absym @@ -799,7 +799,7 @@ > default = ../Test > EOF $ hg incoming - comparing with $TESTTMP/Test + comparing with $TESTTMP/Test (glob) searching for changes changeset: 2:bb948857c743 tag: tip