##// END OF EJS Templates
repo: add internal support for sharing store directories...
Matt Mackall -
r8799:87d1fd40 default
parent child Browse files
Show More
@@ -19,7 +19,7 b' propertycache = util.propertycache'
19
19
20 class localrepository(repo.repository):
20 class localrepository(repo.repository):
21 capabilities = set(('lookup', 'changegroupsubset', 'branchmap'))
21 capabilities = set(('lookup', 'changegroupsubset', 'branchmap'))
22 supported = set('revlogv1 store fncache'.split())
22 supported = set('revlogv1 store fncache shared'.split())
23
23
24 def __init__(self, baseui, path=None, create=0):
24 def __init__(self, baseui, path=None, create=0):
25 repo.repository.__init__(self)
25 repo.repository.__init__(self)
@@ -72,7 +72,18 b' class localrepository(repo.repository):'
72 for r in requirements - self.supported:
72 for r in requirements - self.supported:
73 raise error.RepoError(_("requirement '%s' not supported") % r)
73 raise error.RepoError(_("requirement '%s' not supported") % r)
74
74
75 self.store = store.store(requirements, self.path, util.opener)
75 self.sharedpath = self.path
76 try:
77 s = os.path.realpath(self.opener("sharedpath").read())
78 if not os.path.exists(s):
79 raise error.RepoError(
80 _('.hg/sharedpath points to nonexistent directory %s' % s))
81 self.sharedpath = s
82 except IOError, inst:
83 if inst.errno != errno.ENOENT:
84 raise
85
86 self.store = store.store(requirements, self.sharedpath, util.opener)
76 self.spath = self.store.path
87 self.spath = self.store.path
77 self.sopener = self.store.opener
88 self.sopener = self.store.opener
78 self.sjoin = self.store.join
89 self.sjoin = self.store.join
General Comments 0
You need to be logged in to leave comments. Login now