Branching with a Central Repository

A. S. Budden abudden at gmail.com
Tue Oct 6 13:53:27 BST 2009


Dear all,

We are currently looking to move over to Bazaar at my workplace.  Due
to the way work is backed up and shared, we will be using the central
repository approach [1] mostly, such that everyone uses checkout to
get projects.  The initial plan for a repository layout (no working
copies) is:

    root\ProjectGroup\Project1
    root\ProjectGroup\Project2

These will be the trunk of the project.  I had thought that if we
create branches (we don't really do this at all at the moment), the
new branches will be:

    root\ProjectGroup\Project1\feature-gui
    root\ProjectGroup\Project1\feature-magic

etc (this may change or be grouped by developer or something else).

However, I'm not clear from the documentation how to actually work
with this.  We have a very thorough backup régime on the repository
and are very keen to use this as the commit destination.  The closest
thing I've come up with (which seems especially convoluted in the
GUIs, which most of my colleagues will use) is something like (I may
have made mistakes here):

    # Get the project
    bzr co f:\root\ProjectGroup\Project1
    cd Project1

    # Do some editing (e.g. go to revision 10)
    bzr ci -m "Done some editing"

    # Now branch: it'd be nicer to just do
    # "bzr branch feature-gui" and automatically
    # handle the relationship to the current checkout
    bzr branch f:\root\ProjectGroup\Project1
f:\root\ProjectGroup\Project1\feature-gui

    # Bind to the new feature
    bzr bind f:\root\ProjectGroup\Project1\feature-gui

    # Do some editing (e.g. go to revision 11)
    bzr ci -m "Added GUI template files"
    # Do some more editing (e.g. go to revision 12)
    bzr ci -m "Added GUI"

    # Now we need to merge it back into the mainline
    # (so we get 10.1.2 or whatever [2]) and switch back.
    # How do we do this cleanly?

    # Guess (this is nasty):

    # Bind to the original project path (this could get messy as
    # we've got the changes already made!)
    bzr bind f:\root\ProjectGroup\Project1\
    # Merge in the changes
    bzr merge f:\root\ProjectGroup\Project1\feature-gui


Is there a better way to do this?  I've been reading the
documentation, but most of the branching/merging discussion focuses on
the distributed development workflow.

Thanks in advance,

Al

[1] http://doc.bazaar-vcs.org/current/en/user-guide/index.html#centralized
[2] http://doc.bazaar-vcs.org/current/en/user-guide/index.html#hierarchical-history-is-good

-- 
http://sites.google.com/site/abudden



More information about the bazaar mailing list