Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix an error in a Mercurial changeset comment?

Tags:

mercurial

Is there a way to rewrite the hg commit message if the wrong information was entered? We always include our Bug ID when we commit a changeset. For instance:

hg commit -m "Bug 14585: LastName field should be mandatory"

But If I put the wrong bug ID, is there a way (through an extension maybe) to fix the comment once the changeset has been committed and pushed to a central repo?

like image 574
Sylvain Avatar asked Apr 12 '10 17:04

Sylvain


2 Answers

If you haven't done anything else to your repository, you can do an "hg rollback" and just re-commit.

like image 113
jemfinch Avatar answered Oct 10 '22 17:10

jemfinch


The histedit extension might be what you are looking for. It allows you to edit commit messages after the fact. It also allows you to drop or fold revisions, much like git rebase --interactive.

Note that you have to enable and use the extension on the repo you'd like to fix; there is no way to edit the history of a remote repo. Additionally, I'd be very cautious about using this on a central repo. As Tim Post points out, mercurial changesets are not meant to be changed.

like image 44
ataylor Avatar answered Oct 10 '22 17:10

ataylor