Confusing `hg add` + `hg remove` behavior

Pierre-Yves David pierre-yves.david at
Tue Sep 6 08:35:44 EDT 2016

On 09/02/2016 04:53 PM, Augie Fackler wrote:
>> On Sep 1, 2016, at 20:54, Gregory Szorc <gregory.szorc at
>> <mailto:gregory.szorc at>> wrote:
>> One of my coworkers just blogged about confusing behavior w.r.t.
>> performing a `hg remove` on a file that was `hg add`ed but not yet
>> committed:
>> Is there room to change the behavior of `hg remove` to behave more
>> like `hg forget` in this scenario? Or is the best we can do a wording
>> change?
> The best we can do is really a wording change, because 'hg remove' wants
> to both remove the file from version control tracking *and* discard the
> file from the local filesystem. If we do the latter in this case, we've
> just caused data loss.

+1 for wording change. The behavior change is debatable in itself and a 
significant BC breakage.

Pierre-Yves David

More information about the Mercurial-devel mailing list