filenames with "-" and ":"
Giorgos Keramidas
keramida at ceid.upatras.gr
Sun Sep 2 16:33:19 CDT 2007
On 2007-09-01 21:40, Jens Alfke <jens at mooseyard.com> wrote:
> I haven't actually run into this, but there can be problems using 'hg'
> subcommands on files with certain types of names.
>
> * A filename starting with "-" will be interpreted as a command-line
> flag.
>
> * A filename with a ":" in it may be misinterpreted as a pattern (as
> per 7.4 of the red-bean book). For example, if there were a file
> called "glob:foo", naming it on an hg command line would cause the
> command to actually apply to a file "foo".
>
> A workaround is to put "./" before the filename, [...]
>
> It might also be worth pointing this out in the manual. Or even adding
> a special command-line flag like a plain '-' that disables special
> interpretation of all following arguments.
That's a good idea. It may be worth implementing a trick which is
popular with GNU and other toolchains, i.e.:
rm -- -dash-file
More information about the Mercurial
mailing list