diff mercurial/localrepo.py @ 35785:ba15580e53d5

exchange: return bundle info from getbundlechunks() (API) We generally want a mechanism to pass information about the generated bundle back to callers (in addition to the byte stream). Ideally we would return a bundler from this function and have the caller code to an interface. But the bundling APIs are not great and getbundlechunks() is the best API we have for obtaining bundle contents in a unified manner. We change getbundlechunks() to return a dict that we can use to communicate metadata. We populate that dict with the bundle version number to demonstrate some value. .. api:: exchange.getbundlechunks() now returns a 2-tuple instead of just an iterator. Differential Revision: https://phab.mercurial-scm.org/D1925
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 20 Jan 2018 13:41:57 -0800
parents c97639ad6874
children 9dad46c23185
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Jan 20 15:26:31 2018 -0800
+++ b/mercurial/localrepo.py	Sat Jan 20 13:41:57 2018 -0800
@@ -197,7 +197,7 @@
                   **kwargs):
         chunks = exchange.getbundlechunks(self._repo, source, heads=heads,
                                           common=common, bundlecaps=bundlecaps,
-                                          **kwargs)
+                                          **kwargs)[1]
         cb = util.chunkbuffer(chunks)
 
         if exchange.bundle2requested(bundlecaps):