localrepo: reuse exchange.bundle2requested()
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 03 May 2017 10:33:26 -0700
changeset 32198 9a9d54ae9963
parent 32197 2cfdf5241096
child 32199 282b288aa20c
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").
mercurial/localrepo.py
--- 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.