test-subrepo-git.t on windows

Mads Kiilerich mads at kiilerich.com
Tue Jun 19 08:00:17 CDT 2012


On 19/06/12 14:39, Eduard-Cristian Stefan wrote:
> Is it ok to test for Windows in subrepo.py and use 'git.cmd' instead of 'git'
> in the subprocess.Popen call in _gitnodir?

I assume you have done some analysis that shows that it would be ok? 
Please tell us what you have found so we can agree or disagree and add 
to that.

I also wonder why 'hghave git' succeeds if the git invocation in 
subrepo.py fails. That must be a bug in one of the places. But the git 
convert tests do apparently run without hardcoding and .cmd. It seems 
like it does something more right than subrepo.

it also seems strange that git on windows _always_ uses a git.cmd, and 
it might thus not be a good idea to hardcode it. I don't know. If you 
know then please tell.

> Also, the output of the hg forget call will be updated.
> --- d:\hg\tests\test-subrepo-git.t
> +++ d:\hg\tests\test-subrepo-git.t.err
> @@ -512,7 +512,7 @@
>   Test forgetting files, not implemented in git subrepo, used to
>   traceback
>     $ hg forget 'notafile*'
> -  notafile*: No such file or directory
> +  notafile*: The filename, directory name, or volume label syntax is incorrect
>     [1]

The general way to handle different error messages is to use
notafile*: * (glob)

BUT it seems like it fails on windows because the filename with '*' is 
invalid - not because the file doesn't exist. The test will thus not 
test what it was supposed to test, and it might thus be better to also 
change the test to use another filename instead of just muting the wrong 
error message.

Patrick (17a1f7690b49)?

/Mads


More information about the Mercurial-devel mailing list