# HG changeset patch # User Anton Shestakov # Date 1642573042 -10800 # Node ID 2662c6704ebda346313943a2182c5d841d05c291 # Parent ba316ce1504052c85336c69b3adc9a9b7020d905 evolve: compatibility for simplemerge.render_merge3() diff -r ba316ce15040 -r 2662c6704ebd hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Fri Jan 07 15:20:17 2022 +0100 +++ b/hgext3rd/evolve/evolvecmd.py Wed Jan 19 09:17:22 2022 +0300 @@ -816,16 +816,18 @@ there were conflicts or not while merging the messages""" merger = simplemerge.Merge3Text(basedesc, divdesc, othdesc) - mdesc = [] - kwargs = {} - kwargs['name_base'] = b'base' - kwargs['base_marker'] = b'|||||||' - for line in merger.merge_lines(name_a=b'divergent', name_b=b'other', - **kwargs): - mdesc.append(line) + kwargs = {'name_a': b'divergent', 'name_b': b'other', 'name_base': b'base'} - desc = b''.join(mdesc) - if merger.conflicts: + if util.safehasattr(simplemerge, 'render_merge3'): + lines, conflicts = simplemerge.render_merge3(merger, **kwargs) + desc = b''.join(lines) + else: + # hg <= 6.0 (12ac4401ff7d) + kwargs['base_marker'] = b'|||||||' + desc = b''.join(merger.merge_lines(**kwargs)) + conflicts = merger.conflicts + + if conflicts: prefixes = (b"HG: Conflicts while merging changeset description of" b" content-divergent changesets.\nHG: Resolve conflicts"