如何处理 Mercurial 中的提交者姓名变更
我在 Mercurial 中有一个项目,有一组提交者。不幸的是,一些提交者已经多次更改名称,例如首先是“昵称”,然后变成“Name Surname”,然后是其他名称。
大多数存储库分析工具都希望提交者在项目过程中具有相同的名称,因此理想情况下,我想重命名主存储库中先前版本的提交者,并让每个人都创建一个新的克隆。是否可以?
还有其他方法可以解决这个问题吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是可能的。使用转换扩展,然后从存储库中使用
hg Convert
将坏名称复制到具有好名称的新存储库并使用作者地图。使用转换扩展以及从 Mercurial 转换到另一个 Mercurial 存储库可以完成许多事情。Authormap 文件,假设
Eric Hopper <[电子邮件受保护]> ;
是作者的规范名称:然后:
注意: 虽然将 hg 转换为 hg 存储库并不总是会创建大量新的变更集,但在本例中它会创建大量新的变更集,而且它们将等同于(但不同于)原始存储库中的变更集。这意味着使用此存储库的每个人都必须删除他们拥有的任何克隆并获取新的克隆。
在一般情况下,将 hg 存储库转换为 hg 存储库可能会创建至少一些新的变更集,否则就没有理由这样做。这几乎肯定需要每个人销毁所有的克隆体并重新克隆。
如果您的分析工具能够重新映射作者姓名,那么这可能是更好的方法。但这不是你所要求的,所以我给了你你所要求的答案。 :-)
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 file, supposing
Eric Hopper <[email protected]>
is the canonical name for the author:Then:
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.
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. :-)