# HG changeset patch # User Pierre-Yves David # Date 2012-12-20 11:17:44 # Node ID 6db318a15a128a831e96f1c0c424e6cf8df47721 # Parent 35ce17796e0e8a9ee23978638ee1f5ab283b5e6e bundlerepo: use _cacheabletip mechanism in bundlerepo Instead of preventing any cache write we allow writing cache for all content of the original repo. The motivation for this change is to drop the custom _writebranchcache of bundlerepo to help extraction of the branchmap logic out of localrepo. diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -32,6 +32,7 @@ class bundlerevlog(revlog.revlog): self.bundle = bundle self.basemap = {} n = len(self) + self.disktiprev = n - 1 chain = None self.bundlenodes = [] while True: @@ -284,9 +285,11 @@ class bundlerepository(localrepo.localre def getcwd(self): return os.getcwd() # always outside the repo - def _writebranchcache(self, branches, tip, tiprev): - # don't overwrite the disk cache with bundle-augmented data - pass + def _cacheabletip(self): + # we should not cache data from the bundle on disk + ret = super(bundlerepository, self)._cacheabletip() + return min(self.changelog.disktiprev, ret) + def instance(ui, path, create): if create: