Patchwork D1778: debugcommands: use named attributes on revlog index entries

login
register
mail settings
Submitter phabricator
Date Dec. 27, 2017, 12:36 a.m.
Message ID <differential-rev-PHID-DREV-wcwxjk35cfeezg26zibw-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26465/
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.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -610,31 +610,31 @@ 
 
     def revinfo(rev):
         e = index[rev]
-        compsize = e[1]
-        uncompsize = e[2]
+        compsize = e.chunklength
+        uncompsize = e.rawlength
         chainsize = 0
 
         if generaldelta:
-            if e[3] == e[5]:
+            if e.baserev == e.p1rev:
                 deltatype = 'p1'
-            elif e[3] == e[6]:
+            elif e.baserev == e.p2rev:
                 deltatype = 'p2'
-            elif e[3] == rev - 1:
+            elif e.baserev == rev - 1:
                 deltatype = 'prev'
-            elif e[3] == rev:
+            elif e.baserev == rev:
                 deltatype = 'base'
             else:
                 deltatype = 'other'
         else:
-            if e[3] == rev:
+            if e.baserev == rev:
                 deltatype = 'base'
             else:
                 deltatype = 'prev'
 
         chain = r._deltachain(rev)[0]
         for iterrev in chain:
             e = index[iterrev]
-            chainsize += e[1]
+            chainsize += e.chunklength
 
         return compsize, uncompsize, deltatype, chain, chainsize