[PATCH evolve-ext] exthelper: drop Mercurial 4.3 support

Matt Harbison mharbison72 at gmail.com
Sun Nov 11 04:57:39 UTC 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1541912086 18000
#      Sat Nov 10 23:54:46 2018 -0500
# Node ID 58afc797eaeba9c1d20e41fc832d70aef0f0e6b2
# Parent  2d9902f0ff175ff5e1baa4a4d8f7f37c7c9c7bf5
exthelper: drop Mercurial 4.3 support

The last release email noted plans to drop 4.3 and 4.4 support in the next
feature release.  I'd like to move this code into core, and dropping this should
allow the class to be copied in unmodified.

diff --git a/hgext3rd/evolve/exthelper.py b/hgext3rd/evolve/exthelper.py
--- a/hgext3rd/evolve/exthelper.py
+++ b/hgext3rd/evolve/exthelper.py
@@ -4,6 +4,7 @@
 
 from mercurial import (
     commands,
+    configitems,
     extensions,
     registrar,
     revset,
@@ -11,13 +12,6 @@
     util,
 )
 
-configitem = None
-dynamicdefault = None
-if util.safehasattr(registrar, 'configitem'):
-    configitem = registrar.configitem
-    from mercurial import configitems
-    dynamicdefault = configitems.dynamicdefault
-
 class exthelper(object):
     """Helper for modular extension setup
 
@@ -49,20 +43,12 @@
             self.command._doregister = _newdoregister
 
         self.configtable = {}
-        self._configitem = None
-        if configitem is not None:
-            self._configitem = configitem(self.configtable)
-
-    def configitem(self, section, config):
-        """For Mercurial 4.4 and above, register a config item
+        self._configitem = registrar.configitem(self.configtable)
 
-        For now constraint to 'dynamicdefault' until we only support version with the feature.
-        Older version would otherwise not use the declare default.
-
-        For older version no-op fallback for old Mercurial versions
+    def configitem(self, section, config, default=configitems.dynamicdefault):
+        """Register a config item.
         """
-        if self._configitem is not None:
-            self._configitem(section, config, default=dynamicdefault)
+        self._configitem(section, config, default=default)
 
     def merge(self, other):
         self._uicallables.extend(other._uicallables)


More information about the Mercurial-devel mailing list