revlog: precalculate p1 and p2 revisions stable
authorMatt Mackall <mpm@selenic.com>
Sat, 30 Oct 2010 02:47:34 -0500
branchstable
changeset 12889 5482c6b826f4
parent 12888 ad01fe38afe6
child 12890 b1c839659140
revlog: precalculate p1 and p2 revisions
mercurial/revlog.py
--- a/mercurial/revlog.py	Sat Oct 30 02:47:34 2010 -0500
+++ b/mercurial/revlog.py	Sat Oct 30 02:47:34 2010 -0500
@@ -1192,9 +1192,10 @@
         offset = self.end(prev)
         flags = 0
         d = None
+        p1r, p2r = self.rev(p1), self.rev(p2)
 
         if self._parentdelta:
-            deltarev, deltanode = self.rev(p1), p1
+            deltarev, deltanode = p1r, p1
             flags = REVIDX_PARENTDELTA
         else:
             deltarev, deltanode = prev, self.node(prev)
@@ -1220,7 +1221,7 @@
             base = curr
 
         e = (offset_type(offset, flags), l, textlen,
-             base, link, self.rev(p1), self.rev(p2), node)
+             base, link, p1r, p2r, node)
         self.index.insert(-1, e)
         self.nodemap[node] = curr