D5940: uncommit: make experimental.uncommitondirtydir to work on PATH (issue5977)

navaneeth.suresh (Navaneeth Suresh) phabricator at mercurial-scm.org
Sat Feb 16 00:13:29 EST 2019

navaneeth.suresh marked 4 inline comments as done.
navaneeth.suresh added inline comments.


> pulkit wrote in uncommit.py:140
> 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)

I quite like the idea. This should be a quick fix. I've updated the revision and edited the summary. Please see if it works as expected. In this revision, I'm doing only one thing. For the case of an outstanding uncommitted merge, I will be sending another patch as a follow-up.

  rHG Mercurial


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

More information about the Mercurial-devel mailing list