comparison mercurial/localrepo.py @ 32149:9a9d54ae9963

localrepo: reuse exchange.bundle2requested() It seems like localrepo.getbundle() is trying to do the same thing, so let's just call the method. That way we get the same condition as there (matching any "HG2" prefix, not only "HG20").
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 03 May 2017 10:33:26 -0700
parents 5f8450df5562
children 85ef5a073114
comparison
equal deleted inserted replaced
32148:2cfdf5241096 32149:9a9d54ae9963
162 chunks = exchange.getbundlechunks(self._repo, source, heads=heads, 162 chunks = exchange.getbundlechunks(self._repo, source, heads=heads,
163 common=common, bundlecaps=bundlecaps, 163 common=common, bundlecaps=bundlecaps,
164 **kwargs) 164 **kwargs)
165 cb = util.chunkbuffer(chunks) 165 cb = util.chunkbuffer(chunks)
166 166
167 if bundlecaps is not None and 'HG20' in bundlecaps: 167 if exchange.bundle2requested(bundlecaps):
168 # When requesting a bundle2, getbundle returns a stream to make the 168 # When requesting a bundle2, getbundle returns a stream to make the
169 # wire level function happier. We need to build a proper object 169 # wire level function happier. We need to build a proper object
170 # from it in local peer. 170 # from it in local peer.
171 return bundle2.getunbundler(self.ui, cb) 171 return bundle2.getunbundler(self.ui, cb)
172 else: 172 else: