comparison mercurial/debugcommands.py @ 36960:efc4fb344c05

debug: add debugwhyunstable that explains instabilities This is a port of evolve's feature of listing all unstable changesets in detail (`hg evolve --list`).
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 26 Feb 2018 20:44:01 +0800
parents b24cde12061b
children 317382151ac3
comparison
equal deleted inserted replaced
36959:b9bbcf9ffac1 36960:efc4fb344c05
2527 max([len(m.rel(abs)) for abs in items])) 2527 max([len(m.rel(abs)) for abs in items]))
2528 for abs in items: 2528 for abs in items:
2529 line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '') 2529 line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '')
2530 ui.write("%s\n" % line.rstrip()) 2530 ui.write("%s\n" % line.rstrip())
2531 2531
2532 @command('debugwhyunstable', [], _('REV'))
2533 def debugwhyunstable(ui, repo, rev):
2534 """explain instabilities of a changeset"""
2535 for entry in obsutil.whyunstable(repo, repo[rev]):
2536 dnodes = ''
2537 if entry.get('divergentnodes'):
2538 dnodes = ' '.join('%s (%s)' % (ctx.hex(), ctx.phasestr())
2539 for ctx in entry['divergentnodes']) + ' '
2540 ui.write('%s: %s%s %s\n' % (entry['instability'], dnodes,
2541 entry['reason'], entry['node']))
2542
2532 @command('debugwireargs', 2543 @command('debugwireargs',
2533 [('', 'three', '', 'three'), 2544 [('', 'three', '', 'three'),
2534 ('', 'four', '', 'four'), 2545 ('', 'four', '', 'four'),
2535 ('', 'five', '', 'five'), 2546 ('', 'five', '', 'five'),
2536 ] + cmdutil.remoteopts, 2547 ] + cmdutil.remoteopts,