comparison mercurial/bundle2.py @ 22342:262c5cc126c1

bundle2: introduce a `getrepocaps` to retrieve the bundle2 caps of a repo This function lets extensions change the bundle2 capabilities of a repository.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 25 Aug 2014 19:21:47 +0200
parents 2d16b39601b5
children 76677a2c1cfd
comparison
equal deleted inserted replaced
22341:2d16b39601b5 22342:262c5cc126c1
779 'b2x:listkeys': (), 779 'b2x:listkeys': (),
780 'b2x:pushkey': (), 780 'b2x:pushkey': (),
781 'b2x:changegroup': (), 781 'b2x:changegroup': (),
782 } 782 }
783 783
784 def getrepocaps(repo):
785 """return the bundle2 capabilities for a given repo
786
787 Exists to allow extensions (like evolution) to mutate the
788 capabilities.
789 """
790 return capabilities
791
784 def bundle2caps(remote): 792 def bundle2caps(remote):
785 """return the bundlecapabilities of a peer as dict""" 793 """return the bundlecapabilities of a peer as dict"""
786 raw = remote.capable('bundle2-exp') 794 raw = remote.capable('bundle2-exp')
787 if not raw and raw != '': 795 if not raw and raw != '':
788 return {} 796 return {}