[PATCH] test-revset: enable for Windows

Adrian Buehlmann adrian at cadifra.com
Sun Jun 3 02:08:50 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1338707175 -7200
# Node ID 8a436cee51530cff1aabee8db710d8bf882ae2c4
# Parent  7b460b49bf7b75c5a4ab444915c52802c9f97f33
test-revset: enable for Windows

In MSYS, the test fails like this if the hghave exit at the beginning is
removed:

  --- C:\Users\adi\hgrepos\hg-main\tests\test-revset.t
  +++ C:\Users\adi\hgrepos\hg-main\tests\test-revset.t.err
  @@ -58,7 +58,7 @@
     $ hg co 3
     2 files updated, 0 files merged, 0 files removed, 0 files unresolved
     $ hg branch /a/b/c/
  -  marked working directory as branch /a/b/c/
  +  marked working directory as branch a:/b/c/
     (branches are permanent and global, did you want a bookmark?)
     $ hg ci -Aqm"5 bug"

  @@ -252,7 +252,7 @@
     2 a-b-c-
     3 +a+b+c+
     4 -a-b-c-
  -  5 /a/b/c/
  +  5 a:/b/c/
     6 _a_b_c_
     7 .a.b.c.
     $ log 'children(ancestor(4,5))'

due to the posix path conversion done by MSYS globally, as explained here

  http://www.mingw.org/wiki/Posix_path_conversion

The solution is a bit lame, but it is simple and works: don't use strings that
look like '/a/b', in order not to trigger the path magic done by MSYS.

So, if we can agree not to insist on testing branch names starting with '/',
then this relatively simple patch makes the test pass both on Windows with MSYS
and Linux.

diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" no-msys || exit 80 # MSYS will translate /a/b/c/ as if it was a real file path
-
   $ HGENCODING=utf-8
   $ export HGENCODING
 
@@ -59,8 +57,8 @@
 
   $ hg co 3
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg branch /a/b/c/
-  marked working directory as branch /a/b/c/
+  $ hg branch !a/b/c/
+  marked working directory as branch !a/b/c/
   (branches are permanent and global, did you want a bookmark?)
   $ hg ci -Aqm"5 bug"
 
@@ -254,7 +252,7 @@
   2 a-b-c-
   3 +a+b+c+
   4 -a-b-c-
-  5 /a/b/c/
+  5 !a/b/c/
   6 _a_b_c_
   7 .a.b.c.
   $ log 'children(ancestor(4,5))'


More information about the Mercurial-devel mailing list