comparison mercurial/bundle2.py @ 21134:2f8c4fa237f5

bundle2: adds a capabilities attribute on bundler20 This attribute conveys the capabilities supported by the destination of the bundle. It is used to decide which parts to include in the bundle. This is currently a set but will probably be turned into a dictionary to allow capabilities with values.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 16 Apr 2014 23:55:59 -0400
parents bef4a2adc532
children 98fbf3adfd83
comparison
equal deleted inserted replaced
21133:bef4a2adc532 21134:2f8c4fa237f5
338 338
339 Use the `addparam` method to add stream level parameter. and `addpart` to 339 Use the `addparam` method to add stream level parameter. and `addpart` to
340 populate it. Then call `getchunks` to retrieve all the binary chunks of 340 populate it. Then call `getchunks` to retrieve all the binary chunks of
341 data that compose the bundle2 container.""" 341 data that compose the bundle2 container."""
342 342
343 def __init__(self, ui): 343 def __init__(self, ui, capabilities=()):
344 self.ui = ui 344 self.ui = ui
345 self._params = [] 345 self._params = []
346 self._parts = [] 346 self._parts = []
347 self.capabilities = set(capabilities)
347 348
348 def addparam(self, name, value=None): 349 def addparam(self, name, value=None):
349 """add a stream level parameter""" 350 """add a stream level parameter"""
350 if not name: 351 if not name:
351 raise ValueError('empty parameter name') 352 raise ValueError('empty parameter name')