# HG changeset patch # User Martin Geisler # Date 2010-09-09 23:34:14 # Node ID 0c67a58f0580cff1d6fc94866f4b4a5400620d23 # Parent 540693065d40ab5058c782e3cef97191c4bc67f0 convert: deprecate --authors in preference for --authormap This aligns the authormap option with the other three mapping options. The old --authors option is still supported and 'hg help convert -v' will still show it. diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py --- a/hgext/convert/__init__.py +++ b/hgext/convert/__init__.py @@ -70,10 +70,10 @@ def convert(ui, src, dest=None, revmapfi updated on each commit copied, so :hg:`convert` can be interrupted and can be run repeatedly to copy new commits. - The username mapping file is a simple text file that maps each - source commit author to a destination commit author. It is handy - for source SCMs that use unix logins to identify authors (eg: - CVS). One line per author mapping and the line format is:: + The authormap is a simple text file that maps each source commit + author to a destination commit author. It is handy for source SCMs + that use unix logins to identify authors (eg: CVS). One line per + author mapping and the line format is:: source author = destination author @@ -275,13 +275,16 @@ cmdtable = { "convert": (convert, [('A', 'authors', '', - _('username mapping filename'), _('FILE')), + _('username mapping filename (DEPRECATED, use --authormap instead)'), + _('FILE')), ('s', 'source-type', '', _('source repository type'), _('TYPE')), ('d', 'dest-type', '', _('destination repository type'), _('TYPE')), ('r', 'rev', '', _('import up to target revision REV'), _('REV')), + ('', 'authormap', '', + _('remap usernames using this file'), _('FILE')), ('', 'filemap', '', _('remap file names using contents of file'), _('FILE')), ('', 'splicemap', '', diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py --- a/hgext/convert/convcmd.py +++ b/hgext/convert/convcmd.py @@ -112,8 +112,8 @@ class converter(object): if authorfile and os.path.exists(authorfile): self.readauthormap(authorfile) # Extend/Override with new author map if necessary - if opts.get('authors'): - self.readauthormap(opts.get('authors')) + if opts.get('authormap'): + self.readauthormap(opts.get('authormap')) self.authorfile = self.dest.authorfile() self.splicemap = mapfile(ui, opts.get('splicemap')) @@ -392,6 +392,10 @@ def convert(ui, src, dest=None, revmapfi orig_encoding = encoding.encoding encoding.encoding = 'UTF-8' + # support --authors as an alias for --authormap + if not opts.get('authormap'): + opts['authormap'] = opts.get('authors') + if not dest: dest = hg.defaultdest(src) + "-hg" ui.status(_("assuming destination %s\n") % dest) diff --git a/tests/test-convert.out b/tests/test-convert.out --- a/tests/test-convert.out +++ b/tests/test-convert.out @@ -51,10 +51,10 @@ convert a foreign SCM repository to a Me each commit copied, so "hg convert" can be interrupted and can be run repeatedly to copy new commits. - The username mapping file is a simple text file that maps each source - commit author to a destination commit author. It is handy for source SCMs - that use unix logins to identify authors (eg: CVS). One line per author - mapping and the line format is: + The authormap is a simple text file that maps each source commit author to + a destination commit author. It is handy for source SCMs that use unix + logins to identify authors (eg: CVS). One line per author mapping and the + line format is: source author = destination author @@ -236,10 +236,10 @@ convert a foreign SCM repository to a Me options: - -A --authors FILE username mapping filename -s --source-type TYPE source repository type -d --dest-type TYPE destination repository type -r --rev REV import up to target revision REV + --authormap FILE remap usernames using this file --filemap FILE remap file names using contents of file --splicemap FILE splice synthesized history into place --branchmap FILE change branch names while converting