Mercurial > hgsubversion
changeset 1212:0ca7f80d0ab6
svnmeta: turn branchmap into a lazy property
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Mon, 24 Mar 2014 11:20:47 -0500 |
parents | 56d6e0273733 |
children | 295d2f0cc275 |
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 @@ -51,7 +51,7 @@ class SVNMeta(object): self._authors = None - self.branchmap = maps.BranchMap(self.ui, self.branchmap_file) + self._branchmap = None self._tagmap = None @@ -239,6 +239,12 @@ class SVNMeta(object): def branchmap_file(self): return os.path.join(self.metapath, 'branchmap') + @property + def branchmap(self): + if self._branchmap is None: + self._branchmap = maps.BranchMap(self.ui, self.branchmap_file) + return self._branchmap + @property def tagfile(self): # called tagmap for backwards compatibility