如何处理Mercurial中的提交者名称更改 [英] How to deal with committer name change in Mercurial

查看:96
本文介绍了如何处理Mercurial中的提交者名称更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mercurial有一个提交者小组的项目.不幸的是,一些提交者已经多次更改了名称,例如首先是昵称",然后变成姓氏",然后是其他名称.

I have a project in Mercurial with a group of committers. Unfortunately, some of the committers has changed names several times, e.g. first it was "nickname", and then it became "Name Surname ", and then something else.

大多数存储库分析工具都希望提交者在项目过程中具有相同的名称,因此理想情况下,我想在我们的主存储库中重命名以前版本的提交者,并让每个人都进行新的克隆.有可能吗?

Most of the repository analysis tools expect committer to have same name over the course of the project, so ideally I'd like to rename committers of previous revisions in our main repository and have everyone make a fresh clone. Is it possible?

还有其他方法可以解决此问题吗?

Are there any other ways to deal with this problem?

推荐答案

是的,有可能.使用转换扩展名,然后从存储库中将具有错误名称的hg convert转换为具有良好名称的新存储库,并使用authormap.使用convert扩展并将Mercurial转换为另一个Mercurial存储库可以完成很多事情.

Yes, it's possible. Use the Convert extension and then hg convert from the repository with the bad names to the new repository with the good names and use an authormap. There are many things you can accomplish using the convert extension and converting from Mercurial to another Mercurial repo.

Authormap文件,假设Eric Hopper <bumpy@bar.com>是作者的规范名称:

Authormap file, supposing Eric Hopper <bumpy@bar.com> is the canonical name for the author:

Eric Hopper <bouncy@foo.com>=Eric Hopper <bumpy@bar.com>
Eric M. Hopper <bouncy@foo.com>=Eric Hopper <bumpy@bar.com>
Eric Hopper <bouncy@baz.com>=Eric Hopper <bumpy@bar.com>

然后:

hg convert -s hg -d hg --authormap authormap badnamesrepo goodnamesrepo

注意:在将汞转换为汞存储库时,并不总是会创建许多新的变更集,在这种情况下,它将创建新变更集,并且它们等同于(但不同于)变更集.原始存储库.这意味着使用该存储库的每个人都将必须擦除其拥有的所有克隆并获取新的克隆.

Note: that while converting an hg to an hg repository will not always create lots of new changesets, in this case it will, and they will be equivalent to (but different from) changesets in the original repository. This means that everybody using this repository is going to have to erase any clones they have and fetch new ones.

在一般情况下,将hg存储库转换为hg存储库可能会至少创建一些新的变更集,或者没有理由这样做.而且几乎可以肯定,每个人都必须销毁所有克隆并重新克隆.

In the general case, converting an hg repository to an hg repository is likely to create at least a few new changesets or there wouldn't be a reason to do it. And that will almost certainly necessitate everybody destroying all their clones and re-cloning.

如果您的分析工具具有重新映射作者姓名的能力,那可能是更好的方法.但这不是您要的,所以我给了您您要的答案. :-)

If your analysis tool has the ability to remap author names, that's probably the better way to go. But that's not what you asked for, so I gave you the answer you asked for. :-)

这篇关于如何处理Mercurial中的提交者名称更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆