test-subrepo-git.t on windows

Patrick Mézard patrick at mezard.eu
Tue Jun 19 08:29:10 CDT 2012


Le 19/06/12 15:00, Mads Kiilerich a écrit :
> 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.

Maybe try the gitsubrepo subprocess call with shell=True on Windows.

>> 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)?

I do not remember why I used that instead of a regular non-file name. I removed the '*' and the test fails as expected when updating back to 17a1f7690b49. Feel free to change it.

--
Patrick Mézard


More information about the Mercurial-devel mailing list