narrow: pass node into revlog.revision()
authorGregory Szorc <gregory.szorc@gmail.com>
Tue, 03 Apr 2018 09:54:20 -0700
changeset 37340 8cf97e0e1730
parent 37339 5859800edfc5
child 37341 d62d2e346acf
narrow: pass node into revlog.revision() 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. Differential Revision: https://phab.mercurial-scm.org/D3043
hgext/narrow/narrowchangegroup.py
--- a/hgext/narrow/narrowchangegroup.py	Tue Apr 03 10:15:21 2018 -0700
+++ b/hgext/narrow/narrowchangegroup.py	Tue Apr 03 09:54:20 2018 -0700
@@ -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):