svnmeta: turn filemap into a lazy property

This commit is contained in:
Sean Farley 2014-03-24 11:20:48 -05:00
parent 17b3566914
commit 976f745417
2 changed files with 8 additions and 2 deletions

View File

@ -393,7 +393,7 @@ class BranchMap(dict):
if path != self.meta.branchmap_file:
writing = open(self.meta.branchmap_file, 'a')
self.ui.debug('reading branchmap from %s\n' % path)
self.meta.ui.debug('reading branchmap from %s\n' % path)
f = open(path, 'r')
for number, line in enumerate(f):

View File

@ -53,7 +53,7 @@ class SVNMeta(object):
self._tagmap = None
self.filemap = maps.FileMap(self.ui, self.filemap_file)
self._filemap = None
self.lastdate = '1970-01-01 00:00:00 -0000'
self.addedtags = {}
@ -231,6 +231,12 @@ class SVNMeta(object):
def filemap_file(self):
return os.path.join(self.metapath, 'filemap')
@property
def filemap(self):
if self._filemap is None:
self._filemap = maps.FileMap(self.ui, self.filemap_file)
return self._filemap
@property
def branchmap_file(self):
return os.path.join(self.metapath, 'branchmap')