我目前正在使用TortoiseHg (Mercurial),不小心提交了一个错误的提交消息。如何在存储库中编辑这条提交消息?


当前回答

我知道这是一个老帖子,你把问题标记为答案。我正在寻找同样的事情最近,我发现histedit扩展非常有用。这个过程解释如下:

http://knowledgestockpile.blogspot.com/2010/12/changing-commit-message-of-revision-in.html

其他回答

我以前是这么做的:

想象一下,您有500个提交,错误的提交消息在r.498中。

hg qimport -r 498:tip
hg qpop -a
joe .hg/patches/498.diff
(change the comment, after the mercurial header)
hg qpush -a
hg qdelete -r qbase:qtip

In TortoiseHg, right-click on the revision you want to modify. Choose Modify History->Import MQ. That will convert all the revisions up to and including the selected revision from Mercurial changesets into Mercurial Queue patches. Select the Patch you want to modify the message for, and it should automatically change the screen to the MQ editor. Edit the message which is in the middle of the screen, then click QRefresh. Finally, right click on the patch and choose Modify History->Finish Patch, which will convert it from a patch back into a change set.

哦,这里假设MQ是这个存储库上TortoiseHG的活动扩展。如果没有,您应该能够单击File->Settings,单击Extensions,然后单击mq复选框。它应该警告你,你必须关闭TortoiseHg之前的扩展是活跃的,所以关闭并重新开放。

上面讨论的一个小宝石-感谢@Codest和@Kevin Pullin。 在TortoiseHg中,在提交按钮旁边有一个下拉选项。选择“修正当前修订”会带回注释和文件列表。所以有用。

我知道这是一个老帖子,你把问题标记为答案。我正在寻找同样的事情最近,我发现histedit扩展非常有用。这个过程解释如下:

http://knowledgestockpile.blogspot.com/2010/12/changing-commit-message-of-revision-in.html

好消息:hg 2.2刚刚增加了git的修改选项。

在tortoiseHg中,你可以通过选择提交按钮右侧的黑色箭头来使用“修改当前修订”