[ANN] bzr-colo 0.0.1: colocated branches using present technology

Neil Martinsen-Burrell nmb at wartburg.edu
Tue Jan 12 03:48:49 GMT 2010


On 2010-01-11 16:19 , Russ Brown wrote:

[...great bug reporting snipped...]

> # All perfect so far! Now try using switch's shortcut and don't prefix with
> colo:
> ~/test/colo$ bzr switch trunk
> Updated to revision 0.
> Switched to branch: /home/rbrown/test/remote/trunk/
> ~/test/colo$ bzr info
> Lightweight checkout (format: 2a or development-subtree)
> Location:
>    light checkout root: .
>     checkout of branch: /home/rbrown/test/remote/trunk
>      shared repository: /home/rbrown/test/remote
>
> Oops, there it goes deleting the link to the colocated branch! The checkout is
> now completely connected to the remote repository and doesn't involve the
> colocated branch at all. Look what happens when I try to switch back to
> branch1 now:
>
> ~/test/colo$ bzr switch branch1
> Updated to revision 0.
> Switched to branch: /home/rbrown/test/remote/branch1/
> ~/test/colo$ bzr info
> Lightweight checkout (format: 2a or development-subtree)
> Location:
>    light checkout root: .
>     checkout of branch: /home/rbrown/test/remote/branch1
>      shared repository: /home/rbrown/test/remote
>
> Related branches:
>    parent branch: /home/rbrown/test/remote/trunk
>    submit branch: /home/rbrown/test/remote/branch1
>
> Still connecting directly to remote... What happens if I specify colo:?
>
> ~/test/colo$ bzr switch colo:trunk
> bzr: ERROR: Invalid url supplied to transport: "colo:trunk": Not in a
> colocated workspace
>
> Oh dear, it looks like it's basically broken now. I'm not entirely sure what
> I'd need to do to go about rescuing this colo now...

A colocated workspace is fundamentally about the checkout.  It uses the 
checkout to look up the branches that live in the hidden shared 
repository in .bzr/branches.  When it gets switched to a branch that is 
not in that shared repository, it can't find those branches again.  The 
solution is to force the checkout to switch back to a branch that you 
*know* is in the shared repository, so ``bzr switch --force 
.bzr/branches/trunk`` from the root directory of the checkout should 
"rescue" it.

> As I say, I think that this is a core bzr problem rather than a problem with
> colo per se, and I think this plugin is really interesting and is something
> that I look forward to in the future.

I'll think about how to make the current colo structure more robust to 
this type of issue.  (It's also a problem when moving the colocated 
workspace around on disk since Bazaar uses absolute paths to reference 
branches from checkouts.)

-Neil



More information about the bazaar mailing list