# HG changeset patch # User Sean Farley # Date 1395678046 18000 # Node ID a55339d35066a258cb1550e22660373a00cea6f9 # Parent 23a845fbfc6a2b650f7ffe713566d019589d750c maps: load commandline authormap 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 @@ -39,6 +39,11 @@ class AuthorMap(dict): self.super.__init__() self.load(path) + # append authors specified from the commandline + clmap = util.configpath(self.ui, 'authormap') + if clmap: + self.load(clmap) + def load(self, path): ''' Load mappings from a file at the specified 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('usebranchnames', True) author_host = self.ui.config('hgsubversion', 'defaulthost', uuid) - authors = util.configpath(self.ui, 'authormap') branchmap = util.configpath(self.ui, 'branchmap') tagmap = util.configpath(self.ui, 'tagmap') filemap = util.configpath(self.ui, 'filemap') @@ -53,8 +52,7 @@ class SVNMeta(object): self._layoutobj = None self.authors = maps.AuthorMap(self.ui, self.authors_file, - defaulthost=author_host) - if authors: self.authors.load(authors) + defaulthost=author_host) self.branchmap = maps.BranchMap(self.ui, self.branchmap_file) if branchmap: