[PATCH] run-tests: alias hg to hg.exe for Windows

Adrian Buehlmann adrian at cadifra.com
Wed Jun 27 04:26:30 CDT 2012


On 2012-06-27 03:17, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian at cadifra.com>
> # Date 1340759693 -7200
> # Node ID 52b63762a69feaf2e2a959a41a4d6947d0c922b0
> # Parent  ab4644c3064fd12738b18d6f65c6acd5799d57b3
> run-tests: alias hg to hg.exe for Windows

[..]

> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -617,6 +617,7 @@
>          script.append('set -x\n')
>      if os.getenv('MSYSTEM'):
>          script.append('alias pwd="pwd -W"\n')
> +        script.append('alias hg=hg.exe\n')
>      for n, l in enumerate(t):
>          if not l.endswith('\n'):
>              l += '\n'

Som further notes on this.

When I apply

diff --git a/hg b/hg
--- a/hg
+++ b/hg
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 #
 # mercurial - scalable distributed SCM
 #

on top of that alias patch, the following tests currently fail here:

  Failed test-acl.t: output changed
  Failed test-bisect.t: output changed
  Failed test-log.t: output changed
  Failed test-mq-subrepo.t: output changed
  Failed test-mv-cp-st-diff.t: output changed
  Failed test-pending.t: output changed
  Failed test-revset.t: output changed

when running

  $ PATH="/mingw/bin:/bin:/c/python" ./run-tests.py --local

So these are the ones which obviously still depend on the hg file being
present (despite the hg.exe being there and aliased).

Looking at, for example, test-bisect.t, it does (line 482):

  $ cat > script.sh <<'EOF'
  > #!/bin/sh
  > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
  > current="`hg log -r \"bisect(current)\" --template {node}`"
  > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
  > rev="`hg log -r $HG_NODE --template {rev}`"
  > test "$rev" -ge 6
  > EOF
  $ chmod +x script.sh
  $ hg bisect -r
  $ hg bisect --good tip --noupdate
  $ hg bisect --bad 0 --noupdate
  Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
  $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" --noupdate

The hg alias in the assembled test script (as done in run-tests.py) is obviously
not in effect in that script.sh there. Neither is the pwd alias (so pwd would work
differently there, if it were used).

It would be nice, if those aliases somehow could be injected there as well.


More information about the Mercurial-devel mailing list