proof-of-concept: plugin for organizing set of bzr branches as complex project

Alexander Belchenko bialix at ukr.net
Fri Nov 21 17:08:08 GMT 2008


Hi,

On my work we need to organize several independent branches as single complex project.
All these years I'm like many others waiting for Nested Tree support in the bzr.
Unfortunately, it seems like implementing of this feature (and line-ending support as well)
unlikely will be finished soon.

So I decided to write simple plugin to managing set of branches as complex project.
Back in the days I've used TortoiseCVS we using CVS modules ability to configure
complex projects. It works well.
I've read about Mercurial's forest, Mercurial's nested trees spec, and git submodules
man page as well. All this solutions seems to use the same VCS to keep meta-data about
complex project. I don't like this approach, so I'm working on creating special meta-data
object independent of .bzr directory and its content. This allows me to have one
subproject directly in the project tree (neither hg solution nor git allows this).
This is main difference, but in general it will be very simple solution,
and project-wide operation I will implement as simple loop over known components
inside project space and invoking bzr commands there (e.g. for status, diff, commit).
Nested Trees should and will be ideal solution one day sometimes.
My plugin is ugly substitution, I know.

I've used !bzrproj as name for directory that holds meta-data.
This is deliberate choice, and I won't change it to .bzrproj or something like this.

To describe project I'm using config file config.prj. Here is example of config.prj
template created when new project initialized:

[PROJECT]
## Optional project description
# name =
# description =
## Space separated list of components names
# components =

[ALTS]
## describe project variations here in the form
## variation_name = component1:branchA component2:branchB

[VIEWS]
## describe predefined partial views of project here
## as space separated lists of visible components:
## view_name = component1 component2 ...

## describe each component in subsequent sections
# [name of component]
# ## Optional component description
# description =
# ## Mapping of component directory to project tree
# relpath =
# ## URL to main [shared] repo with component branches
# url =
# ## Space separated list of used branches for this component
# ## as relative paths for component repo url
# branches =

As of today I have simple implementation for commands like:
project-create, project-get, project-info and project-checkout.
Thank you bzrlib to very handy transport subsystem.

So I can create new project on central server, specify set of branches
(manually edit config.prj) and then create checkout of the project
on local machine. (Actually today checkout is invoking built-in branch
command, but at least it's the start for me).
I have other ideas I'm plan to try to implement. Today I'm in the stage of pre-alpha.

Although my code already on launchpad, I don't think there is something
interesting yet. And I'm planning to work on it some time alone to test
some my own ideas.

If you want to comment my config.prj format please speak up.

Alexander.

P.S. If you think I'm doing foolish work -- I'm fine with it, I'm doing it for
my personal usage in first place. So you don't need to tell me this.




More information about the bazaar mailing list