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

发布于 2024-10-31 02:52:39 字数 2285 浏览 1 评论 0 原文

相关内容此处。说明此处带有示例指南:

john=John Smith <[email protected]>
tom=Tom Johnson <[email protected]>

但这是什么意思?假设我想替换 "hh <[email protected] >""hhh <[电子邮件受保护]< /a>>",那条线会是什么样子?用户名、映射和文件名这三个术语的含义是什么?我可以从 "convert/__init__.py" 中找到这部分 "username mapping filename"

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 应该是什么样子的呢?如果可以的话,请指出我的源代码行,因为我发现这些文档非常难以阅读。

[更新]

我已经尝试了该文件的所有选项,但 "$ hg status"/"$ hg log --template '{author}\ n'" 不会改变。要么我需要在命令 "$ hg Convert --authors conversionAuthors ." 之后做一些奇怪的事情,要么我无法匹配作者。我如何知道“完全匹配”?我怎么知道我是否成功?

Related here. Instructions here guide with example:

john=John Smith <[email protected]>
tom=Tom Johnson <[email protected]>

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')),

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 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稚气少女 2024-11-07 02:52:39

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

快速实验显示您是否要替换 hh [email protected]< /a>>,您只需创建一个包含以下内容的作者映射文件:

hh <[电子邮件受保护]> = hhh [电子邮件受保护]>

左边-手边必须与您要替换的作者完全匹配。如果不完全匹配,则不执行替换。

The convert extension uses a literal text substitution.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文