# HG changeset patch # User Matt Harbison # Date 2017-12-16 16:32:10 # Node ID 991e4404e910e4fc420ae5ee25dc1872b1f23577 # Parent b86f52426396ea5d674ece0b40f3f156a535cee7 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution The rule only triggered on non Windows platforms, even though Windows also required an adjustment. Automatic seems better. The aggressive globbing in test-subrepo-svn.t was found and rewritten by the substitution. diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -181,8 +181,6 @@ utestpats = [ (uprefix + r'.*:\.\S*/', "x:.y in a path does not work on msys, rewrite " "as x://.y, or see `hg log -k msys` for alternatives", r'-\S+:\.|' #-Rxxx '# no-msys'), # in test-pull.t which is skipped on windows - (r'^ .*file://\$TESTTMP', - 'write "file:/*/$TESTTMP" + (glob) to match on windows too'), (r'^ [^$>].*27\.0\.0\.1', 'use $LOCALIP not an explicit loopback address'), (r'^ (?![>$] ).*\$LOCALIP.*[^)]$', diff --git a/tests/common-pattern.py b/tests/common-pattern.py --- a/tests/common-pattern.py +++ b/tests/common-pattern.py @@ -38,6 +38,14 @@ substitutions = [ (br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "GET', br' - - [$LOGDATE$] "GET' ), + # Windows has an extra '/' in the following lines that get globbed away: + # pushing to file:/*/$TESTTMP/r2 (glob) + # comparing with file:/*/$TESTTMP/r2 (glob) + # sub/maybelarge.dat: largefile 34..9c not available from + # file:/*/$TESTTMP/largefiles-repo (glob) + (br'(.*file:/)/?(/\$TESTTMP.*)', + lambda m: m.group(1) + b'*' + m.group(2) + b' (glob)' + ), ] # Various platform error strings, keyed on a common replacement string diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t --- a/tests/test-subrepo-svn.t +++ b/tests/test-subrepo-svn.t @@ -91,10 +91,10 @@ debugsub $ hg debugsub path s - source file://*/svn-repo/src (glob) + source file:/*/$TESTTMP/svn-repo/src (glob) revision 2 path subdir/s - source file://*/svn-repo/src (glob) + source file:/*/$TESTTMP/svn-repo/src (glob) revision 2 change file in svn and hg, commit @@ -117,10 +117,10 @@ change file in svn and hg, commit At revision 3. $ hg debugsub path s - source file://*/svn-repo/src (glob) + source file:/*/$TESTTMP/svn-repo/src (glob) revision 3 path subdir/s - source file://*/svn-repo/src (glob) + source file:/*/$TESTTMP/svn-repo/src (glob) revision 2 missing svn file, commit should fail @@ -239,10 +239,10 @@ debugsub in clone $ hg debugsub path s - source file://*/svn-repo/src (glob) + source file:/*/$TESTTMP/svn-repo/src (glob) revision 3 path subdir/s - source file://*/svn-repo/src (glob) + source file:/*/$TESTTMP/svn-repo/src (glob) revision 2 verify subrepo is contained within the repo directory