Mercurial > hgsubversion
changeset 1211:56d6e0273733
maps: load commandline branchmap in __init__
Funcationally, this is the same as before but consolidates the logic to its own
object so we later refactor all the map objects to inherit from a common base
object.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Mon, 24 Mar 2014 11:20:47 -0500 |
parents | a0c6dbd9afbb |
children | 0ca7f80d0ab6 |
files | hgsubversion/maps.py hgsubversion/svnmeta.py |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/hgsubversion/maps.py +++ b/hgsubversion/maps.py @@ -375,6 +375,11 @@ class BranchMap(dict): self.super.__init__() self.load(path) + # append branch mapping specified from the commandline + clmap = util.configpath(self.ui, 'branchmap') + if clmap: + self.load(clmap) + def load(self, path): '''Load mappings from a file at the specified path.''' if not os.path.exists(path):
--- a/hgsubversion/svnmeta.py +++ b/hgsubversion/svnmeta.py @@ -40,7 +40,6 @@ class SVNMeta(object): self._gen_cachedconfig('defaulthost', self.uuid) self._gen_cachedconfig('usebranchnames', True) - branchmap = util.configpath(self.ui, 'branchmap') filemap = util.configpath(self.ui, 'filemap') self.branches = util.load(self.branch_info_file) or {} @@ -53,8 +52,6 @@ class SVNMeta(object): self._authors = None self.branchmap = maps.BranchMap(self.ui, self.branchmap_file) - if branchmap: - self.branchmap.load(branchmap) self._tagmap = None