Filename expansion (Re: hg add with special file names)

Jan Hudec bulb at ucw.cz
Sat Sep 24 11:23:26 CDT 2005


On Sat, Sep 24, 2005 at 17:32:03 +0200, Florian Weimer wrote:
> * Jan Hudec:
> 
> > That's allright. But I based it on the transcript in original post, which
> > showed no such error, though it probably had the error.
> 
> With mercurial 0.7, "hg add ?" does not print a warning if there is no
> single-letter file name in the directory.  Actually, this *is*
> consistent with UNIX semantics. 8-)

Not really. Each shell behaves differently and each shell can behave in
several ways depending on settings, but default behaviour (well, maybe it's
default by virtue of default distribution bashrc) for bash is to pass the
pattern unexpanded if it does not match. So the command attempts to open the
file as is

bulb at efreet:~$ ls ?
ls: ?: No such file or directory

That at least says something and would actually DWIM* for original poster.

*DWIM: do what I mean

> (I agree that wildcard expansion in file names by default is a PITA
> and should be disabled on non-Windows platforms, BTW.)

--
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.selenic.com/pipermail/mercurial/attachments/20050924/a77c681a/attachment.pgp


More information about the Mercurial mailing list