D5940: uncommit: add --allowdirtywcopy when possibly hiding data (issue5977)

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Feb 15 14:39:56 EST 2019

pulkit added inline comments.


> martinvonz wrote in uncommit.py:140
> Doesn't that mean the whole patch is unnecessary? It pretty much just provides an easier way of saying `--config experimental.uncommitondirtywdir=yes`, doesn't it?

Nice point. I had to revisit the bug to understand more now. IMO the bug says as following:

`uncommit` should require a flag or config when it is trying to do the following:

1. uncommit some files which are dirty in wdir, and
2. the files are passed as `hg uncommit PATH`

(refer Yuya's comment: https://bz.mercurial-scm.org/show_bug.cgi?id=5977#c1)

However the bug was filed for evolve uncommit, it's applicable to core one also.

The core uncommit allows you to do `hg uncommit PATH` on a dirty wdir even if `experimental.uncommitondirtywdir` is set. We should change that and let `hg uncommit PATH` work only if `PATH` are not dirty in wdir. If they are dirty, use `experimental.uncommitondirtywdir`.

The end result on a dirty wdir should look like:

`hg uncommit` : abort and require `experimental.uncommitondirtywdir`
`hg uncommit PATH`: works if PATH is clean in wdir, aborts if PATH is dirty and require `experimental.uncommitondirtywdir`

How does that sound?

(Ignore my earlier comments as I didn't figured this out completely then)

(P.S. I hate to say that we have two uncommits which are kind of diverging)

  rHG Mercurial


To: navaneeth.suresh, #hg-reviewers
Cc: martinvonz, pulkit, mercurial-devel

More information about the Mercurial-devel mailing list