mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
svnmeta: turn revmap into lazy property
This has no effect currently but will be used in a future patch to make it possible to create a SVNMeta object without having to load the revmap (for use in rebuilding metadata).
This commit is contained in:
parent
915d7ce444
commit
4468a44aa1
@ -30,7 +30,7 @@ class SVNMeta(object):
|
||||
os.makedirs(self.metapath)
|
||||
self.uuid = uuid
|
||||
self.subdir = subdir
|
||||
self.revmap = maps.RevMap(repo)
|
||||
self._revmap = None
|
||||
|
||||
author_host = self.ui.config('hgsubversion', 'defaulthost', uuid)
|
||||
authors = util.configpath(self.ui, 'authormap')
|
||||
@ -171,6 +171,12 @@ class SVNMeta(object):
|
||||
def revmap_file(self):
|
||||
return os.path.join(self.metapath, 'rev_map')
|
||||
|
||||
@property
|
||||
def revmap(self):
|
||||
if self._revmap is None:
|
||||
self._revmap = maps.RevMap(self.repo)
|
||||
return self._revmap
|
||||
|
||||
def fixdate(self, date):
|
||||
if date is not None:
|
||||
date = date.replace('T', ' ').replace('Z', '').split('.')[0]
|
||||
|
Loading…
Reference in New Issue
Block a user