changeset 38169:fc72beec2a1a

revlog: make chainbase cache its result for the correct revision Previously, as 'rev' was our iterator, we were always caching the chain base for the second revision of the chain, or for the base itself.
author Paul Morelle <paul.morelle@octobus.net>
date Sat, 21 Apr 2018 17:27:57 +0200
parents faa015417348
children dfb888aae17a
files mercurial/revlog.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Mar 07 11:10:22 2018 +0100
+++ b/mercurial/revlog.py	Sat Apr 21 17:27:57 2018 +0200
@@ -877,10 +877,11 @@
             return base
 
         index = self.index
-        base = index[rev][3]
-        while base != rev:
-            rev = base
-            base = index[rev][3]
+        iterrev = rev
+        base = index[iterrev][3]
+        while base != iterrev:
+            iterrev = base
+            base = index[iterrev][3]
 
         self._chainbasecache[rev] = base
         return base