comparison mercurial/debugcommands.py @ 48584:ce8c82a5cd65

simplemerge: convert `merge_lines()` away from generator We always consume all the lines and put them in a list anyway. By making the function not a generator, we can later make it return an additional value (to indicate if there were conflicts). Differential Revision: https://phab.mercurial-scm.org/D11973
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 07 Jan 2022 18:42:31 -0800
parents 04688c51f81f
children c6649c53073f
comparison
equal deleted inserted replaced
48583:c91418480cb0 48584:ce8c82a5cd65
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()] 275 ml = [l.strip() for l in m3.merge_lines()[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