changeset 31835:4bafc80f827e

bundlerepo: build revlog index with flags This fixes bundlerevlog.flags(rev) for any revisions provided by the bundle. Now test-flagprocessor.t points us to another issue.
author Jun Wu <quark@fb.com>
date Thu, 06 Apr 2017 18:06:42 -0700
parents 433ab46f6bb4
children 4598e8f43e20
files mercurial/bundlerepo.py tests/test-flagprocessor.t
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Thu Apr 06 17:43:29 2017 -0700
+++ b/mercurial/bundlerepo.py	Thu Apr 06 18:06:42 2017 -0700
@@ -65,6 +65,7 @@
             cs = chunkdata['cs']
             deltabase = chunkdata['deltabase']
             delta = chunkdata['delta']
+            flags = chunkdata['flags']
 
             size = len(delta)
             start = bundle.tell() - size
@@ -87,7 +88,7 @@
 
             baserev = self.rev(deltabase)
             # start, size, full unc. size, base (unused), link, p1, p2, node
-            e = (revlog.offset_type(start, 0), size, -1, baserev, link,
+            e = (revlog.offset_type(start, flags), size, -1, baserev, link,
                  self.rev(p1), self.rev(p2), node)
             self.index.insert(-1, e)
             self.nodemap[node] = n
--- a/tests/test-flagprocessor.t	Thu Apr 06 17:43:29 2017 -0700
+++ b/tests/test-flagprocessor.t	Thu Apr 06 18:06:42 2017 -0700
@@ -188,7 +188,8 @@
   4 changesets found
   $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
   $ hg -R bundle.hg log --stat -T '{rev} {desc}\n' base64 2>&1 | egrep -v '^(\*\*|  )'
-  abort: integrity check failed on data/base64.i:2!
+  Traceback (most recent call last):
+  mercurial.mpatch.mpatchError: invalid patch
 
   $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q 2>&1 | egrep -v '^(\*\*|  )'
   Traceback (most recent call last):