D1778: debugcommands: use named attributes on revlog index entries

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Dec 27 00:36:40 UTC 2017


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

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
 



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


More information about the Mercurial-devel mailing list