问题描述
Related here. Instructions here guide with example:
john=John Smith <[email protected]>
tom=Tom Johnson <[email protected]>
但这是什么意思?假设我想用"hhh <[email protected]>"
替换"hh <[email protected]>"
,那条线会是什么样?术语用户名,映射和文件名是什么意思?我可以在"convert/__init__.py"
中找到这部分"username mapping filename"
:
but what does it mean? Suppose I want to replace "hh <[email protected]>"
with "hhh <[email protected]>"
, 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')),
它创建了一个将作者存储为dict的对象,convcmd.py第79行:
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
它用"="
分割authorfile中的每一行,但是从那时起,我迷失了它是如何工作的.那么authors.file是什么,用来修复据说应该是什么样的错误作者呢?如果可以的话,请指向源代码行,因为我发现文档非常难以阅读.
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.
[更新]
我已经尝试了文件的所有选项,但"$ hg status"
/"$ hg log --template '{author}\n'"
不会被更改.在命令"$ hg convert --authors conversionAuthors ."
之后我需要做一些奇怪的事情,或者我无法匹配作者.我怎么知道完全匹配" ?我怎么知道我是否成功?
I have tried all kind of options for 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?
推荐答案
convert扩展名使用文字替换.
The convert extension uses a literal text substitution.
一项快速的实验显示了是否要替换hh <[email protected]>
,您只需创建具有以下内容的作者地图文件即可:
A quick experiment shows if you want to replace hh <[email protected]>
, you simply create an author map file with these contents:
hh <[email protected]> = hhh <[email protected]>
您要替换的作者的左侧必须为完全匹配.如果不完全匹配,则不执行替换.
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.
这篇关于hg convert --authors faultUsers<-文件的格式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!