hg convert --authors wrongUsers <-- what is the format of the file?
Related here. Instructions here guide with example:
john=John Smith <John.Smith@someplace.net>
tom=Tom Johnson <Tom.Johnson@bigcity.com>
but what does it mean? Suppose I want to replace "hh <right@gmail.com>"
with "hhh <right@gmail.com>"
, what would that line look like? What do the terms username, mapping and filename mean? I can find this part "username mapping filename"
from "convert/__init__.py"
:
cmdtable = {
"convert":
(convert,
[('A', 'authors', '', _('username mapping filename')),
('d', 'dest-type', '', _('destination repository type')),
('', 'filemap', '', _('remap file names using contents of file')),
('r', 'rev', '', _('import up to target revision REV')),
It makes an object where the authors are stored as dict, convcmd.py line 79:
class converter(object):
def __init__(self, ui, source, dest, revmapfile, opts):
self.source = source
self.dest = dest
self.ui = ui
self.opts = opts
self.commitcache = {}
self.authors = {}
self.authorfile = None
it splits the each line in authorfile with "="
but from this onwards I am lost how does it work. So what is the authors.file to fix wrong authors supposingly meant to look like? If you can, please point me to the source line because I find the docs very unreadable.
[Update]
I have tried all kind of options for开发者_Go百科 the file but the "$ hg status"
/"$ hg log --template '{author}\n'"
won't get changed. Either I need to do something odd after the command "$ hg convert --authors conversionAuthors ."
or I cannot match the authors. How can I know "exact match"? How can I know whether I succeed?
The convert extension uses a literal text substitution.
A quick experiment shows if you want to replace hh <right@gmail.com>
, you simply create an author map file with these contents:
hh <right@gmail.com> = hhh <right@gmail.com>
The left-hand side must be an exact match for the author you want to replace. If it is not an exact match, no substitution is performed.
精彩评论