hgext3rd/topic/discovery.py
changeset 2676 10dedac0d82e
parent 2675 304232cc14b6
child 2695 b4824e169f18
equal deleted inserted replaced
2675:304232cc14b6 2676:10dedac0d82e
     7     bundle2,
     7     bundle2,
     8     discovery,
     8     discovery,
     9     error,
     9     error,
    10     exchange,
    10     exchange,
    11     extensions,
    11     extensions,
       
    12     util,
    12     wireproto,
    13     wireproto,
    13 )
    14 )
    14 
    15 
    15 def _headssummary(orig, *args):
    16 def _headssummary(orig, *args):
    16     # In mercurial < 4.2, we receive repo, remote and outgoing as arguments
    17     # In mercurial < 4.2, we receive repo, remote and outgoing as arguments
   145 def modsetup(ui):
   146 def modsetup(ui):
   146     """run at uisetup time to install all destinations wrapping"""
   147     """run at uisetup time to install all destinations wrapping"""
   147     extensions.wrapfunction(discovery, '_headssummary', _headssummary)
   148     extensions.wrapfunction(discovery, '_headssummary', _headssummary)
   148     extensions.wrapfunction(wireproto, 'branchmap', wireprotobranchmap)
   149     extensions.wrapfunction(wireproto, 'branchmap', wireprotobranchmap)
   149     extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps)
   150     extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps)
       
   151     # we need a proper wrap b2 part stuff
   150     extensions.wrapfunction(bundle2, 'handlecheckheads', handlecheckheads)
   152     extensions.wrapfunction(bundle2, 'handlecheckheads', handlecheckheads)
   151     # we need a proper wrap b2 part stuff
       
   152     bundle2.handlecheckheads.params = frozenset()
   153     bundle2.handlecheckheads.params = frozenset()
   153     bundle2.parthandlermapping['check:heads'] = bundle2.handlecheckheads
   154     bundle2.parthandlermapping['check:heads'] = bundle2.handlecheckheads
       
   155     if util.safehasattr(bundle2, 'handlecheckupdatedheads'):
       
   156         # we still need a proper wrap b2 part stuff
       
   157         extensions.wrapfunction(bundle2, 'handlecheckupdatedheads', handlecheckheads)
       
   158         bundle2.handlecheckupdatedheads.params = frozenset()
       
   159         bundle2.parthandlermapping['check:updated-heads'] = bundle2.handlecheckupdatedheads
   154     extensions.wrapfunction(exchange, '_pushb2phases', _pushb2phases)
   160     extensions.wrapfunction(exchange, '_pushb2phases', _pushb2phases)
   155     exchange.b2partsgenmapping['phase'] = exchange._pushb2phases
   161     exchange.b2partsgenmapping['phase'] = exchange._pushb2phases