bundlerepo: enforce reading from core repo only
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 28 Dec 2012 02:32:47 +0100
changeset 18215 5e851ca54189
parent 18214 cd4c75200206
child 18216 46f624780ee8
bundlerepo: enforce reading from core repo only We do not want anything computed with the bundle overlay to be written back in the repo. Such write will likely contains invalid data. The short terms goal of this change is to drop use of `_cacheabletip` in bundle repo.
mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py	Fri Jan 04 04:52:57 2013 +0100
+++ b/mercurial/bundlerepo.py	Fri Dec 28 02:32:47 2012 +0100
@@ -14,7 +14,7 @@
 from node import nullid
 from i18n import _
 import os, tempfile, shutil
-import changegroup, util, mdiff, discovery, cmdutil
+import changegroup, util, mdiff, discovery, cmdutil, scmutil
 import localrepo, changelog, manifest, filelog, revlog, error
 
 class bundlerevlog(revlog.revlog):
@@ -28,6 +28,7 @@
         # len(index[r]). If the tuple is bigger than 7, it is a bundle
         # (it is bigger since we store the node to which the delta is)
         #
+        opener = scmutil.readonlyvfs(opener)
         revlog.revlog.__init__(self, opener, indexfile)
         self.bundle = bundle
         self.basemap = {}