[PATCH 6 of 7] configitems: move rebase config into core

Boris Feld boris.feld at octobus.net
Mon Oct 16 12:53:31 EDT 2017


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1507928431 -7200
#      Fri Oct 13 23:00:31 2017 +0200
# Node ID d64632aed1d71fd2750aca29fe09d8a2e86921cd
# Parent  bdea558e769aa4e8565f8de48610feaa6f8c0534
# EXP-Topic config.register.ready
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r d64632aed1d7
configitems: move rebase config into core

The shelve extensions import and call rebase content without loading the
extension. This is problematic as the config items rebase uses are not
declared and the default value are not set, etc...

The shelve extension should be using core utilities only and the necessary bit
should be moved from rebase into core. In the meantime, I'm taking a small
step to get config registration completed with minimal overhead. The rebase
extension is shipped with core so registering its config option within core is
not a big issue.

This is the last step needed before we can install a warning that enforces all
config to be registered.

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -73,20 +73,6 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
-configtable = {}
-configitem = registrar.configitem(configtable)
-
-configitem('commands', 'rebase.requiredest',
-            default=False,
-)
-
-configitem('experimental', 'rebaseskipobsolete',
-    default=True,
-)
-configitem('rebase', 'singletransaction',
-    default=False,
-)
-
 def _nothingtorebase():
     return 1
 
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -1075,3 +1075,16 @@
 coreconfigitem('worker', 'numcpus',
     default=None,
 )
+
+# Rebase related configuration moved to core because other extension are doing
+# strange things. For example, shelve import the extensions to reuse some bit
+# without formally loading it.
+coreconfigitem('commands', 'rebase.requiredest',
+            default=False,
+)
+coreconfigitem('experimental', 'rebaseskipobsolete',
+    default=True,
+)
+coreconfigitem('rebase', 'singletransaction',
+    default=False,
+)


More information about the Mercurial-devel mailing list