[PATCH] Use merge3 for text merging

Martin Pool mbp at sourcefrog.net
Tue Jul 26 19:11:31 BST 2005

On 26 Jul 2005, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> These patches implement
> 1. the merge_factory concept, so that different merge approaches can be used
> 2. the Merge3 merge, used by default

Good stuff.

> I needed a way to determine whether the merge produced conflicts.  I
> didn't want just scan for '<<<<<<<' because that might already be
> present in the original file-- i.e. not an indicator of a *new*
> conflict.  So I set the start marker to an unlikely string, and replaced
> it with '<<<<<<' when I encountered it.  It's unlikely to cause
> real-world problems, but I'd rather be able to directly determine
> whether any conflicts ocurred.

I think merge3 should change to avoid the need for the ugly hack.  It
can do either of two things:

- just simply tell the caller whether there were conflicts or not

- rather than inserting the conflict markers itself (which is a bit
  ugly) instead return a data structure describing conflicted and
  unconflicted regions

I as going to do the second but piked until it was needed.  Whch do
you want?


More information about the bazaar mailing list