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?
If you haven't done anything else to your repository, you can do an "hg rollback" and just re-commit.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With