Search code examples
bazaar

Pulling/Pushing/Merging changes up a branch with Bazaar


I'm currently experimenting with Bazaar, trying to find a configuration that works well for the project I am currently working on with a team of developers. Our model is currently centralised but I am open to persuasion about changing this if I can see significant benefits. Despite advocating it, I will not be able to change the version control system... some people don't know what's good for them.

At present, the project is divided into tiers. It's a web project and consists of a data access layer, a business/domain logic layer and a web layer (and a bunch of other application level projects such as services that that sit on the domain).

At present I find a bazaar repository with a number of working trees in there, one for each of the tiers I have mentioned.

Question part 1

Is there a better alternative to using working trees inside a respository for each tier?

What I have considered:

  • Putting everything into one fat branch/working tree (I am told this was purposely avoided, because of the necessity to check out everything). Developers are creating their own local setups by checking out subsets of the multiple repositories. For example if I am working on one of the services, I checkout the service, the business layer and the data access layer to a local directory. In the current setup though, I can checkout a top tier application which doesn't affect anything else, make a change to it and commit it back, without checking out the entire repository, which is nearly 1GB in size.

What I would like to remedy:

  • The problem is really that my web tier is reliant on a version of the business layer, which in turn is reliant on the data access layer. With a project organised like this, I have no idea which version of the business and data access layers were current for a given commit on the web layer. This feels very bad to me. I want to be able to checkout versions of our application relative to some commit to one of the working trees. At the moment we are attempting to keep track of this across all of the working trees with tagging, but it feels pretty wrong to me.

Question part 2

If I branch one of these tiers for a release branch, and find that a change in the root of the branch needs to be in that release, how do I push only those required changes into the branch?

So assuming that the structure of one working tree (or possibly a real branch) exists for each of these projects, we would like to have a branch for each of these, which contain a version for the a particular release. So the website tree has a website_rls1 branch, which encapsulates the state of development for that particular release. General development for a later release is going to happen concurrently. So if one file out of many happens to be relevant to this release, I would like to merge that single file into my release branch. What is the preferred method of doing this. As I understand it, Bazaar does not support merging/pulling individual files.

What I have considered:

  • Just putting the files I want into my local checkout of the release branch and committing

What I would like to remedy:

  • Following this consideration is going to kill off version information for this file. I want to keep the version information in tact, but only merge in a subset of changes. I essentially want to push individual files up to the child branch, or something to the effect of.

Any thoughts appreciated.


Solution

  • #1 There are two plugins for managing multiple dependent bzr repositories:

    1. https://launchpad.net/bzr-externals
    2. https://launchpad.net/bzr-scmproj

    They have different approaches and are suited to different situations.

    You may also want to consider solving this problem at the build level. Use a continuous integration system like Jenkins and a dependency resolution system like Ivy or Maven. QA should be done using automated builds from this system so that bugs that are filed can refer to a particular build number which should include in its logs the versions of the various dependencies used to produce that build.


    #2 There isn't really a way to do that merge. Bazaar doesn't track cherry-pick merges (yet). A better approach would be to make the original fix in the release branch and then merge it back into its parent.