changeset 26399:1f0e78f8f55f

bundlerepo: let bundle repo look in the _mancache When looking up a base revision, we were ignoring the contents that were already available in the manifest's _mancache. This patch allows us to use that data instead of reading from the revlog. This is useful in our pushrebase extension (which allows rebasing on the server side during a push) because it allows us to prefetch the bundle base manifest before aquiring the repo lock (1 second saving), which means doing less work inside the lock, which means a 20% higher commit rate.
author Durham Goode <durham@fb.com>
date Mon, 28 Sep 2015 10:27:36 -0700
parents 70abba798098
children 6f9d9e2a661f
files mercurial/bundlerepo.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Sun Sep 27 22:19:54 2015 +0900
+++ b/mercurial/bundlerepo.py	Mon Sep 28 10:27:36 2015 -0700
@@ -195,7 +195,15 @@
                               linkmapper)
 
     def baserevision(self, nodeorrev):
-        return manifest.manifest.revision(self, nodeorrev)
+        node = nodeorrev
+        if isinstance(node, int):
+            node = self.node(node)
+
+        if node in self._mancache:
+            result = self._mancache[node][0].text()
+        else:
+            result = manifest.manifest.revision(self, nodeorrev)
+        return result
 
 class bundlefilelog(bundlerevlog, filelog.filelog):
     def __init__(self, opener, path, bundle, linkmapper):