diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -402,12 +402,14 @@ class localrepository(object): if inst.errno != errno.ENOENT: raise + cachepath = self.vfs.join('cache') self.sharedpath = self.path try: sharedpath = self.vfs.read("sharedpath").rstrip('\n') if 'relshared' in self.requirements: sharedpath = self.vfs.join(sharedpath) vfs = vfsmod.vfs(sharedpath, realpath=True) + cachepath = vfs.join('cache') s = vfs.base if not vfs.exists(): raise error.RepoError( @@ -423,7 +425,7 @@ class localrepository(object): self.svfs = self.store.vfs self.sjoin = self.store.join self.vfs.createmode = self.store.createmode - self.cachevfs = vfsmod.vfs(self.vfs.join('cache')) + self.cachevfs = vfsmod.vfs(cachepath) self.cachevfs.createmode = self.store.createmode if (self.ui.configbool('devel', 'all-warnings') or self.ui.configbool('devel', 'check-locks')): diff --git a/tests/test-share.t b/tests/test-share.t --- a/tests/test-share.t +++ b/tests/test-share.t @@ -24,6 +24,20 @@ share shouldn't have a store dir $ test -d .hg/store [1] +share shouldn't have a cache dir, original repo should + + $ hg branches + default 0:d3873e73d99e + $ hg tags + tip 0:d3873e73d99e + $ test -d .hg/cache + [1] + $ ls -1 ../repo1/.hg/cache + branch2-served + rbc-names-v1 + rbc-revs-v1 + tags2-visible + Some sed versions appends newline, some don't, and some just fails $ cat .hg/sharedpath; echo