changeset 12889:5482c6b826f4 stable

revlog: precalculate p1 and p2 revisions
author Matt Mackall <mpm@selenic.com>
date Sat, 30 Oct 2010 02:47:34 -0500
parents ad01fe38afe6
children b1c839659140
files mercurial/revlog.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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