revert/shelf/undo/redo

Michael Ellerman michael at ellerman.id.au
Wed Oct 26 12:05:42 BST 2005


On Tue, 25 Oct 2005 10:18, Martin Pool wrote:
> On 19/10/05, Michael Ellerman <michael at ellerman.id.au> wrote:
> > On Wed, 19 Oct 2005 13:12, Martin Pool wrote:
> > Basically I'd like a "shelf" to become a place where you can put multiple
> > uncommited hunks, and/or commits. The default would be to shelve
> > everything, the current behaviour would be selected with --hunks or
> > --select.
> >
> > Unshelve would then bring things off the shelf in reverse order (ie.
> > LIFO), commits would be recommited, and uncommited hunks would just be
> > left in the working tree.
> >
> > Things that might be nice:
> >  - being able to "combine" two patches on the shelf, including combining
> >    non-adjacent patches. This could be tricky, but would be cool.
> >  - unshelving out of order. (similar problem)
> >  - when shelving commits, a choice of uncommiting them (ie. modifying
> > history) or saving their inverse as a new commit.
> >  - being able to switch between multiple shelves.
>
> That'd be nice.  If they're based on patches (or better, changesets)
> stored to files then a sufficiently advanced user can do some of these
> things themselves with only basic tool support.

Yep, agreed. We need changesets, (which need to be patches at heart), and 
people can hack them in fun ways until shelf has support for fancy stuff.

> > I'm not sure about undo. I think it could be cool, as long as *all
> > operations* that affect the repository are undoable. So that includes:
> > adds and removes, commits, pulls, merges, ignores (?) ... it could get
> > tricky. What you don't want is for the user to think "bzr undo will undo
> > X" and for it to actually do Y, especially when X is a subset of Y.
>
> That's true, and I did actually write that in the original design docs
> as a bug in tla giving this meaning (revert-and-save) to "undo".  A
> well-done universal undo can be a real boon to somebody exploring a
> program but it's probably just going to make things worse if it
> doesn't always undo the last action.
>
> You could get part way there by at least knowing what the last action
> was and saying "sorry, can't undo commit yet".

Yeah, I think if you're going to call it "undo" it had be pretty close to what 
you get in a word processor etc. ie. arbitrary levels of fine-grained undo 
and redo. That's probably doable, but more work than just revert to last 
checkin.

> Leaving aside undo, would it be reasonable to always do revert as a
> non-interactive shelve?  I think so.

Yeah that sounds reasonable. Shelf would need to know about renames etc., but 
if it used changesets presumably that would all come (more or less) for free.

cheers

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051026/b2c5cc26/attachment.pgp 


More information about the bazaar mailing list