configitems: register the 'experimental.uncommitondirtywdir' config
authorBoris Feld <boris.feld@octobus.net>
Thu, 12 Oct 2017 00:38:18 +0200
changeset 34758 9ea416a4b4f7
parent 34757 8cf0a6cd1ed2
child 34759 cd7bf9ad0e69
configitems: register the 'experimental.uncommitondirtywdir' config
hgext/uncommit.py
--- a/hgext/uncommit.py	Fri Oct 13 22:28:03 2017 +0200
+++ b/hgext/uncommit.py	Thu Oct 12 00:38:18 2017 +0200
@@ -36,6 +36,13 @@
 cmdtable = {}
 command = registrar.command(cmdtable)
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('experimental', 'uncommitondirtywdir',
+    default=False,
+)
+
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or
@@ -150,7 +157,7 @@
         wctx = repo[None]
 
         if not pats and not repo.ui.configbool('experimental',
-                                                'uncommitondirtywdir', False):
+                                                'uncommitondirtywdir'):
             cmdutil.bailifchanged(repo)
         if wctx.parents()[0].node() == node.nullid:
             raise error.Abort(_("cannot uncommit null changeset"))