Options if it's too late for rollback
If rollback & re-commit isn't an option, then you have a couple of options, depending on how far the changes have propogated and how far back the changeset is.
I have used both of these methods in the past.
Fix with a sibling branch and deprecate/strip the old one
If it is only a few changesets, you could export those changesets as patches and re-apply them to the parent. For the first changeset (the one whose history you want to change) you will need to use hg patch --no-commit
, and then hg commit
with the new message. Then for the rest, just use hg patch
to import the changes and the commit message as-is.
The problem with this method is that you end up with two branches, one of you need to ignore forever (I would update to the faulty changeset and tag the branch as deprecated).
Alternatively, you need to find every repository which contains this branch and hg strip
it. The problem here is that some machines might not have the Mercurial Queues extension enabled and if you miss even one repo, and that repo is synced with another, the changes start to re-propogate.
Fix with a child branch and merge in subsequent changes
If the changeset has already propogated too far, you could try updating to the affected revision, forcing a dummy commit and in that commit message, explain what was wrong with the previous commit message. This changeset can then be merged with your current branch tip to bring everything up to date.
For instance, if the incorrect message was "Closes #5234" and it should have been "Closes #5324" then the child message could be "Uncloses #5234, Closes #5324".