revlog: slightly tune group() by not going rev->node->rev
authorPeter Arrenbrecht <peter.arrenbrecht@gmail.com>
Thu, 14 May 2009 16:00:21 +0200
changeset 8391 27bffd81d265
parent 8390 beae42f3d93b
child 8392 7e5cbb09515b
revlog: slightly tune group() by not going rev->node->rev
mercurial/revlog.py
--- a/mercurial/revlog.py	Thu May 14 15:35:46 2009 +0200
+++ b/mercurial/revlog.py	Thu May 14 16:00:21 2009 +0200
@@ -1149,16 +1149,17 @@
         have this parent as it has all history before these
         changesets. parent is parent[0]
         """
-        revs = [self.rev(n) for n in nodelist]
 
         # if we don't have any revisions touched by these changesets, bail
-        if not revs:
+        if not nodelist:
             yield changegroup.closechunk()
             return
 
+        revs = [self.rev(n) for n in nodelist]
+
         # add the parent of the first rev
-        p = self.parents(self.node(revs[0]))[0]
-        revs.insert(0, self.rev(p))
+        p = self.parentrevs(revs[0])[0]
+        revs.insert(0, p)
 
         # build deltas
         for d in xrange(0, len(revs) - 1):