Mercurial:检入变更集摘要后如何进行更改? [英] Mercurial: How to subsequently make a change to a changeset summary after it has been checked in?

查看:78
本文介绍了Mercurial:检入变更集摘要后如何进行更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
是否可以在之后编辑摘要使用TortoiseHg提交吗?

Possible Duplicate:
Is it possible to edit a summary after a commit using TortoiseHg?

在Mercurial中,如果我忘记在检入摘要中包含缺陷#,除了调整平面文件并检入后续变更集以进行注释外,如何更改以前检入变更集的摘要.在上次签到吗?

In Mercurial, if I forget to include the defect # in a check-in summary, how do you change the summary of a previously checked-in changeset, besides tweaking a flat-file and checking in a subsequent changeset just to comment on the previous check-in?

使用TortoiseHG.

Using TortoiseHG.

推荐答案

做到这一点的适当方法是使用

the appropriate way to do this is to use histedit. Histedit allows you to remove, modify, combine or otherwise edit your previous commits.

Histedit不随Mercurial一起提供,也不能与TortoiseHg一起使用,但是用法非常简单:

Histedit does not ship with Mercurial and it cannot be used with TortoiseHg, but the usage is very simple:

> hg histedit <rev>

您要更改注释的修订版本在哪里. Histedit将生成一个变更集列表,并向您显示其SHA1.除了每个变更集之外,还有一个单词指示一旦关闭文本窗口,histedit将对每个变更集执行的操作.在您要修改的变更集旁边-将"pick"替换为"edit".关闭文本窗口,然后发出以下命令:

where is the revision you want to change the comment on. Histedit will generate a list of changesets and show you their SHA1. Besides each changeset there is a word indicating what histedit will do with each changeset once you close the text window. Next to the changeset you want to modify - replace 'pick' with 'edit'. Close the text window and then issue this command:

> hg histedit --continue

,将出现另一个包含日志消息的文本窗口.将消息更改为您想要的任何内容.只要尚未共享文件,就可以一次对多个变更集执行此操作.这是histedit的一个非常琐碎的用途,更复杂的用途包括合并提交或删除某些提交的 portion .

and another text window will appear containing the log message. Change the message to whatever you want. You can do this for multiple changesets in one go, provided the files have not been shared yet. This is a pretty trivial use of histedit, more complicated uses involved combining commits or removing a portion of some commit.

2011年4月24日编辑:Mercurial队列似乎是执行此类任务的一种更可接受/更受支持的方式.在此处上获取有关mq扩展名的信息.

EDIT 4/24/2011: Mercurial queues seems to be a more acceptable/supported way to perform a task like this. Check here for information on the mq extension.

这篇关于Mercurial:检入变更集摘要后如何进行更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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