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:
Sean Farley 2014-02-17 16:29:54 -06:00
parent 915d7ce444
commit 4468a44aa1

View File

@ -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]