changeset 34758:9ea416a4b4f7

configitems: register the 'experimental.uncommitondirtywdir' config
author Boris Feld <boris.feld@octobus.net>
date Thu, 12 Oct 2017 00:38:18 +0200
parents 8cf0a6cd1ed2
children cd7bf9ad0e69
files hgext/uncommit.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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"))