getting started, advice and help

Ben Finney bignose+hates-spam at benfinney.id.au
Thu Feb 26 03:02:54 GMT 2009


mikekay at channelk.ca writes:

> Greetings. I have Bazzar installed and working, for the most part. I
> am looking for some advice on how to best to set this up for our
> particular use.

Welcome, and thank you for choosing Bazaar.

> I have two developers at remote locations. I have two on-site - all
> working on different aspects of the code - this is a web
> application. What I would like to accomplish is to keep a
> centrailzed store of all the code,

Bazaar by default will operate in a decentralised workflow, but easily
supports working with a central repository for any particular branch
<URL:http://bazaar-vcs.org/Tutorials/CentralizedWorkflow>.

> plus have the remote and local users keep their own code local, and
> update the central store when its tested and working.

This is a major point that brings people to a distributed VCS like
Bazaar. You can create a new “feature” branch from the “mainline”
branch, work on it and commit to it as often as you like, and merge
the changes back into the mainline branch as often as you like.

An example:

    $ cd ~/projects/spangulator/
    $ ls -F
    mainline/ feature-foo/
    $ bzr info mainline/
    Repository checkout (format: rich-root-pack)
    Location:
      repository checkout root: /home/bignose/projects/spangulator/mainline
            checkout of branch: bzr+ssh://bzr.example.org/spangulator/mainline/
    $ bzr info feature-foo/
    Repository checkout (format: rich-root-pack)
    Location:
      repository branch: /home/bignose/projects/spangulator/feature-foo

    Related branches:
      parent branch: /home/bignose/projects/spangulator/mainline


Make a new feature branch for working on feature “foo”:

    $ bzr branch mainline/ feature-bar/
    $ bzr info feature-bar/
    Repository checkout (format: rich-root-pack)
    Location:
      repository branch: /home/bignose/projects/spangulator/feature-bar

    Related branches:
      parent branch: /home/bignose/projects/spangulator/mainline

    $ cd feature-bar/
    $ # hack hack hack
    $ make test
    $ bzr commit

After working on feature “foo” for a while, we want its changes back
in the mainline, which may have changed centrally:

    $ cd ../mainline/
    $ bzr update
    $ bzr merge ../feature-bar/
    $ # resolve conflicts, if any
    $ bzr commit

> This allows me to not only version control but to back up all the
> code on the central server.

Yes, this is one good reason for using a centralised workflow: you get
to decide *which* branches are worth backing up, and all the rest are
ephemeral.

> I belive then that each developer works on their own branch and the
> branches are merged into one repository? Do I have this right?

Yes, with the extra feature that there can be many central branches
and many local branches, and ancestry is preserved between all of
them.

-- 
 \       “Try to learn something about everything and everything about |
  `\                                  something.” —Thomas Henry Huxley |
_o__)                                                                  |
Ben Finney




More information about the bazaar mailing list