Code review comment for lp:~jameinel/bzr-builddeb/changelog-parser

Revision history for this message
John A Meinel (jameinel) wrote :

I just updated this branch. I was going to submit a separate proposal, but I did find a bug here, and just fixed it while doing the rest.

Anyway, this now does 3-way merging of the blocks. The basic logic is:

1) Find all blocks in THIS, OTHER and BASE
2) For all blocks in THIS and OTHER, include them in the output in sorted order.
3) If THIS and OTHER both contain a block (matched by Version) with different content, compare against the BASE content
  a) If THIS == BASE, chose OTHER
  b) if OTHER == BASE, chose THIS
  c) If BASE is not present, or BASE is different from both, conflict

What this is missing:

1) If THIS or OTHER deletes a block it will be restored. (I assume that if a version is in THIS or OTHER then you always want it in the output)
2) 3c could use merge3.Merge3() to try to do a textual merge of the conflicted region.

I can open bugs on those two bits if you want.

« Back to merge proposal