# HG changeset patch # User Pierre-Yves David # Date 1478182547 -3600 # Node ID bb2dfc0ea5b4a446c01cb361b9fd0c332ab16c5f # Parent 7556507f719745650968b280182f0f64c3cec3e3 color: sort output of 'debugcolor' The previous ordering were provided by the set. The new output is more stable and rational. In addition we have some logic to keep the '_background' version together to help readability. diff -r 7556507f7197 -r bb2dfc0ea5b4 hgext/color.py --- a/hgext/color.py Thu Nov 03 14:48:47 2016 +0100 +++ b/hgext/color.py Thu Nov 03 15:15:47 2016 +0100 @@ -556,7 +556,10 @@ elif k.startswith('terminfo.'): _styles[k] = k[9:] ui.write(_('available colors:\n')) - for colorname, label in _styles.items(): + # sort label with a '_' after the other to group '_background' entry. + items = sorted(_styles.items(), + key=lambda i: ('_' in i[0], i[0], i[1])) + for colorname, label in items: ui.write(('%s\n') % colorname, label=label) finally: _styles = oldstyle