# HG changeset patch # User Pierre-Yves David # Date 2016-11-03 14:15:47 # 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 --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -556,7 +556,10 @@ def _debugdisplaycolor(ui): 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