Reporting "nearly-exact" adds

Adrian Buehlmann adrian at cadifra.com
Fri Jun 6 12:54:32 CDT 2008


On 06.06.2008 09:33, Martin Geisler wrote:
> Adrian Buehlmann <adrian at cadifra.com> writes:
> 
>> On 06.06.2008 00:54, Paul Moore wrote:
>>> Not that simply. Consider hg add a*. This has to report what matched
>>> the wildcards.
>> I think you are wrong (checked on FreeBSD):
>>
>> %hg sta
>> ? b.txt
>> ? x/a.txt
>> %hg add *txt
>> %hg sta
>> A b.txt
>> ? x/a.txt
>> %hg version
>> Mercurial Distributed SCM (version bae2e9c838e9)
>>
>> hg add returned *no* output, despite b.txt having matched
> 
> I think that is the expected behavior: the *shell* expands the *txt
> part of the command line, and so hg is invoked as 'hg add b.txt'.
> 
> So from the point of view of hg, you explicitly told it what files you
> wanted added, and it wont bother repeating those file names.
> 
> 
> As far as I know, the Windows shell wont expand filenames before
> invoking programs, so I guess hg does the expansion there.

Good point! (regarding shell expansion).

But:

hg add a*

on Windows (plain, unpatched hg) doesn't output anything either.
So Mercurial on Windows matches the unix behaviour in that
regard (which is cool).



More information about the Mercurial-devel mailing list