Bazaar Basics
=============

An alternative to using `cobzr` is to use the normal `bzr` with light-weight
checkouts (see `bzr help checkouts`).

The fisrt step is to create a repository that contains the juju-core trunk and
other working branches.


The Repository
==============

See `bzr help repositories` for more info on repositories.

For this example, we'll use ~/src as a location for the repository.

  $ cd ~/src
  $ bzr init-repo juju-core

This will create a repository that has working trees (the actual files and
directories - see `bzr help working-trees`.

Now put trunk in there:

  $ cd juju-core
  $ bzr branch lp:juju-core trunk


Working in $GOPATH
==================

Now that we have trunk of juju-core elsewhere, we now need to use it inside
$GOPATH.

These steps assume that you have juju-core already available in $GOPATH/src.

  $ cd $GOPATH/src/launchpad.net/juju-core
  $ bzr reconfigure --lightweight-checkout --bind-to ~/src/juju-core/trunk

Now when you look at that branch, you should see the following

  $ bzr info
  Lightweight checkout (format: 2a)
  Location:
    light checkout root: .
     checkout of branch: /home/<you>/src/juju-core/trunk
      shared repository: /home/<you>/src/juju-core


Making pushes easier
====================

You can specify information in the bazaar locations file which it uses to
determine the locations of the public and push locations for a branch.

Inside you're ~/.bazaar/locations.conf file, add the following (not including
the curly braces).

{{{
[/home/eric/src]
public_branch = bzr+ssh://bazaar.launchpad.net/~eric-the-viking
public_branch:policy = appendpath
push_location = lp:~eric-the-viking
push_location:policy = appendpath
}}}

And replace 'eric' with your login id, and 'eric-the-viking' with your
launchpad id.

The `appendpath` policy means that the directories under ~/src are added to
the path, so ~/src/juju-core/trunk would be pushed to (by default)
lp:~eric-the-viking/juju-core/trunk.  What this means is that when you create
a new branch `new-work`, and go `bzr push` it goes to
`lp:~eric-the-viking/juju-core/new-work`.


Making a branch to work in
==========================

Inside the $GOPATH/src/launchpad.net/juju-core directory, you can create a new
branch to work on using:

  $ bzr switch -b new-work

This creates a new branch in `~/src/juju-core` called `new-work` and switches
the working tree to use that.  Commits are now on that new branch, and push
sends it to launchpad to the `new-work` branch.

Everything else works the same.

Add some documentation around lightweight checkout usage.
Add some documentation around lightweight checkout usage.