我可以在商业变更集上更改用户名吗? [英] Can I change the username on a mercurial changeset?

查看:63
本文介绍了我可以在商业变更集上更改用户名吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有在开发计算机上设置用户名,而是进行了一些提交.我可以追溯更改用户名,以便清楚地知道是谁提交了这些更改集吗?

I didn't set the username on my development computer and made a few commits. Can I retroactively change the username so it's clear who committed these changesets?

推荐答案

如果您尚未发布存储库,那么这应该不太困难.您需要使用将扩展名转换为Mercurial,这样您就可以过滤"您现有的存储库以创建一个新的存储库.通过--authors开关,您可以在过滤每个提交时编辑其作者.

If you've not published your repository then this shouldn't be too hard. You need to use the Convert extension to Mercurial, which will let you 'filter' your existing repository to create a new one. the --authors switch lets you edit the author for each commit as it is filtered.

如果您已经发布了存储库,请考虑对用户的影响,Mercurial Wiki上有一些

If you have published your repository, please consider the impact on your users, the mercurial wiki has some reasons not to edit history.

通过将以下行添加到.hgrc来启用扩展名:

Enable the extension by adding these lines to your .hgrc:

[extensions]
hgext.convert=

写入文件以将旧名称映射为新名称(authors.convert.list):

Write a file to map the old name to the new name (authors.convert.list):

user@ubuntu=real.name@my.example.com

运行转换:

hg convert --authors authors.convert.list SOURCE DEST

我刚刚检查了一下,它对我有用:).

I just checked it, it works for me :).

这篇关于我可以在商业变更集上更改用户名吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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