hgext3rd/topic/__init__.py
changeset 1950 99c1a26abf3f
parent 1949 79c08d17a3d7
child 1951 0309cac5d91d
equal deleted inserted replaced
1949:79c08d17a3d7 1950:99c1a26abf3f
    15 import re
    15 import re
    16 
    16 
    17 from mercurial.i18n import _
    17 from mercurial.i18n import _
    18 from mercurial import (
    18 from mercurial import (
    19     branchmap,
    19     branchmap,
    20     changegroup,
       
    21     cmdutil,
    20     cmdutil,
    22     commands,
    21     commands,
    23     context,
    22     context,
    24     error,
    23     error,
    25     extensions,
    24     extensions,
    88 def uisetup(ui):
    87 def uisetup(ui):
    89     destination.modsetup(ui)
    88     destination.modsetup(ui)
    90     topicrevset.modsetup(ui)
    89     topicrevset.modsetup(ui)
    91     discovery.modsetup(ui)
    90     discovery.modsetup(ui)
    92     setupimportexport(ui)
    91     setupimportexport(ui)
    93 
       
    94 def cgapply(orig, repo, *args, **kwargs):
       
    95     with topicmap.usetopicmap(repo):
       
    96         return orig(repo, *args, **kwargs)
       
    97 
    92 
    98 def reposetup(ui, repo):
    93 def reposetup(ui, repo):
    99     orig = repo.__class__
    94     orig = repo.__class__
   100     if not isinstance(repo, localrepo.localrepository):
    95     if not isinstance(repo, localrepo.localrepository):
   101         return # this can be a peer in the ssh case (puzzling)
    96         return # this can be a peer in the ssh case (puzzling)
   341 entry[1].append(('t', 'topic', '',
   336 entry[1].append(('t', 'topic', '',
   342                  _("use specified topic"), _('TOPIC')))
   337                  _("use specified topic"), _('TOPIC')))
   343 
   338 
   344 extensions.wrapfunction(cmdutil, 'buildcommittext', committextwrap)
   339 extensions.wrapfunction(cmdutil, 'buildcommittext', committextwrap)
   345 extensions.wrapfunction(merge, 'update', mergeupdatewrap)
   340 extensions.wrapfunction(merge, 'update', mergeupdatewrap)
   346 extensions.wrapfunction(changegroup.cg1unpacker, 'apply', cgapply)
       
   347 cmdutil.summaryhooks.add('topic', summaryhook)
   341 cmdutil.summaryhooks.add('topic', summaryhook)
   348 
   342