Checkout existing branch to established workspace (.moved)
Colin D Bennett
colin at gibibit.com
Thu Mar 29 17:51:27 UTC 2012
-----BEGIN PGP SIGNED MESSAGE-----
On Thu, 29 Mar 2012 13:26:54 -0400
Aaron Bentley <aaron at aaronbentley.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> On 12-03-29 12:05 PM, Colin D Bennett wrote:
> >> The bzr-pipeline version of switch, switch-pipe, makes this a
> >> lot nicer by associating a special shelf with each branch.
> >> When you switch-pipe out of a branch, any uncommitted changes
> >> are stored in the branch's shelf, and if the branch you're
> >> switch-piping into has any shelved changes, they're
> >> automatically restored.
> > That sounds great!
> > Does the shelf live in the branch, or in the working tree as it
> > does today?
> It lives in the branch.
That's exciting, but also concerning.
That's good in a lot of ways, especially since I generally consider
a checkout to be “throwaway” and not “precious”. By that I mean,
if a checkout is clean, you can delete the checkout without losing
any information. However, currently with shelve/unshelve this will
discard the shelved changes, right? So storing shelves in the
branch is a Good Thing.
But does that complicate things?
What if you push or pull a branch with shelves?
Are the shelves themselves versioned?
What if a shelf has been deleted from the source of a push, but
not from the destination... will it be as messed up as the Bazaar
tags implementation, such that deletes don't propagate with
What if you have checked out a public shared branch, e.g., 'trunk'
of the project server... what happens if you shelve changes there?
One way that I often use shelves is if I start on some small piece
of work that might be a one-liner, I start out right in a checkout
of trunk without creating a feature branch as I generally do. So,
in this checkout of trunk, I start making the change to the working
tree, and realize I've had to make significant changes to stuff, so
I want to switch to a new feature branch for the work.
I will do a 'shelve', then 'switch --create-branch FEATURE'
and then 'unshelve'. Will that work if shelves are stored in the
branch instead of working tree? What if someone else shelves a
change to trunk from their checkout in between my shelve and
unshelve operations? Will I get the right change unshelved?
Does the above situation change if I instead have an unbound local
branch of trunk that I push/pull instead of using a checkout?
> > Is there a way to see all the shelved changes for all branches
> > in the working tree?
> You can see which whether a branch has shelved changes, but not
> what the changes are.
Do you mean that you can see a list of the shelves, with the
description, as 'bzr shelve --list' does? Or do you mean a simple
“yes, there are one or more shelved changes” vs “no shelved
I hope there would be a way to quickly summarize the things on the
> > I wouldn't want to forget where my code changes disappeared to,
> > which I might do after switching between several branches.
> We could probably add an option to diff to show a shelved change,
> similar to -c
I recently started using qbzr's qshelve/qunshelve tools, and *wow*
it makes shelves much more powerful since it's really tedious and
inefficient to do selective shelving, or explore the list of
changes on the shelf, with the command line.
I hope the q(un)shelve tool will support any new shelving method.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the bazaar