diff hgext/uncommit.py @ 34292:7b1e524ad73f

uncommit: add an experimental.uncommitondirtywdir config There are people who wants to do `hg uncommit` on dirty working directory, so this patch adds a config which can be used to the achieve that. Adds tests for the same. Differential Revision: https://phab.mercurial-scm.org/D735
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 20 Sep 2017 02:40:25 +0530
parents 624c53e4121d
children 9ea416a4b4f7
line wrap: on
line diff
--- a/hgext/uncommit.py	Wed Sep 20 02:18:01 2017 +0530
+++ b/hgext/uncommit.py	Wed Sep 20 02:40:25 2017 +0530
@@ -149,7 +149,8 @@
     with repo.wlock(), repo.lock():
         wctx = repo[None]
 
-        if not pats:
+        if not pats and not repo.ui.configbool('experimental',
+                                                'uncommitondirtywdir', False):
             cmdutil.bailifchanged(repo)
         if wctx.parents()[0].node() == node.nullid:
             raise error.Abort(_("cannot uncommit null changeset"))