Patchwork [5,of,8] bundlerepo: build revlog index with flags

login
register
mail settings
Submitter Jun Wu
Date April 7, 2017, 2:08 a.m.
Message ID <352c6f9914fc04c9b325.1491530893@x1c>
Download mbox | patch
Permalink /patch/19987/
State Accepted
Headers show

Comments

Jun Wu - April 7, 2017, 2:08 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1491527202 25200
#      Thu Apr 06 18:06:42 2017 -0700
# Node ID 352c6f9914fc04c9b3251896a8a3382eb35b0289
# Parent  f05275cd80eb1afde5c36470fadf224a44733c45
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 352c6f9914fc
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.

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -66,4 +66,5 @@  class bundlerevlog(revlog.revlog):
             deltabase = chunkdata['deltabase']
             delta = chunkdata['delta']
+            flags = chunkdata['flags']
 
             size = len(delta)
@@ -88,5 +89,5 @@  class bundlerevlog(revlog.revlog):
             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)
diff --git a/tests/test-flagprocessor.t b/tests/test-flagprocessor.t
--- a/tests/test-flagprocessor.t
+++ b/tests/test-flagprocessor.t
@@ -189,5 +189,6 @@ 
   $ 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 '^(\*\*|  )'