convert: deprecate --authors in preference for --authormap
authorMartin Geisler <mg@lazybytes.net>
Fri, 10 Sep 2010 01:34:14 +0200
changeset 12198 0c67a58f0580
parent 12197 540693065d40
child 12199 17d604e522b4
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.
hgext/convert/__init__.py
hgext/convert/convcmd.py
tests/test-convert.out
--- a/hgext/convert/__init__.py	Wed Sep 08 08:31:07 2010 +0200
+++ b/hgext/convert/__init__.py	Fri Sep 10 01:34:14 2010 +0200
@@ -70,10 +70,10 @@
     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 @@
     "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', '',
--- a/hgext/convert/convcmd.py	Wed Sep 08 08:31:07 2010 +0200
+++ b/hgext/convert/convcmd.py	Fri Sep 10 01:34:14 2010 +0200
@@ -112,8 +112,8 @@
         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 @@
     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)
--- a/tests/test-convert.out	Wed Sep 08 08:31:07 2010 +0200
+++ b/tests/test-convert.out	Fri Sep 10 01:34:14 2010 +0200
@@ -51,10 +51,10 @@
     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 @@
 
 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