Patchwork D3043: narrow: pass node into revlog.revision()

login
register
mail settings
Submitter phabricator
Date April 3, 2018, 5:54 p.m.
Message ID <differential-rev-PHID-DREV-eetnq7ukemv245zt7vvw-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30199/
State Superseded
Headers show

Comments

phabricator - April 3, 2018, 5:54 p.m.
indygreg created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is one of the few (possibly only) places where we pass an int in
  for filelogs. Other revlogs (notably changelog) are very heavy on int
  usage. But filelogs are surprisingly node centric. I'd like to
  formalize the interface around the use of nodes (at least for
  filelogs). So let's switch to a node.
  
  We can't inline revlog.node() because of a check-code rule. I think
  that rule is suspect. But it may be for performance reasons with
  changelog code. I'd rather not touch it at this time.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowchangegroup.py

CHANGE DETAILS




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


  Yes please!

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/narrow/narrowchangegroup.py b/hgext/narrow/narrowchangegroup.py
--- a/hgext/narrow/narrowchangegroup.py
+++ b/hgext/narrow/narrowchangegroup.py
@@ -350,8 +350,9 @@ 
             p2 = node.nullrev
         else:
             p1, p2 = sorted(local(p) for p in linkparents)
+        n = revlog.node(rev)
         yield ellipsisdata(
-            self, rev, revlog, p1, p2, revlog.revision(rev), linknode)
+            self, rev, revlog, p1, p2, revlog.revision(n), linknode)
     extensions.wrapfunction(changegroup.cg1packer, 'revchunk', revchunk)
 
     def deltaparent(orig, self, revlog, rev, p1, p2, prev):