[RFC] Moving uncommited changes from a tree to another.

Matthieu Moy Matthieu.Moy at imag.fr
Sun Aug 6 15:25:04 BST 2006


Hi,

I started hacking on a branch, and realized that I actually wanted
those changes in another branch before commiting (I say "branch" since
I have branches with working tree in the same place).

In GNU Arch, I did undo in one tree, and redo in the other (and since
GNU Arch is checkout-based, switch was also an option sometimes).

I believe bzr doesn't have a simple way to deal with this. I can do

$ bzr diff > ../otherbranch/my-modifs.diff
$ bzr revert
$ cd ../otherbranch/
$ patch < my-modifs.diff

But I think it's a pitty to use just diff and patch while bzr knows
about more kinds of changes (renames, executable bit, symlinks, ...).

I believe the best way to handle this would be:

1) allow revision bundles to refer to uncommited changes. I believe
   Robert's proposal to consider the working tree as a kind of
   particular revision goes in this direction too.

2) Have "bzr revert" leave a bundle of the state of the tree before
   revert somewhere.

3) Have a way to apply this bundle without creating a new revision. I
   mean, the changes should appear in the working tree as they used to
   be.

Anyway, I've always been uncomfortable with "revert" comming without
an "unrevert"...


Do this sound reasonable? Without this, is there a better option to
move changes from a tree to another?

-- 
Matthieu




More information about the bazaar mailing list