Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

tortoisehg

Occasionally I commit some code to the repository, add a comment/summary, then read the summary back and realise I've made a mistake or should have included a bit more information. It is possible to edit the summary after a commit in TortoiseHg? I'm using version 1.1

like image 530
Phil Hale Avatar asked Aug 18 '10 09:08

Phil Hale


People also ask

How do I revert a commit in TortoiseHg?

In the TortoiseHg client's Commit dialog, right-click the needed file and then click Revert.

What is HG amend?

hg amend [OPTION]... [ FILE]... aliases: refresh. combine a changeset with updates and replace it with a new one. Commits a new changeset incorporating both the changes to the given files and all the changes from the current parent changeset into the repository.


Video Answer


2 Answers

Use mercurial queues to convert the change-sets to patches, then strip those change-sets and re-apply the patches back to your repository.

When the patches are created, they are stored in the .hg/patches folder in your repository and you can edit these (including the commit message) before you re-apply them.

  • Enabled the Mercurial Queues extensions (MQ)
  • Right-click and select Import Revision to MQ for each change-set to convert them into patches in the patch queue
  • Enable the patch queue window from the view menu
  • Select the Un-apply All Patches arrow in the patch queue to strip the change-sets away
  • Edit the patch files in .hg/patches
  • Select Apply All Patches
  • Right-click on the patch and select Finish Applied to close down the queue
like image 109
Neil Trodden Avatar answered Oct 12 '22 10:10

Neil Trodden


If that is the last commit, you can press "Undo" button in the commit dialog (it is an interface to hg rollback) and then commit the same files again with a new message. If this is a commit in a middle of the tree, you need to use mq extension to delete all later commits and reapply them. And if the commit with an incorrect summary is pushed to a public repo, you should accept and live with that, because you should not change published commits.

like image 38
wRAR Avatar answered Oct 12 '22 11:10

wRAR