[PATCH 1 of 2] testlib: move the prune alias into a shell script for Windows

Matt Harbison mharbison72 at gmail.com
Sun Apr 16 01:36:16 EDT 2017


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1492316978 14400
#      Sun Apr 16 00:29:38 2017 -0400
# Node ID 01b8058372c5e1344ed5a83ce5968c2ce6906157
# Parent  4c2c30bc38b4f84ce8f215146bbf158e299065b3
testlib: move the prune alias into a shell script for Windows

Cramming all of this directly into an alias doesn't play nicely on Windows.
Various test-exchange-obsmarkers-case-XX.t were failing with:

    abort: cannot select revision when creating marker

It turned out that inside debugcommands.debugobsolete(), the following differed
from Linux (where they were empty, at least in the case I debugged):

    'rev': ['.`;'],
    'template': "'{node}\\n'"

diff --git a/tests/testlib/exchange-obsmarker-util.sh b/tests/testlib/exchange-obsmarker-util.sh
--- a/tests/testlib/exchange-obsmarker-util.sh
+++ b/tests/testlib/exchange-obsmarker-util.sh
@@ -1,6 +1,14 @@
 #!/bin/sh
 # setup config and various utility to test obsolescence marker exchanges tests
 
+
+cat >> $TESTTMP/prune.sh << EOF
+rev=\`hg log --hidden --template '{node}\n' --rev "\$3"\`
+
+hg debugobsolete --record-parents \$1 "\$2" \$rev \
+   && hg up --quiet 'max((::.) - obsolete())'
+EOF
+
 cat >> $HGRCPATH <<EOF
 [web]
 # We test http pull and push, drop authentication requirement
@@ -29,8 +37,7 @@
 # fix date used to create obsolete markers.
 debugobsolete=debugobsolete -d '0 0'
 # poor man substiture to the evolve 'hg prune'. using prune makes the test clearer and 
-prune =!hg debugobsolete --record-parents \$1 "\$2" \`hg log --hidden --template '{node}\n' --rev "\$3"\`;\
-        hg up --quiet 'max((::.) - obsolete())'
+prune = !sh $TESTTMP/prune.sh \$1 "\$2" "\$3"
 EOF
 
 mkcommit() {


More information about the Mercurial-devel mailing list