Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edit Mercurial Earlier Commit Message - TortoiseHg

Is there a way to edit a commit message in Mercurial on a commit after other commits have occured using TortoiseHg? I've read these posts:

How to edit incorrect commit message in Mercurial?

Mercurial: how to amend the last commit?

and have been able to update a "regular" commit message when it is the latest commit on a branch (using TortoiseHg). However, I haven't been able to figure out how to edit a commit message when other commits have occurred after the one I want to edit. It always edits the last commit.

Based on Ed Cottrell's comment, I did a test where I made two commits without pushing to the central repo, and I still have the same issue - only the last commit message can be edited.

EDIT: I should clarify that I am looking to update a changeset that has been pushed.

like image 734
sdoca Avatar asked Feb 20 '14 16:02

sdoca


People also ask

How do I change commit message in Mercurial?

Since version 2.2, the commit command has a --amend option that will fold any changes into your working directory into the latest commit, and allow you to edit the commit message. hg commit --amend can in fact be used on any changeset that is a (topological) branch head, that is, one that has no child changesets.

How do you use hg commit -- amend?

You can also use the --amend option to modify the list of files in the commit. Just use hg add and hg rm to modify the index, then make a hg commit --amend to re-commit the changes.


1 Answers

Histedit extension (bundled with TortoiseHG now) has a mess command for changing the commit message of historical changesets.

Unfortunately, this command is not supported by the TortoiseHG GUI so you need to run the command from command line.

like image 159
Lazy Badger Avatar answered Oct 23 '22 15:10

Lazy Badger