hg Convert --authors errorUsers <-- 文件的格式是什么?

2024-05-01

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 ."或者我无法匹配作者。我怎么知道“完全符合”?我怎么知道我是否成功?


转换扩展使用文字文本替换。

快速实验表明您是否想要更换hh <[email protected] /cdn-cgi/l/email-protection>,您只需创建一个包含以下内容的作者映射文件:

hh <[email protected] /cdn-cgi/l/email-protection> = hhh <[email protected] /cdn-cgi/l/email-protection>

左侧必须是完全符合对于您想要替换的作者。如果不完全匹配,则不执行替换。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

hg Convert --authors errorUsers <-- 文件的格式是什么? 的相关文章

随机推荐