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

Neil Martinsen-Burrell nmb at wartburg.edu
Mon Jan 11 03:35:51 GMT 2010


This is to announce the initial release of the bzr-colo plugin, which 
supports the use of colocated branches using *existing* technologies in 
Bazaar.  It is available at http://launchpad.net/bzr-colo or directly 
from Bazaar with a ``bzr branch lp:bzr-colo ~/.bazaar/plugins/colo``.

The essential insight is that a directory specifier colo: can be used to 
refer by name to branches stored in a .bzr/branches shared repository. 
The remaining commands provide a user interface for working with these 
hidden branches so that operations inside .bzr/branches are (almost 
completely) unnecessary.

Jelmer Vernooij's bzr-colocated plugin provides a parallel 
implementation of these ideas, by adding a new BzrDir format for branch 
collections.  His plugin also supports "%" as a special character in 
URLs to denote colocated branches, where this plugin uses the colo: 
directory service.  When such formats appear in Bazaar's core, then the 
bzr-colo plugin will be unnecessary.  However, for people using Bazaar 
2.x, the bzr-colo plugin can provide the colocated branch workflow 
without a software or disk format upgrade.

Matthew Fuller's Fascis concept 
(http://wiki.bazaar.canonical.com/MatthewFuller/Fasces) also provided 
important ideas for this plugin.  This plugin offers some of the 
functionality suggested there using the concept of a colocated workspace 
(==fascis).  One area of that functionality *not* implemented is that of 
changing the default behavior of Bazaar commands.  This plugin 
intentionally does not change existing commands, choosing instead to 
include new functionality only in the colo-* commands.  This plugin will 
only change existing commands once colocated branch functionality is in 
Bazaar core.  The equivalencies between the colo-* commands and Bazaar's 
builtin commands are straightforward.

Further thanks to Ian Clatworthy who first mentioned that a simple 
plugin could augment possible future changes in Bazaar Explorer to work 
with .bzr/branches and Stephen Turnbull who (unknowingly) prompted the 
inclusion of the colo-clone command for creating a second working tree 
for the same colocated workspace.


More about the plugin from the help:

In order to provide a faster and simpler working model, this plugin 
tries to support a configuration similar to git and Mercurial's 
colocated branches, where there is a single working tree that can be 
switched between multiple branches that all co-exist in the same 
directory.  This working model is entirely possible using Bazaar's 
existing technology, and this plugin aims to make it as simple as 
possible to use that model.

This plugin does not add any new formats or objects to Bazaar, it simply
provides convenience commands for working with a certain *convention* 
for branch storage.  This plugin provides the following commands

     * colo-init
     * colo-branch
     * colo-branches
     * colo-fetch
     * colo-clone
     * colo-prune
     * colo-clean
     * colo-ify

For more information on working with this plugin, see ``bzr help
colo-tutorial`` and the help for the individual commands.

Referring to Colocated Branches
-------------------------------

This plugin adds a directory service of "colo:" that can be used to 
refer to branches inside of the ``.bzr/branches`` directory.  So, for 
example we could ``bzr switch colo:fix-eol-bug`` to do work in the 
colocated ``fix-eol-bug`` branch.  Note that in some cases, the "colo:" 
prefix is unnecessary because Bazaar automatically looks for branches in 
the directory where the current branch is located.  So the previous 
command would also work with ``bzr switch fix-eol-bug`` because switch 
searches sibling directories automatically.

 From within a colocated workspace, the specifier ``colo:branch_name`` 
refers to the branch with that name in the current colocated workspace. 
  It is possible to refer to colocated branches in *other* workspaces 
using the syntax ``colo:workspace_location:branch_name``.  The 
``workspace_location`` in this form can be either a path (e.g. 
``colo:../other_project:trunk``) or a URL (e.g. 
``colo:bzr+ssh://hostname/path/to/workspace:trunk``).

-Neil



More information about the bazaar mailing list