How to stop tracking a file without deleting the file

Dirkjan Ochtman dirkjan at ochtman.nl
Wed Jun 18 05:45:35 CDT 2008


David Frey <dpfrey <at> shaw.ca> writes:
> "after" is a way to tell Mercurial to stop tracking the files that I
> have already removed from disk.
> 
> "force" is a way of saying remove the file even if the file has been
> added, but not committed or is modified.
> 
> Somehow combining the two options means stop tracking this file, but do
> not delete it from disk.  I would prefer to see this functionality in
> its own option.  Something like --keep-file might be appropriate.

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. In this case, -A means "don't delete", presumably
because you've already done that; if you haven't, you can --force it to go
through without deleting anyway. I think the explanation in hg help rm is pretty
clear, but if you have improvements for the help text, they would be very
welcome.

I do think we won't want to add a -k option, for the reasons listed above.

Cheers,

Dirkjan



More information about the Mercurial mailing list