Checkouts vs bound branches

Matthew D. Fuller fullermd at over-yonder.net
Tue Jun 30 10:44:47 BST 2009


On Tue, Jun 30, 2009 at 05:11:53AM -0400 I heard the voice of
John Szakmeister, and lo! it spake thus:
> 
> The snippet above only talks about checkouts.  In what way does a
> bound branch differ from a heavyweight checkout?

A checkout gives you a working tree on a branch.  A bound branch gives
you a branch that's expected to stay in sync with another branch (and
generally a WT on that branch too).  In the former case, you have a WT
here for a branch there, in the latter you have a WT here for a branch
here, AND a link of some sort between the branch here and the branch
there.

As a result, things that work on the branch in one fashion or another
can be expected to do very different things.  `bzr up` on a checkout
should update the WT here to the head of the branch there; in a bound
branch, it should update the WT here to the branch here.  pull in a
checkout should do its thing to the branch there; in a bound branch,
it makes more sense to do its thing to the branch here (and possibly
then to the branch there as a side effect of the binding).

Fundamentally, when you ask for one or the other, it's because you're
conceptually creating different structures and asking the tool for
different strictures.  Concepts like unbinding and commit --local are
sensible things on a bound branch; you have a separate branch that you
generally want to keep in sync with another, but not necessarily
always.  But they don't make any sense in a checkout.


The answer to "In what way does a bound branch differ from a
heavyweight checkout?", as the two are implemented currently, is "in
no way, and that's exactly the problem".  You can simulate one with
the other, and it's a cheap and easy solution, but these sort of
subtle differences are what creates the inconsistencies and model/UI
complications we've had with them.


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



More information about the bazaar mailing list