Noob questions for installing/upgrading Bazaar, and setting up/understanding feature branch workflow...

Neil Martinsen-Burrell nmb at wartburg.edu
Mon Apr 13 05:17:21 BST 2009


Richard B. <dj_deipotent <at> yahoo.co.uk> writes:


> 1) First, installation/upgrade - Initially I just used the Windows
> installer to install 1.13.1 and it worked fine. Then I wanted to try
> the latest 1.14rc1, but wasn't sure how to go about it. Are there
> instructions for:
> 
> a) Windows instructions for upgrading to beta/RC builds when you initially
installed with the
> installer ?
> b) Windows instructions for installing Bazaar (including Python
> instructions) without using the installer (ie. using the tar.gz) ?

I'm not a Windows user, so I'm afraid I can't help you here.  Bazaar installs
from source like any other python program.  So you need to install Python, any
dependencies for Bazaar, then download the .tar.gz and run "python setup.py
install" in the unzipped source folder

> 2) Feature branch workflow - I'm a sole developer who works on
> multiple projects on a local machine. When I need to fix a bug on a
> project or add a new feature, I would like to create a new branch.
> However, I may want to work on several fixes/enhancements at the same
> time (ie. have multiple branches open), and for multiple projects.
> 
> I was thinking of using the project/trunk layout (User Guide
> 10.3.1.1), and using the preferred way for Bazaar:
> 
> D:\
>   +- Projects
>     +- Project1\
>       +- trunk\
>       +- branches\
>         +- foo\      branch for fixing foo bug
>     +- Project2\
>       +- trunk\
>       +- branches\
> 
> Do I really need a trunk folder, or can I just store the mainline code
> in Project1, Project2 etc. ?
> 
> The User Guide 10.3.1.1 appears to say that with Bazaar, each project
> should have it's own shared repository (ie. all child branches of a
> project use that projects repository). Is this correct, and what advantages
> does this method have over using a single shared repository for all
> projects and child branches ?

The only advantage I'm aware of with a shared repository per project vs. one
shared repository for all projects is that it allows you to move the per-project
repositories around at will.  (Although creating new branches and suitable
invocations of "bzr branch" can give the same results even using one large
repository.)

> If going for a single shared repository, am I right that entering the
> following at the command prompt (at D:\) will set it up:
> 
> bzr init-repo Projects
> cd Projects

Yes.

> Given the folder layout, what do I then need to type when creating a
> new project ?

cd Projects
mkdir Project1
cd Project1
bzr init trunk

> What would I type when starting a new fix/feature ?

cd Projects/Project1
bzr branch trunk new_feature

> When I have finished working on a fix/feature and want to commit,
> which folder do I need to be in, what command do I type, and where
> will it be committed to (ie. branch, trunk etc. ?) ?

As you work on your feature, you will commit in the new_feature directory.  When
the feature is committed and you want to add the feature to the trunk you can

cd ../trunk
bzr merge ../new_feature

then fix any merge conflicts and commit in trunk with "bzr commit -m 'merged new
feature'"

> Suppose I create a branch foo under Project1 to work on a fix, but
> after a bit of work decide I've made a complete mess and wish
> to restart the fix from the beginning (ie. undo all changes made for
> the fix) ?

If you want to completely abandon the branch, one possibility is to just remove
it completely: "del /s new_feature"

> That will do for starters, but I'm sure I'll have more questions ?

Good luck.  This is a great place to ask questions and get answers.

-Neil





More information about the bazaar mailing list