comparison mercurial/localrepo.py @ 33539:460733327640

share: share 'cachevfs' with the source clone (issue5108) Share extension now also share caches reads and writes. Not sharing caches results in costly caches recomputations which can takes up to minutes when using shares on large repositories. There are a couple of file in the '.hg/cache/' that depends of the current visibility. Visibility can be affected by the working copy location, something which is specific to each share. We ignores them for this series because they: * are the minority, * already have a good fallback to other precomputed caches, * are only affected when people use the experimental evolution feature.
author Boris Feld <boris.feld@octobus.net>
date Sat, 15 Jul 2017 23:49:22 +0200
parents 54b36d3ff7f6
children b47fef6d2365
comparison
equal deleted inserted replaced
33538:54b36d3ff7f6 33539:460733327640
400 self.vfs, self.supported) 400 self.vfs, self.supported)
401 except IOError as inst: 401 except IOError as inst:
402 if inst.errno != errno.ENOENT: 402 if inst.errno != errno.ENOENT:
403 raise 403 raise
404 404
405 cachepath = self.vfs.join('cache')
405 self.sharedpath = self.path 406 self.sharedpath = self.path
406 try: 407 try:
407 sharedpath = self.vfs.read("sharedpath").rstrip('\n') 408 sharedpath = self.vfs.read("sharedpath").rstrip('\n')
408 if 'relshared' in self.requirements: 409 if 'relshared' in self.requirements:
409 sharedpath = self.vfs.join(sharedpath) 410 sharedpath = self.vfs.join(sharedpath)
410 vfs = vfsmod.vfs(sharedpath, realpath=True) 411 vfs = vfsmod.vfs(sharedpath, realpath=True)
412 cachepath = vfs.join('cache')
411 s = vfs.base 413 s = vfs.base
412 if not vfs.exists(): 414 if not vfs.exists():
413 raise error.RepoError( 415 raise error.RepoError(
414 _('.hg/sharedpath points to nonexistent directory %s') % s) 416 _('.hg/sharedpath points to nonexistent directory %s') % s)
415 self.sharedpath = s 417 self.sharedpath = s
421 self.requirements, self.sharedpath, vfsmod.vfs) 423 self.requirements, self.sharedpath, vfsmod.vfs)
422 self.spath = self.store.path 424 self.spath = self.store.path
423 self.svfs = self.store.vfs 425 self.svfs = self.store.vfs
424 self.sjoin = self.store.join 426 self.sjoin = self.store.join
425 self.vfs.createmode = self.store.createmode 427 self.vfs.createmode = self.store.createmode
426 self.cachevfs = vfsmod.vfs(self.vfs.join('cache')) 428 self.cachevfs = vfsmod.vfs(cachepath)
427 self.cachevfs.createmode = self.store.createmode 429 self.cachevfs.createmode = self.store.createmode
428 if (self.ui.configbool('devel', 'all-warnings') or 430 if (self.ui.configbool('devel', 'all-warnings') or
429 self.ui.configbool('devel', 'check-locks')): 431 self.ui.configbool('devel', 'check-locks')):
430 if util.safehasattr(self.svfs, 'vfs'): # this is filtervfs 432 if util.safehasattr(self.svfs, 'vfs'): # this is filtervfs
431 self.svfs.vfs.audit = self._getsvfsward(self.svfs.vfs.audit) 433 self.svfs.vfs.audit = self._getsvfsward(self.svfs.vfs.audit)