How to stop tracking a file without deleting the file

Antoine Pitrou solipsis at pitrou.net
Wed Jun 18 08:47:14 CDT 2008


Hello,

> This was discussed at length before releasing 1.0. We concluded that
> having both
> -A and -k (for --keep, as you suggest) would be confusing, and that -A and
> -f could work well together.

I had the same issue recently. I had to re-read the doc twice and decipher the
table to be reasonably sure that "-Af" wouldn't delete the file from the
working copy - and even then I wasn't completely certain until I had actually 
ran the command.

Here is a snippet from Mercurial's online help:

 -A --after    record delete for missing files
 -f --force    remove (and delete) file even if added or modified

All one can conclude from reading those two lines is that -A and -f are
incompatible, since the former claims it will not remove the file, and the
other claims it will forcibly remove it. Improving help for -A won't help,
since the help for -f will still claim -f forces doing something -A claims
it prevents doing.

The very fact that there has to be a table in order to correctly specify the
behaviour of each option combination signals that something is wrong.

So I'd say --keep would definitely be an improvement. I don't see how it's
"confusing" that it does the same as -Af. There are lots of tools which have
this kind of useful aliases. Think "cp -a".

(I'd even propose that the "-Af" combination is actively forbidden since it is
so ambiguous. But I suppose it would be a bit too much for many users :-))

Regards

Antoine.




More information about the Mercurial mailing list