Mercurial > public > mercurial-scm > hg
diff mercurial/debugcommands.py @ 36954: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 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Tue Mar 13 20:34:38 2018 +0800 +++ b/mercurial/debugcommands.py Mon Feb 26 20:44:01 2018 +0800 @@ -2529,6 +2529,17 @@ line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '') ui.write("%s\n" % line.rstrip()) +@command('debugwhyunstable', [], _('REV')) +def debugwhyunstable(ui, repo, rev): + """explain instabilities of a changeset""" + for entry in obsutil.whyunstable(repo, repo[rev]): + dnodes = '' + if entry.get('divergentnodes'): + dnodes = ' '.join('%s (%s)' % (ctx.hex(), ctx.phasestr()) + for ctx in entry['divergentnodes']) + ' ' + ui.write('%s: %s%s %s\n' % (entry['instability'], dnodes, + entry['reason'], entry['node'])) + @command('debugwireargs', [('', 'three', '', 'three'), ('', 'four', '', 'four'),