mercurial/exthelper.py
branchstable
changeset 49366 288de6f5d724
parent 48946 642e31cb55f0
child 50798 d9e22b39041a
equal deleted inserted replaced
49364:e8ea403b1c46 49366:288de6f5d724
     7 
     7 
     8 #####################################################################
     8 #####################################################################
     9 ### Extension helper                                              ###
     9 ### Extension helper                                              ###
    10 #####################################################################
    10 #####################################################################
    11 
    11 
    12 from __future__ import absolute_import
       
    13 
    12 
    14 from . import (
    13 from . import (
    15     commands,
    14     commands,
    16     error,
    15     error,
    17     extensions,
    16     extensions,
    18     pycompat,
       
    19     registrar,
    17     registrar,
    20 )
    18 )
    21 
    19 
    22 from hgdemandimport import tracing
    20 from hgdemandimport import tracing
    23 
    21 
    24 
    22 
    25 class exthelper(object):
    23 class exthelper:
    26     """Helper for modular extension setup
    24     """Helper for modular extension setup
    27 
    25 
    28     A single helper should be instantiated for each module of an
    26     A single helper should be instantiated for each module of an
    29     extension, where a command or function needs to be wrapped, or a
    27     extension, where a command or function needs to be wrapped, or a
    30     command, extension hook, fileset, revset or template needs to be
    28     command, extension hook, fileset, revset or template needs to be
   113         self.templatekeyword._merge(other.templatekeyword)
   111         self.templatekeyword._merge(other.templatekeyword)
   114         self._commandwrappers.extend(other._commandwrappers)
   112         self._commandwrappers.extend(other._commandwrappers)
   115         self._extcommandwrappers.extend(other._extcommandwrappers)
   113         self._extcommandwrappers.extend(other._extcommandwrappers)
   116         self._functionwrappers.extend(other._functionwrappers)
   114         self._functionwrappers.extend(other._functionwrappers)
   117         self.cmdtable.update(other.cmdtable)
   115         self.cmdtable.update(other.cmdtable)
   118         for section, items in pycompat.iteritems(other.configtable):
   116         for section, items in other.configtable.items():
   119             if section in self.configtable:
   117             if section in self.configtable:
   120                 self.configtable[section].update(items)
   118                 self.configtable[section].update(items)
   121             else:
   119             else:
   122                 self.configtable[section] = items
   120                 self.configtable[section] = items
   123 
   121