[PLUGIN] bzr uncommit

John A Meinel john at arbash-meinel.com
Sun Jun 26 23:05:45 BST 2005


It has been mentioned in the past that while a revision id uniquely
determines a tree snapshot, there is not really an problem with rolling
back an old commit, as long as you always pull off the end. And if you
look at the bzr.dev source, you will see quite a few
revision_history.~x~ files indicating that Martin has manually backed up
history a few times.
With some of my new rpull code, if your trees get out of sync, you have
to manually edit the revision_history in order to allow a re-sync.

So I went ahead and made a plugin for uncommitting the last revision. It
doesn't touch the working directory, but it gives you the option to
remove the files from the stores.
This should work as a "I committed the nuclear codes, and now I need it
to disappear."
In the future, I would like to have uncommit actually generate a
changeset, which could then be reapplied to the tree. That way you could
do something like:

bzr rpull
** trees have diverged
bzr uncommit > ,changeset
bzr rpull
bzr apply-changeset < ,changeset
bzr commit

You could have uncommit save the revision id, such that bzr
apply-changeset could restore it, if the parent id stays the same.

Right now, I also have bzr uncommit print the log of the last commit,
and prompt to make sure that you really want to remove it. Probably once
I can generate a changeset, I will remove that, since you have a way of
undoing your action.

This may or may not be desirable in the main distribution. Removing
history is always a sensitive thing. But for right now, we need it since
we cannot merge properly.

John
=:->

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: uncommit.py
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20050626/fdc925c1/attachment.diff 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: __init__.py
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20050626/fdc925c1/attachment-0001.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050626/fdc925c1/attachment.pgp 


More information about the bazaar mailing list