# HG changeset patch # User Sean Farley # Date 1395678047 18000 # Node ID 56d6e0273733d56a8094bd159e4cc5683bfe340a # Parent a0c6dbd9afbb8e57ab2b5f34e49412ae37e5e765 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. diff --git a/hgsubversion/maps.py b/hgsubversion/maps.py --- 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): diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py --- 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