# HG changeset patch # User Sean Farley # Date 1395678048 18000 # Node ID 572417ad0313ece03b6c11634f6206b654f2992a # Parent 77bd24841a5f801e625df335da485e85e9246206 svnmeta: turn filemap into a lazy property diff --git a/hgsubversion/maps.py b/hgsubversion/maps.py --- a/hgsubversion/maps.py +++ b/hgsubversion/maps.py @@ -393,7 +393,7 @@ class BranchMap(dict): if path != self.meta.branchmap_file: writing = open(self.meta.branchmap_file, 'a') - self.ui.debug('reading branchmap from %s\n' % path) + self.meta.ui.debug('reading branchmap from %s\n' % path) f = open(path, 'r') for number, line in enumerate(f): diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py --- a/hgsubversion/svnmeta.py +++ b/hgsubversion/svnmeta.py @@ -53,7 +53,7 @@ class SVNMeta(object): self._tagmap = None - self.filemap = maps.FileMap(self.ui, self.filemap_file) + self._filemap = None self.lastdate = '1970-01-01 00:00:00 -0000' self.addedtags = {} @@ -231,6 +231,12 @@ class SVNMeta(object): def filemap_file(self): return os.path.join(self.metapath, 'filemap') + @property + def filemap(self): + if self._filemap is None: + self._filemap = maps.FileMap(self.ui, self.filemap_file) + return self._filemap + @property def branchmap_file(self): return os.path.join(self.metapath, 'branchmap')