comparison hgext/histedit.py @ 43370:7f56b0cbd245 stable

py3: render message about conflicts in chistedit code Now you can also reorder commits that (potentially) conflict. Just don't try to confirm the changes yet (because then it crashes). Differential Revision: https://phab.mercurial-scm.org/D7183
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 31 Oct 2019 15:02:03 -0700
parents 8aa54c5a2577
children 85ab79bc7dab
comparison
equal deleted inserted replaced
43369:8aa54c5a2577 43370:7f56b0cbd245
1430 win.addstr(y, fnx, _trunc_head(line1, fnmaxx)) 1430 win.addstr(y, fnx, _trunc_head(line1, fnmaxx))
1431 y = y + 1 1431 y = y + 1
1432 1432
1433 conflicts = rule.conflicts 1433 conflicts = rule.conflicts
1434 if len(conflicts) > 0: 1434 if len(conflicts) > 0:
1435 conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts)) 1435 conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
1436 conflictstr = b"changed files overlap with %s" % conflictstr 1436 conflictstr = b"changed files overlap with %s" % conflictstr
1437 else: 1437 else:
1438 conflictstr = b'no overlap' 1438 conflictstr = b'no overlap'
1439 1439
1440 win.addstr(y, 1, conflictstr[:length]) 1440 win.addstr(y, 1, conflictstr[:length])
1469 selected = state[b'selected'] 1469 selected = state[b'selected']
1470 start = state[b'modes'][MODE_RULES][b'line_offset'] 1470 start = state[b'modes'][MODE_RULES][b'line_offset']
1471 1471
1472 conflicts = [r.ctx for r in rules if r.conflicts] 1472 conflicts = [r.ctx for r in rules if r.conflicts]
1473 if len(conflicts) > 0: 1473 if len(conflicts) > 0:
1474 line = b"potential conflict in %s" % b','.join(map(str, conflicts)) 1474 line = b"potential conflict in %s" % b','.join(
1475 map(pycompat.bytestr, conflicts)
1476 )
1475 addln(rulesscr, -1, 0, line, curses.color_pair(COLOR_WARN)) 1477 addln(rulesscr, -1, 0, line, curses.color_pair(COLOR_WARN))
1476 1478
1477 for y, rule in enumerate(rules[start:]): 1479 for y, rule in enumerate(rules[start:]):
1478 if y >= state[b'page_height']: 1480 if y >= state[b'page_height']:
1479 break 1481 break