Patchwork D1770: revlog: use revlog index entry type for version 0 revlogs

login
register
mail settings
Submitter phabricator
Date Dec. 27, 2017, 12:36 a.m.
Message ID <differential-rev-PHID-DREV-5bgwd7tmtcd2zji7lgtx-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26457/
State New
Headers show

Comments

phabricator - Dec. 27, 2017, 12:36 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The pure Python parser for version 1 revlogs uses it. Let's
  plug it into version 0 revlogs as well.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1770

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -278,14 +278,17 @@ 
             off += s
             e = indexformatv0_unpack(cur)
             # transform to revlogv1 format
-            e2 = (offset_type(e[0], 0), e[1], -1, e[2], e[3],
-                  nodemap.get(e[4], nullrev), nodemap.get(e[5], nullrev), e[6])
+            e2 = parsers.IndexV1Entry(offset_type(e[0], 0), e[1], -1,
+                                      e[2], e[3],
+                                      nodemap.get(e[4], nullrev),
+                                      nodemap.get(e[5], nullrev),
+                                       e[6])
             index.append(e2)
             nodemap[e[6]] = n
             n += 1
 
         # add the magic null revision at -1
-        index.append((0, 0, 0, -1, -1, -1, -1, nullid))
+        index.append(parsers.IndexV1Entry(0, 0, 0, -1, -1, -1, -1, nullid))
 
         return index, nodemap, None