Patchwork D1779: unionrepo: 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-dtaomy5ta32uqvnps47q-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26464/
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
  This appears to be the last user of the offsets in core (as far as
  the test harness was able to reveal).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/unionrepo.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - Jan. 10, 2018, 10:54 p.m.
durin42 accepted this revision.
durin42 added a comment.
This revision is now accepted and ready to land.


  Happy to see these land, but waiting for any objections from others.

REPOSITORY
  rHG Mercurial

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

To: indygreg, #hg-reviewers, durin42
Cc: durin42, mercurial-devel
phabricator - Jan. 11, 2018, 3:13 a.m.
indygreg added a comment.


  I think we should hold off landing until the native C type is ready. I don't like shipping a performance regression on such low-level code without any other user benefit to offset it. The assumption here is that I'm the only one who will absorb pain from this series lingering. I'm willing to take that hit.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -47,10 +47,13 @@ 
         self.repotiprev = n - 1
         self.bundlerevs = set() # used by 'bundle()' revset expression
         for rev2 in self.revlog2:
-            rev = self.revlog2.index[rev2]
-            # rev numbers - in revlog2, very different from self.rev
-            _start, _csize, _rsize, base, linkrev, p1rev, p2rev, node = rev
-            flags = _start & 0xFFFF
+            entry = self.revlog2.index[rev2]
+            flags = entry.offsetflags & 0xFFFF
+            base = entry.baserev
+            linkrev = entry.linkrev
+            p1rev = entry.p1rev
+            p2rev = entry.p2rev
+            node = entry.node
 
             if linkmapper is None: # link is to same revlog
                 assert linkrev == rev2 # we never link back