changeset 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
files mercurial/bundle2.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Wed Apr 16 23:18:27 2014 -0400
+++ b/mercurial/bundle2.py	Wed Apr 16 23:55:59 2014 -0400
@@ -340,10 +340,11 @@
     populate it. Then call `getchunks` to retrieve all the binary chunks of
     data that compose the bundle2 container."""
 
-    def __init__(self, ui):
+    def __init__(self, ui, capabilities=()):
         self.ui = ui
         self._params = []
         self._parts = []
+        self.capabilities = set(capabilities)
 
     def addparam(self, name, value=None):
         """add a stream level parameter"""