Comment 3 for bug 141456

Revision history for this message
Martin Wimmer (martin-wimmer) wrote : Re: merging of branches with nested trees fails when commiting

I would be willing to contribute to fixing this bug, but as this is the first time I looked under the hood of bazaar, I'd need some guidance.

The Problem seems to be fairly easy:
- A commit builder is created for the top working tree
- some time later, another commit builder is created for the subtree.
- both call start_write_group on the same repository
- the second time start_write_group is called: raise errors.BzrError('already in a write group')

My Personal solution would be:
- add a variable _write_group_nesting_level to repository and initialize it with 0
- every time start_write_group is called, increment it by 1
- every time commit_write_group is called on the repository decrement it by one
- when it reaches 0 in commit_write_group only then call _commit_write_group
- for abort_write_group just abort, and reset the counter to 0.

What do you think?

regards,
Martin