color: rename '_styles' to '_defaultstyles' for clarity
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Sun, 06 Nov 2016 20:16:54 +0100
changeset 31116 6483e49204ee
parent 31115 f5131d4f512a
child 31119 13bbcd56c57a
color: rename '_styles' to '_defaultstyles' for clarity This should make it clear the dict is only used for new config. Extensions should not modify it directly anyway since we have 'extraloader' logic for loading '_styles' too.
mercurial/color.py
--- a/mercurial/color.py	Sun Nov 06 20:16:01 2016 +0100
+++ b/mercurial/color.py	Sun Nov 06 20:16:54 2016 +0100
@@ -72,7 +72,7 @@
     'white_background': 47,
     }
 
-_styles = {
+_defaultstyles = {
     'grep.match': 'red bold',
     'grep.linenumber': 'green',
     'grep.rev': 'green',
@@ -129,7 +129,7 @@
 }
 
 def loadcolortable(ui, extname, colortable):
-    _styles.update(colortable)
+    _defaultstyles.update(colortable)
 
 def _terminfosetup(ui, mode):
     '''Initialize terminfo data and the terminal if we're in terminfo mode.'''
@@ -254,7 +254,7 @@
     return None
 
 def configstyles(ui):
-    ui._styles.update(_styles)
+    ui._styles.update(_defaultstyles)
     for status, cfgeffects in ui.configitems('color'):
         if '.' not in status or status.startswith(('color.', 'terminfo.')):
             continue