changeset 1157:c2b72618645a

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).
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 17 Feb 2014 16:29:54 -0600
parents 0b40caaaa0ee
children 770ac6de58c5
files hgsubversion/svnmeta.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
@@ -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]