Mercurial > public > mercurial-scm > hg
comparison mercurial/wireproto.py @ 24649:2d15c59a001b
bundle2: detect bundle2 stream/request on /HG2./ instead of /HG2Y/
To support more bundle2 formats, we need a wider detection of bundle2-family
streams. The various places what were explicitly detecting the full magic string
are now matching on the first three characters of it.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 07 Apr 2015 16:01:32 -0700 |
parents | 60fecc5b14a4 |
children | e0e28e910fa3 |
comparison
equal
deleted
inserted
replaced
24648:5cac3accdaa1 | 24649:2d15c59a001b |
---|---|
361 raise KeyError('unknown getbundle option type %s' | 361 raise KeyError('unknown getbundle option type %s' |
362 % keytype) | 362 % keytype) |
363 opts[key] = value | 363 opts[key] = value |
364 f = self._callcompressable("getbundle", **opts) | 364 f = self._callcompressable("getbundle", **opts) |
365 bundlecaps = kwargs.get('bundlecaps') | 365 bundlecaps = kwargs.get('bundlecaps') |
366 if bundlecaps is not None and 'HG2Y' in bundlecaps: | 366 if bundlecaps is None: |
367 bundlecaps = () # kwargs could have it to None | |
368 if util.any((cap.startswith('HG2') for cap in bundlecaps)): | |
367 return bundle2.getunbundler(self.ui, f) | 369 return bundle2.getunbundler(self.ui, f) |
368 else: | 370 else: |
369 return changegroupmod.cg1unpacker(f, 'UN') | 371 return changegroupmod.cg1unpacker(f, 'UN') |
370 | 372 |
371 def unbundle(self, cg, heads, source): | 373 def unbundle(self, cg, heads, source): |