views:

50

answers:

2

How can I edit an older revision's message to more correctly describe its changes?

+2  A: 

No, you can't edit commit messages for older revisions. Revisions in Bazaar are immutable. You would have to reconstruct the branch from the revision you have to change.

Lukáš Lalinský
*"Revisions in Bazaar are immutable"* -- Any other source control system where they aren't?
Jenko
People have been seen editing past revision in CVS and Subversion. It's still "bad". But just editing commit messages in a centralized VCS does not break anything (except maybe mirrors to DVCS). In Bazaar, such changes are strictly verboten because they cause integrity violations of the distributed database. In Git and Hg they are impossible by design.
ddaa
+3  A: 

You cannot edit the commit message of an old revision without changing the revision id of the modified revision and all its descendants.

Well... technically you can, if you try hard enough, but the technical term for the result is "corrupt repository". A repository in bzr is a replica of a distributed database of revisions, and if all replicas don't agree on the content of a revision, you have an integrity violation. Meaning, all bets are off, and the system will actively try to detect such situations and refuse to work.

To modify the commit message of the last revision in a branch, you can use "bzr uncommit", followed by "bzr commit" with the new commit message.

To modify the commit message of an older revision, you get a branch whose last revision you want to modify, use "uncommit" then "commit", and re-attach the subsequent revisions using "bzr rebase" or "bzr replay" (from the "rewrite" plugin).

In every case, that will produce a branch which is considered "divergent" from the one you had initially. If the initial branch was published, your original revisions can come back to cause painful merges, history pollution, and generally haunt you.

ddaa