single directory multiple branches.

Neil Martinsen-Burrell nmb at wartburg.edu
Tue Jan 5 03:53:29 GMT 2010


On 2010-01-04 19:33 , Eric Berry wrote:
[...]
> This translates to a directory structure like:
> local shared repo/
>     project/
>        main branch/ (kept clean)
>        team1 branch/ (kept clean - merges from main branch periodically)
>        team1_f1 branch/ (local development on feature 1)
>        team1_f2 branch/ (local development on feature 2)
>        team1_f3 branch/ (local development on feature 3)
>
> What I'd like is a setup more like this:
> local shared repo/
>     project/
>        main branch/ (kept clean)
>        team1 branch/ (kept clean - merges from main branch periodically)
>        team1_work branch/ (local development)
>
> The benefit for me would be that I can point my IDE at the team1_work
> branch, and never have to change that. As I work on feature 1 I would
> switch the work branch to the feature 1 line of development. If I need
> to work on feature 2 during feature 1 development, I can commit my
> changes to feature 1, and switch to feature 2.
>
> Is this possible with Bazaar?

Absolutely.  The key is to make the team1_work branch a checkout of the 
team1_f? branches (which then don't even need to have a working tree of 
their own; although they can if disk space is not an issue).  So, I 
would just add a team1_work directory to your current structure and do 
all of your IDE work using that working copy:

$ cd local\ shared\ repo/project
$ bzr checkout --lightweight team1 team1_work
$ cd team1_work
$ bzr switch team1_f1 # just works because switch looks for siblings

The use of ``bzr shelve`` even allows for persistence of uncommitted 
changes when switching to team1_f2.

As the UI for setting up these sorts of situations improves (Bazaar 
Explorer and a couple of bzr CLI plugins) I believe this working style 
will become even more common.

-Neil



More information about the bazaar mailing list