Library development in a distributed version control system (bazaar)

I'm relatively new to the bazaar (mostly using cvs, then subversion, and for my current job, we're using SourceUnsafe). My current development environment is structured like this:

\ dev (shared repository)
  \ trunk
    \ project1 (branch)
    \ project2 (branch)
  \ branches
    \ proj1-bugfix123 (branch of \ trunk \ project1)
    \ proj1-featureA (branch of \ trunk \ project1)

Now if I decide that some aspects of project1 are better suited as a library (or assembly, since this is an AC # project) rather than classes within the project , what would be the best approach to structure this in the bazaar. I came up with two possibilities that I think are viable. The first thing I think is the "correct" way.

\ dev (shared repository)
  \ trunk
    \ project1 (branch)
    \ project2 (branch)
    \ libXXX
  \ branches
    \ proj1-bugfix123
      \ main (branch of \ trunk \ project1)
      \ libXXX (branch of \ trunk \ libXXX)
    \ proj1-featureA
      \ main (branch of \ trunk \ project1)
      \ libXXX (branch of \ trunk \ libXXX)

The problems with this are that I now need to remember to update the solution file to include the projects I want whenever I make a branch and don't push it, and also remember to check in changes back to both the project and library at the same time (for example, if featureA in project1 requires changes to libXXX to work).

\ dev (shared repository)
  \ trunk
    \ project1 (branch)
    \ project2 (branch)
      \ libXXX
  \ branches
    \ proj1-bugfix123 (branch of \ trunk \ project1)
      \ libXXX
    \ proj1-featureA (branch of \ trunk \ project1)
      \ libXXX        

The problem with this approach is that if another project, such as project3, wanted to use libXXX and was in source control, it would have to detach from project1 and the project1 files would be deleted. It would be messy.

I guess there is a third option where the whole trunk is a branch, as in subversion, but that seems to contradict the way I think they are supposed to work in the bazaar.

If it was done in SourceSafe, I would just do it like the second example, but had libxxx folders in both places, but shared as this is the only mechanism by which the original device should be installed.

0


source to share


3 answers


Wouldn't you like the new libraries to have their own solution and be built as part of it and then link to other projects. This way, only one version is generated in the library (instead of one for each solution).



0


source


There is no easy solution in bzr. You need support for nested trees, but it hasn't been implemented yet ( http://bazaar-vcs.org/NestedTreeSupport ), but maybe soon.

There is an old tool called config-manager ( https://launchpad.net/config-manager ).



There is also a new bzr plugin called scmproj ( https://launchpad.net/bzr-scmproj ), this is an alpha now and in active development.

+3


source


While there is no support for nested trees in Bazaar, or Bazaar is developing something similar to Subversion 'Externals' (if I understand them correctly), your flexibility in including libraries in the Bazaar branch tree is limited.

Until then, maintain the library as a separate project on a clean clean branch. If you need a library included in a project, for example its files are inside its own project tree, then copy them. If you make any changes to the files in this library that you want to push back to the library, check those changes back into the local branch of that library and merge / commit there.

+1


source







All Articles