comparison mercurial/debugcommands.py @ 48585:c6649c53073f

simplemerge: make merge_lines() a free function IMO, the rendering of a conflict as text with merge markers should be separate from the code for resolving conflicts. The latter is what `Merge3Text` is mostly about already. Differential Revision: https://phab.mercurial-scm.org/D11974
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 07 Jan 2022 22:16:22 -0800
parents ce8c82a5cd65
children 2dbee604a4f0
comparison
equal deleted inserted replaced
48584:ce8c82a5cd65 48585:c6649c53073f
270 pa = p1.ancestor(p2) 270 pa = p1.ancestor(p2)
271 base, local, other = [ 271 base, local, other = [
272 x[fn].data() for x in (pa, p1, p2) 272 x[fn].data() for x in (pa, p1, p2)
273 ] 273 ]
274 m3 = simplemerge.Merge3Text(base, local, other) 274 m3 = simplemerge.Merge3Text(base, local, other)
275 ml = [l.strip() for l in m3.merge_lines()[0]] 275 ml = [l.strip() for l in simplemerge.merge_lines(m3)[0]]
276 ml.append(b"") 276 ml.append(b"")
277 elif at > 0: 277 elif at > 0:
278 ml = p1[fn].data().split(b"\n") 278 ml = p1[fn].data().split(b"\n")
279 else: 279 else:
280 ml = initialmergedlines 280 ml = initialmergedlines