tests: the cd-level issue

Pierre-Yves David pierre-yves.david at logilab.fr
Mon Jun 11 04:21:40 CDT 2012


On Sat, Jun 09, 2012 at 01:38:34PM +0200, Adrian Buehlmann wrote:
> I'd still like to attack the (small?) problem in the tests, where the
> current working directory (=pwd) is driven too high up by an erroneous
> "cd .." in a test.
> 
> test-commit.t has that problem, as already reported.
> 
> A quick and dirty temporary hack I found to be useful to find the exact
> place where it happens is:


> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -613,12 +613,13 @@
> 
>      script = []
>      if options.debug:
>          script.append('set -x\n')
>      if os.getenv('MSYSTEM'):
>          script.append('alias pwd="pwd -W"\n')
> +    script.append('alias cd="pwd; cd"\n')
>      for n, l in enumerate(t):
>          if not l.endswith('\n'):
>              l += '\n'
>          if l.startswith('#if'):
>              if skipping is not None:
>                  after.setdefault(pos, []).append('  !!! nested #if\n')

If you are creating a new alias for cd; why not just add an explicite check and
abortion when getting out of the scope ?


-- 
Pierre-Yves David

http://www.logilab.fr/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120611/d5bd6c3f/attachment.pgp>


More information about the Mercurial-devel mailing list