##// END OF EJS Templates
getbundle: support of listkeys argument when bundle2 is used...
Pierre-Yves David -
r21657:0ff44e06 default
parent child Browse files
Show More
@@ -9,7 +9,7 b' from i18n import _'
9 from node import hex, nullid
9 from node import hex, nullid
10 import errno, urllib
10 import errno, urllib
11 import util, scmutil, changegroup, base85, error
11 import util, scmutil, changegroup, base85, error
12 import discovery, phases, obsolete, bookmarks, bundle2
12 import discovery, phases, obsolete, bookmarks, bundle2, pushkey
13
13
14 def readbundle(ui, fh, fname, vfs=None):
14 def readbundle(ui, fh, fname, vfs=None):
15 header = changegroup.readexactly(fh, 4)
15 header = changegroup.readexactly(fh, 4)
@@ -678,6 +678,12 b' def getbundle(repo, source, heads=None, '
678 bundler = bundle2.bundle20(repo.ui, b2caps)
678 bundler = bundle2.bundle20(repo.ui, b2caps)
679 if cg:
679 if cg:
680 bundler.newpart('b2x:changegroup', data=cg.getchunks())
680 bundler.newpart('b2x:changegroup', data=cg.getchunks())
681 listkeys = kwargs.get('listkeys', ())
682 for namespace in listkeys:
683 part = bundler.newpart('b2x:listkeys')
684 part.addparam('namespace', namespace)
685 keys = repo.listkeys(namespace).items()
686 part.data = pushkey.encodekeys(keys)
681 _getbundleextrapart(bundler, repo, source, heads=heads, common=common,
687 _getbundleextrapart(bundler, repo, source, heads=heads, common=common,
682 bundlecaps=bundlecaps, **kwargs)
688 bundlecaps=bundlecaps, **kwargs)
683 return util.chunkbuffer(bundler.getchunks())
689 return util.chunkbuffer(bundler.getchunks())
@@ -180,7 +180,8 b' class localrepository(object):'
180 requirements = ['revlogv1']
180 requirements = ['revlogv1']
181 filtername = None
181 filtername = None
182
182
183 bundle2caps = {'HG2X': ()}
183 bundle2caps = {'HG2X': (),
184 'b2x:listkeys': ()}
184
185
185 # a list of (ui, featureset) functions.
186 # a list of (ui, featureset) functions.
186 # only functions defined in module of enabled extensions are invoked
187 # only functions defined in module of enabled extensions are invoked
@@ -202,7 +202,8 b' def unescapearg(escaped):'
202 # :plain: string with no transformation needed.
202 # :plain: string with no transformation needed.
203 gboptsmap = {'heads': 'nodes',
203 gboptsmap = {'heads': 'nodes',
204 'common': 'nodes',
204 'common': 'nodes',
205 'bundlecaps': 'csv'}
205 'bundlecaps': 'csv',
206 'listkeys': 'csv'}
206
207
207 # client side
208 # client side
208
209
General Comments 0
You need to be logged in to leave comments. Login now