Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I edit the message of an older revision in Bazaar?

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

like image 724
Robin Rodricks Avatar asked Sep 10 '10 07:09

Robin Rodricks


1 Answers

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.

like image 107
ddaa Avatar answered Oct 22 '22 09:10

ddaa