mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
svnmeta: turn filemap into a lazy property
This commit is contained in:
parent
17b3566914
commit
976f745417
@ -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):
|
||||
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user