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

login
register
mail settings
Submitter phabricator
Date Jan. 6, 2018, 8:26 a.m.
Message ID <3e228cab1dedfb73f50b5a454a4d4c6f@localhost.localdomain>
Download mbox | patch
Permalink /patch/26589/
State Not Applicable
Headers show

Comments

phabricator - Jan. 6, 2018, 8:26 a.m.
indygreg updated this revision to Diff 4741.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1778?vs=4639&id=4741

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