# HG changeset patch # User Sean Farley # Date 1395678047 18000 # Node ID 54d42e59b29c025d7a9c59fd6815781bd5402c96 # Parent 9fc3557ce85e860000da40b08d8bb8c682a7b51a maps: load commandline tagmap 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 @@ -437,6 +437,11 @@ class TagMap(dict): self.super.__init__() self.load(path) + # append tag mapping specified from the commandline + clmap = util.configpath(self.ui, 'tagmap') + 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 @@ -41,7 +41,6 @@ class SVNMeta(object): self._gen_cachedconfig('usebranchnames', True) branchmap = util.configpath(self.ui, 'branchmap') - tagmap = util.configpath(self.ui, 'tagmap') filemap = util.configpath(self.ui, 'filemap') self.branches = util.load(self.branch_info_file) or {} @@ -58,8 +57,6 @@ class SVNMeta(object): self.branchmap.load(branchmap) self.tagmap = maps.TagMap(self.ui, self.tagmap_file) - if tagmap: - self.tagmap.load(tagmap) self.filemap = maps.FileMap(self.ui, self.filemap_file) if filemap: