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.
--- 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