tags:

views:

100

answers:

1

Hi,

I am currently working on a project that has two phases, one of which is to be dropped later on. Development for phase 2 must begin, but bug-fixes for phase 1 will be on-going during this time. I want to branch from the phase 1 repo to start on phase 2 work, but many of the files will no longer be needed. I need to integrate any changes made into the phase 2 branch, but i dont want the hassle of repeatedly removing files that are no longer relevant to me, in otherwords i only want to merge changes where we have files in common.

Let me illustrate with an example, lets say i have my phase 1 work in this repo:

Phase1 - a.txt - b.txt

I then branch to phase 2, and remove a.txt as i will not need it further:

Phase2 - b.txt

Now lets say as part of phase1 bug fixes, both a.txt and b.txt are updated. I only care about b.txt, but if i do a merge i get: +N a.txt.OTHER M b.txt

Is there a way to do this with bazaar?

+2  A: 

Yes, it possible to achieve with Bazaar if you will start to use Daggy Fixes pattern (mirror).

So you need to remember which files you have in phase 2 branch and make the fixes for them in separate branch common for phase 1 and phase 2, and merge these fixes into both phases.

Using your example:

1) you need to fix problem in file a.txt -- you can work directly in original branch of phase 1 (b1), and you should not merge from this branch to branch phase 2 (b2) anymore.

2) you need to fix problem with file b.txt only -- you made special bug fix branch as closer as possible to revision where bug to b.txt was introduced, you have to create bugfix branch from revision prior to revision where branch phase 2 has started. Once you made your fix you need to merge bugfix branch into both b1 and b2 branches.

3) you need to fix problem related to both a.txt and b.txt. In this case it's possible that such bugfix won't be needed to merge it into b2. In this case you can work using variant 1 above. If some changes are still important for b2 you need to use variant 2 above for starting fix for b.txt, then merge the fix into both b1 and b2 branches and continue to work on the fix for a.txt.

bialix