Commits

Sean Farley  committed c2b7261

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).

  • Participants
  • Parent commits 0b40caa

Comments (0)

Files changed (1)

File hgsubversion/svnmeta.py

             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')
     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]