diff mercurial/wireproto.py @ 19201:309c439cdbaa

bundle-ng: add bundlecaps argument to getbundle() command
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 09 Feb 2013 23:42:03 +0100
parents aae14b3d0a9c
children 5442cab57b09
line wrap: on
line diff
--- a/mercurial/wireproto.py	Fri May 10 21:03:01 2013 +0200
+++ b/mercurial/wireproto.py	Sat Feb 09 23:42:03 2013 +0100
@@ -281,13 +281,15 @@
                              bases=bases, heads=heads)
         return changegroupmod.unbundle10(self._decompress(f), 'UN')
 
-    def getbundle(self, source, heads=None, common=None):
+    def getbundle(self, source, heads=None, common=None, bundlecaps=None):
         self.requirecap('getbundle', _('look up remote changes'))
         opts = {}
         if heads is not None:
             opts['heads'] = encodelist(heads)
         if common is not None:
             opts['common'] = encodelist(common)
+        if bundlecaps is not None:
+            opts['bundlecaps'] = ','.join(bundlecaps)
         f = self._callstream("getbundle", **opts)
         return changegroupmod.unbundle10(self._decompress(f), 'UN')
 
@@ -449,9 +451,12 @@
     return repo.debugwireargs(one, two, **opts)
 
 def getbundle(repo, proto, others):
-    opts = options('getbundle', ['heads', 'common'], others)
+    opts = options('getbundle', ['heads', 'common', 'bundlecaps'], others)
     for k, v in opts.iteritems():
-        opts[k] = decodelist(v)
+        if k in ('heads', 'common'):
+            opts[k] = decodelist(v)
+        elif k == 'bundlecaps':
+            opts[k] = set(v.split(','))
     cg = repo.getbundle('serve', **opts)
     return streamres(proto.groupchunks(cg))