Hierachical branches

Asked by Annakan on 2012-06-05


I am trying to understand if Bazaar does not support this or if my understanding of DVCS is still too be improved :) Maybe both :D

I would like to know if bzr supports a hierarchical branch structures that I would call nested if nested branches were not something else unless I am mistaken.

Explanation : I want to put my whole project tree under version control but define independent branches for design, code , documentation under the root project umbrella.

But what I need is that when I commit into a "leaf" branches a partial commit is also done in the top branches.
That way I can get the whole project tree, including the sub branches with a bzr pull ///projectRoot, but still publish to the //projectRoot/04_documentation/sphinxDoc branch separately of the //projectRoot/01_projectManagement branch!.

The goal is to be able to expose and allow commit to one of those "sub" branches without giving access to the whole tree while still keeping the whole view and coherency of the whole project.

As far as I understand, nested branches are not the same thing, since when I do a nested branch, the files versionned under the nested branch are ignored by the branch above it, so doing bzr log on the top branch does not show commits of the "nested" branches...

Is what I want to do possible ?
Do other people have such needs ? and how did they achieve something close if what I ask for is not possible ?

Thanks a lot for your time.

Question information

English Edit question
Bazaar Edit question
No assignee Edit question
Solved by:
Jelmer Vernooij
Last query:
Last reply:
Best Jelmer Vernooij (jelmer) said : #1

The feature you're asking for is indeed nested branches. I've linked the relevant bug report.

Bazaar itself doesn't support nested branches yet. There are various plugins that do provide this functionality in one way or another though. You might want to check out bzr-externals or bzr-scmproj.

Annakan (annakan) said : #2

Thanks a lot for your anwer.

I had a look at bzr-externals and bzr-scmproj and the later seems to cover what I need, but is quite a beast to set up, I am still digging into it.

Nested branches would be really a big plus as would be more fine grained permissions on branches and sub branches and the command level, I think those are the two things slowing bazaar adoption in "enterprise settings" where bazaar could shine and gain popularity with its flexibility and emphasis on "clean and clear".
To be more precise I think it would be a good thing because it would make company open sourcing some components of some projects or codebase more easily manageable and more natural, and help "advocate like me" make a case for the Tool.

Thanks again for pointing me in the right direction.

Annakan (annakan) said : #3

Thanks Jelmer Vernooij, that solved my question.