From a542b6aa975e82b4890945be8b16053f58b0f18f Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Sun, 16 Aug 2015 13:09:51 +0200 Subject: [PATCH] refactor: Make author map loading more generic This is the first step in adding mappings for branches and tags. --- hg-fast-export.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hg-fast-export.py b/hg-fast-export.py index 9c7a935..925ecbc 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -276,7 +276,7 @@ def export_tags(ui,repo,old_marks,mapping_cache,count,authors): count=checkpoint(count) return count -def load_authors(filename): +def load_mapping(name, filename): cache={} if not os.path.exists(filename): return cache @@ -297,7 +297,7 @@ def load_authors(filename): cache[m.group(1).strip()]=m.group(2).strip() a+=1 f.close() - sys.stderr.write('Loaded %d authors\n' % a) + sys.stderr.write('Loaded %d %s\n' % (a, name)) return cache def branchtip(repo, heads): @@ -432,7 +432,7 @@ if __name__=='__main__': a={} if options.authorfile!=None: - a=load_authors(options.authorfile) + a=load_mapping('authors', options.authorfile) if options.default_branch!=None: set_default_branch(options.default_branch) -- 2.11.4.GIT