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

Adrian Buehlmann adrian at cadifra.com
Tue Jun 19 18:19:29 CDT 2012


On 2012-06-20 00:41, Eduard-Cristian Stefan wrote:
> On 2012-06-20 00:22, Adrian Buehlmann wrote:
>>> @@ -509,8 +511,14 @@
>>>
>>>   Test forgetting files, not implemented in git subrepo, used to
>>>   traceback
>>> -  $ hg forget 'notafile*'
>>> -  notafile*: No such file or directory
>>> +#if unix-permissions
>>
>> Why unix-permissions? I think you possibly might want #if no-windows (?)
> 
> bebe376b938f. Also based on usage:
> 
> - "#if unix-permissions" it's used in 7 tests
> - "#if no-windows" appears only in test-add.t
> - "#if windows" appears only in test-hook.t

Hmm. Why should the number of uses of these be relevant for answering my
question here?

bebe376b938f uses chmod, so that's certainly justified there. But why here?

Near as I can tell, you don't do anything related to unix-permissions
inside that block (e.g. chmod etc.)?

Can you explain what you want to achieve?

To me, it looks like you have different error messages based on what
platform it is: windows versus non-windows.

But maybe I am misunderstanding something here...

>>> +  $ hg forget 'notafile'
>>> +  notafile: No such file or directory
>>>     [1]
>>> +#elsif
>>
>> That's basically a syntax error here (only #else is implemented), but
>> run-tests.py will parse it as a comment, it will thus continue to skip
>> the following commands (and output lines) if run on Windows, until the
>> #endif is reached. In other words: your #elsif is ignored.
> 
> My mistake.

No problem. At least I had something to spot :-)

As a side note, I tried to add a check for this error to
contrib/check-code.py, but failed. As I understand it, everything behind
a # in *.t files seems to be considered a comment and thus pypasses the
other checks.

So this would need some deeper regex wizardry there, which I wasn't
exactly willing to invest.

>> (So I do wonder a bit how you have tested this patch...:-)
> 
> Only on Windows.

Ok. Then that whole #if ... #endif block was skipped anyway.

>>> +  $ hg forget 'notafile'
>>> +  notafile: The system cannot find the file specified
>>
>> That sounds like a Windows error text, which perhaps should be (glob)'ed
>> away for those people using a non-English Windows (e.g. German) [see a
>> recent comment by Mads to one of my patches]
> 
> Something like "notafile: * (glob)" ?

I'd say so, yes.


More information about the Mercurial-devel mailing list