[PATCH V2] test-subrepo-git.t: adapt for Windows

Adrian Buehlmann adrian at cadifra.com
Tue Jun 19 19:14:53 CDT 2012


On 2012-06-20 01:11, alexandrul.ct at gmail.com wrote:
> # HG changeset patch
> # User Eduard-Cristian Stefan <alexandrul.ct at gmail.com>
> # Date 1340147389 -10800
> # Node ID 7f32ce540744e5d0ae353f90d33af8d6d1c9cb32
> # Parent  ee18cedec2c29a9aa2830c929225f83a6931f473
> test-subrepo-git.t: adapt for Windows
> 
> diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
> --- a/tests/test-subrepo-git.t
> +++ b/tests/test-subrepo-git.t
> @@ -2,6 +2,8 @@
>  
>  make git commits repeatable
>  
> +  $ echo "[core]" >> $HOME/.gitconfig
> +  $ echo "autocrlf = false" >> $HOME/.gitconfig
>    $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
>    $ GIT_AUTHOR_EMAIL='test at example.org'; export GIT_AUTHOR_EMAIL
>    $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE
> @@ -133,7 +135,7 @@
>  user b push changes
>  
>    $ hg push 2>/dev/null
> -  pushing to $TESTTMP/t
> +  pushing to $TESTTMP/t (glob)
>    pushing branch testing of subrepo s
>    searching for changes
>    adding changesets
> @@ -145,7 +147,7 @@
>  
>    $ cd ../ta
>    $ hg pull
> -  pulling from $TESTTMP/t
> +  pulling from $TESTTMP/t (glob)
>    searching for changes
>    adding changesets
>    adding manifests
> @@ -173,7 +175,7 @@
>     source   ../gitroot
>     revision f47b465e1bce645dbf37232a00574aa1546ca8d3
>    $ hg push 2>/dev/null
> -  pushing to $TESTTMP/t
> +  pushing to $TESTTMP/t (glob)
>    pushing branch testing of subrepo s
>    searching for changes
>    adding changesets
> @@ -205,7 +207,7 @@
>    $ echo aa >> a
>    $ hg commit -m aa
>    $ hg push
> -  pushing to $TESTTMP/t
> +  pushing to $TESTTMP/t (glob)
>    searching for changes
>    adding changesets
>    adding manifests
> @@ -292,7 +294,7 @@
>    M inner/s/f
>    $ hg commit --subrepos -m nested
>    committing subrepository inner
> -  committing subrepository inner/s
> +  committing subrepository inner/s (glob)
>  
>  nested archive
>  
> @@ -509,8 +511,8 @@
>  
>  Test forgetting files, not implemented in git subrepo, used to
>  traceback
> -  $ hg forget 'notafile*'
> -  notafile*: No such file or directory
> +  $ hg forget 'notafile'
> +  notafile: * (glob)
>    [1]
>  
>    $ cd ..

Looks good enough to me.

For http://markmail.org/message/aihppq4toyh5rres I used the pattern

#if windows
  $ <command>
  <globbed away error message>
  [<exit code>]
#else
  $ <command>
  <explicit error message we see on Linux & friends>
  [<exit code>]
#endif

Perhaps what I did there was a bit overkill, but it has the advantage
that we see the Linux error message there as a reference.

The reason is that on Windows the error message text can be in different
languages, whereas on Linux, the test environment seems to be able to
enforce English.

Mads just happened to explain that to me yesterday:

http://markmail.org/message/j3xtghm7h5wtmk7u






More information about the Mercurial-devel mailing list