Mercurial > public > mercurial-scm > hg
comparison mercurial/wireproto.py @ 22390:e2806b8613ca
changegroup: rename bundle-related functions and classes
Functions like getbundle and classes like unbundle10 really manipulate
changegroups and not bundles. A HG10 bundle is the same as a changegroup
plus a small header, but this is no longer the case for a HG2X bundle,
so it's better to separate the names a bit.
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Tue, 02 Sep 2014 12:11:36 +0200 |
parents | 47e3420ae889 |
children | 90f86ad3d4ff |
comparison
equal
deleted
inserted
replaced
22389:94f77624dbb5 | 22390:e2806b8613ca |
---|---|
326 return self._callstream('stream_out') | 326 return self._callstream('stream_out') |
327 | 327 |
328 def changegroup(self, nodes, kind): | 328 def changegroup(self, nodes, kind): |
329 n = encodelist(nodes) | 329 n = encodelist(nodes) |
330 f = self._callcompressable("changegroup", roots=n) | 330 f = self._callcompressable("changegroup", roots=n) |
331 return changegroupmod.unbundle10(f, 'UN') | 331 return changegroupmod.cg1unpacker(f, 'UN') |
332 | 332 |
333 def changegroupsubset(self, bases, heads, kind): | 333 def changegroupsubset(self, bases, heads, kind): |
334 self.requirecap('changegroupsubset', _('look up remote changes')) | 334 self.requirecap('changegroupsubset', _('look up remote changes')) |
335 bases = encodelist(bases) | 335 bases = encodelist(bases) |
336 heads = encodelist(heads) | 336 heads = encodelist(heads) |
337 f = self._callcompressable("changegroupsubset", | 337 f = self._callcompressable("changegroupsubset", |
338 bases=bases, heads=heads) | 338 bases=bases, heads=heads) |
339 return changegroupmod.unbundle10(f, 'UN') | 339 return changegroupmod.cg1unpacker(f, 'UN') |
340 | 340 |
341 def getbundle(self, source, **kwargs): | 341 def getbundle(self, source, **kwargs): |
342 self.requirecap('getbundle', _('look up remote changes')) | 342 self.requirecap('getbundle', _('look up remote changes')) |
343 opts = {} | 343 opts = {} |
344 for key, value in kwargs.iteritems(): | 344 for key, value in kwargs.iteritems(): |
360 f = self._callcompressable("getbundle", **opts) | 360 f = self._callcompressable("getbundle", **opts) |
361 bundlecaps = kwargs.get('bundlecaps') | 361 bundlecaps = kwargs.get('bundlecaps') |
362 if bundlecaps is not None and 'HG2X' in bundlecaps: | 362 if bundlecaps is not None and 'HG2X' in bundlecaps: |
363 return bundle2.unbundle20(self.ui, f) | 363 return bundle2.unbundle20(self.ui, f) |
364 else: | 364 else: |
365 return changegroupmod.unbundle10(f, 'UN') | 365 return changegroupmod.cg1unpacker(f, 'UN') |
366 | 366 |
367 def unbundle(self, cg, heads, source): | 367 def unbundle(self, cg, heads, source): |
368 '''Send cg (a readable file-like object representing the | 368 '''Send cg (a readable file-like object representing the |
369 changegroup to push, typically a chunkbuffer object) to the | 369 changegroup to push, typically a chunkbuffer object) to the |
370 remote server as a bundle. | 370 remote server as a bundle. |