'bzr switch' and a lightweight checkout of a bound branch

Ian Clatworthy ian.clatworthy at internode.on.net
Mon Dec 3 08:00:30 GMT 2007


Matthew D. Fuller wrote:
> On Thu, Nov 29, 2007 at 09:50:12PM -0600 I heard the voice of
> John Arbash Meinel, and lo! it spake thus:
>> I *think* it should just move the lightweight pointer to another
>> location.
> 
> I dunno if it's not quite so clear.  The right answer may depend on
> whether you're really making a "bound branch", or a "[heavy]
> checkout"; there's a subtle intentional difference (this also ties
> into some questions about behavior of checkouts).
> 
> 
Matthew,

Can you elaborate on this please?

I'm about to implement switch for heavyweight checkouts and step one is
to ensure we're all expecting the same result.

FWIW, our glossary says that "checkout" is a synonym for "bound branch".
Seems overly simplistic, yes?

"bzr help checkouts" is the most definitive documentation but it doesn't
capture the nuances that pop up on the list. I suspect we have some work
to do to *clearly* explain checkouts vs branches vs working trees, how
things ought to operate when history horizons arrive, lightweight vs a
horizon of 0, bind vs switch, etc.

My mental model is that bind operates on the relationship between a
branch and a remote branch while switch operates on the relationship
between a working tree and its branch. A normal checkout implicitly sets
the bound branch; a lightweight checkout sets the branch reference for a
working tree instead. So the two are related in terms of user result but
different internally.

Is that a correct and good model? Is there a better one?

To dig deeper, what do you expect when:

1. I create a normal checkout, switch to another branch, commit a
   change, then switch back.

2. I try to create a lightweight checkout inside a treeless repo.

Thanks,
Ian C.



More information about the bazaar mailing list