comparison hgsubversion/svnmeta.py @ 1212:0ca7f80d0ab6

svnmeta: turn branchmap into a lazy property
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:20:47 -0500
parents 56d6e0273733
children 295d2f0cc275
comparison
equal deleted inserted replaced
1211:56d6e0273733 1212:0ca7f80d0ab6
49 ui=self.repo.ui) 49 ui=self.repo.ui)
50 self._layoutobj = None 50 self._layoutobj = None
51 51
52 self._authors = None 52 self._authors = None
53 53
54 self.branchmap = maps.BranchMap(self.ui, self.branchmap_file) 54 self._branchmap = None
55 55
56 self._tagmap = None 56 self._tagmap = None
57 57
58 self.filemap = maps.FileMap(self.ui, self.filemap_file) 58 self.filemap = maps.FileMap(self.ui, self.filemap_file)
59 if filemap: 59 if filemap:
236 return os.path.join(self.metapath, 'filemap') 236 return os.path.join(self.metapath, 'filemap')
237 237
238 @property 238 @property
239 def branchmap_file(self): 239 def branchmap_file(self):
240 return os.path.join(self.metapath, 'branchmap') 240 return os.path.join(self.metapath, 'branchmap')
241
242 @property
243 def branchmap(self):
244 if self._branchmap is None:
245 self._branchmap = maps.BranchMap(self.ui, self.branchmap_file)
246 return self._branchmap
241 247
242 @property 248 @property
243 def tagfile(self): 249 def tagfile(self):
244 # called tagmap for backwards compatibility 250 # called tagmap for backwards compatibility
245 return os.path.join(self.metapath, 'tagmap') 251 return os.path.join(self.metapath, 'tagmap')