exthelper: add a 'merge' method
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Sat, 04 Mar 2017 01:43:36 +0100
changeset 2042 206a7b864c05
parent 2041 3b6550261614
child 2043 c64300906a32
exthelper: add a 'merge' method This will help us spread more code in different sub module.
hgext3rd/evolve/exthelper.py
--- a/hgext3rd/evolve/exthelper.py	Sat Mar 04 01:21:43 2017 +0100
+++ b/hgext3rd/evolve/exthelper.py	Sat Mar 04 01:43:36 2017 +0100
@@ -29,6 +29,18 @@
         self._functionwrappers = []
         self._duckpunchers = []
 
+    def merge(self, other):
+        """merge the data collected by another exthelper into this one"""
+        self._uicallables.extend(other._uicallables)
+        self._extcallables.extend(other._extcallables)
+        self._repocallables.extend(other._repocallables)
+        self._revsetsymbols.extend(other._revsetsymbols)
+        self._templatekws.extend(other._templatekws)
+        self._commandwrappers.extend(other._commandwrappers)
+        self._extcommandwrappers.extend(other._extcommandwrappers)
+        self._functionwrappers.extend(other._functionwrappers)
+        self._duckpunchers.extend(other._duckpunchers)
+
     def final_uisetup(self, ui):
         """Method to be used as the extension uisetup