changeset 2042:206a7b864c05

exthelper: add a 'merge' method This will help us spread more code in different sub module.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sat, 04 Mar 2017 01:43:36 +0100
parents 3b6550261614
children c64300906a32
files hgext3rd/evolve/exthelper.py
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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