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").
--- a/mercurial/localrepo.py Fri Apr 28 01:13:07 2017 +0530
+++ b/mercurial/localrepo.py Wed May 03 10:33:26 2017 -0700
@@ -164,7 +164,7 @@
**kwargs)
cb = util.chunkbuffer(chunks)
- if bundlecaps is not None and 'HG20' in bundlecaps:
+ if exchange.bundle2requested(bundlecaps):
# When requesting a bundle2, getbundle returns a stream to make the
# wire level function happier. We need to build a proper object
# from it in local peer.