Branches with multiple parents
I was wondering if anyone else is having this problem. The thing is, I have a huge alias file at the command line and a huge ALIASES section in my bazaar.config file all to manage my branching structure that I can't help but imagine could be made much easier if the version control software was just SMARTER.
Bazaar in my experience does handle linear branching well. One can, without too much effort, branch a child from a parent and IIRC branch merge will allow the parent to be rebound to the child. This is good and appreciated.
But, not all development is so simple. Normally, branching is used to add 'experimental' code that will eventually be included into the main line. So, assuming each Experimental Code item constitutes an individual "Feature Request", one may precede to produce each requested feature, let's call them numerically 1, 2, 4, each in its own branch.
So, Alice requests feature 1, Bob feature 2 and Cathy feature 4. So the developer creates branches 1, 2 and 4, each responsible for implementing Alice, Bob and Cathy's requests. As the developer works on each feature, she then notices some overlap between the implementation of 1, of 2 and of 4. In fact, what the developer notices is that to implement 1, she requires a certain set of changes, and then when she develops implement 2, she sees that she would have implemented 1 differently if she were to implement 2. In this example, so far, you would have the following branching diamond:
trunk
/ \
1 2
\ /
3
Here, a new branch, which represents a combination of the changes in branch 1 and 2 is created. We call this the sum of 1 and 2, or 3. The 3 branch will contain code that is unrelated to 1 or 2, code that is in 1 and independent of 2, code that is in 2 and independent of 1, and code that depends on both 1 and 2. So, when one wishes to merge in changes from 3's parents, one needs to take into account all of 3's ancestors to make sure that all 4 areas of code are updated. Unrelated code is the easiest: 3 can either merge directly from the trunk, or, even better, get the changes in the trunk indirectly from either 1 or 2, or both. So, the first issue is getting the trunk changes from 1 and then merging with 2 should NOT cause any conflict or changes since merging with 1 covered all the updates to 2 and thus although 2 was changed, none of those changes pertain to 3. For 1 or 2 specific code, this should be merged directly and should not create any interference since each code area does not effect the other. However, for the code which is dependent on both 1 and 2, we have another situation. In this case, merging from 1 then 2, or 2 then 1 may not be enough to correctly merge in sub branches. In this case, the developer will simply have to be knowledgeable of what she changed in 1 and 2, and know beforehand that the common code must be further massaged in 3.
Now, bringing 4 into the equation, we find that there is code common to no development (0), code specific to 1 (1), code specific to 2 (2), code from the combination 1 and 2 (3), code specific to 4 (4), specific to 1 and 4 (5), specific to 1 and 2 (6) and FINALLY, specific to 1, 2 and 3 (7). Cases 0-6 are all analogous to the above example. But, case 7 is a bit more complicated because given that simply branching from 1, 2 and 4 will not cover the code for 3, 5 and 6 in 7. Thus, in a sense, 7 should be derived from 1, 2, 4, 3, 5 AND 6. In other words, 7 will have SIX parents! Granted, it may be suitable to ignore the 1 only, 2 only and 4 only parents as that code could theoretically be provided from 3, 5 or 6, but that still leaves 7 with 3 parents: 3, 5 and 6, with no clear precedence of who should be considered first: 3, 5 or 6.
The long and short of this issue is that it would be handy, with a single command, to perform the complicated merge steps, like merge-parents, and be able to register more than one parent with a branch. Oh, I cannot BEGIN to tell you how much such an addition to Bazaar would make my life easier. I hate spending so much time managing branch updates. PLEASE, can we make this easier??
Thanks!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Bazaar Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask TimeHorse for more information if necessary.