bundle2.unbundlepart: tell() implementation
Keep track of how many bytes we've returned from read(); fairly straightforward.
--- a/mercurial/bundle2.py Wed Jan 14 14:46:23 2015 -0800
+++ b/mercurial/bundle2.py Wed Jan 14 15:57:57 2015 -0800
@@ -828,6 +828,7 @@
self._readheader()
self._mandatory = None
self._chunkindex = [] #(payload, file) position tuples for chunk starts
+ self._pos = 0
def _fromheader(self, size):
"""return the next <size> byte from the header"""
@@ -930,8 +931,12 @@
data = self._payloadstream.read(size)
if size is None or len(data) < size:
self.consumed = True
+ self._pos += len(data)
return data
+ def tell(self):
+ return self._pos
+
capabilities = {'HG2Y': (),
'b2x:listkeys': (),
'b2x:pushkey': (),