changeset 14758:1e6661e09818 stable

color: be silent when falling back to ECMA-48 mode if "auto" mode was desired Don't warn about missing setab/setaf terminfo entries unless we explicitly asked for terminfo mode; fallback to ECMA-48 mode silently.
author Danek Duvall <duvall@comfychair.org>
date Mon, 27 Jun 2011 11:36:42 -0700
parents f0b047a24c57
children c64bd320e4f0 cebbc6b38c05 756aab778446
files hgext/color.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/color.py	Mon Jun 27 11:36:40 2011 -0700
+++ b/hgext/color.py	Mon Jun 27 11:36:42 2011 -0700
@@ -144,8 +144,11 @@
             ui.debug("no terminfo entry for %s\n" % e)
             del _terminfo_params[key]
     if not curses.tigetstr('setaf') or not curses.tigetstr('setab'):
-        ui.warn(_("no terminfo entry for setab/setaf: reverting to "
-          "ECMA-48 color\n"))
+        # Only warn about missing terminfo entries if we explicitly asked for
+        # terminfo mode.
+        if mode == "terminfo":
+            ui.warn(_("no terminfo entry for setab/setaf: reverting to "
+              "ECMA-48 color\n"))
         _terminfo_params = {}
 
 def _modesetup(ui, opts):