Related here https://stackoverflow.com/questions/732819/can-i-change-the-username-on-a-mercurial-changeset/757604#757604。指示here http://mercurial.selenic.com/wiki/ConvertExtension举例指导:
john=John Smith <[email protected] /cdn-cgi/l/email-protection>
tom=Tom Johnson <[email protected] /cdn-cgi/l/email-protection>
但是这是什么意思?假设我想替换"hh <[email protected] /cdn-cgi/l/email-protection>"
with "hhh <[email protected] /cdn-cgi/l/email-protection>"
,那条线会是什么样子?用户名、映射和文件名这三个术语的含义是什么?我可以找到这部分"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')),
它创建一个对象,其中作者存储为 dict,convcmd.py 第 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
它将authorfile中的每一行分割为"="
但从现在开始我就迷失了它是如何工作的。那么用于修复错误作者的authors.file 应该是什么样子的呢?如果可以的话,请指出我的源代码行,因为我发现这些文档非常难以阅读。
[Update]
我已经尝试了该文件的所有选项,但"$ hg status"
/"$ hg log --template '{author}\n'"
不会被改变。要么我需要在命令之后做一些奇怪的事情"$ hg convert --authors conversionAuthors ."
或者我无法匹配作者。我怎么知道“完全符合”?我怎么知道我是否成功?