changeset 1209:20c28c511551

svnmeta: turn tagmap into a lazy property
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:20:47 -0500
parents 54d42e59b29c
children a0c6dbd9afbb
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
@@ -56,7 +56,7 @@ class SVNMeta(object):
         if branchmap:
             self.branchmap.load(branchmap)
 
-        self.tagmap = maps.TagMap(self.ui, self.tagmap_file)
+        self._tagmap = None
 
         self.filemap = maps.FileMap(self.ui, self.filemap_file)
         if filemap:
@@ -258,6 +258,12 @@ class SVNMeta(object):
         # called tag-renames for backwards compatibility
         return os.path.join(self.metapath, 'tag-renames')
 
+    @property
+    def tagmap(self):
+        if self._tagmap is None:
+            self._tagmap = maps.TagMap(self.ui, self.tagmap_file)
+        return self._tagmap
+
     @property
     def revmap_file(self):
         return os.path.join(self.metapath, 'rev_map')