color: be silent when falling back to ECMA-48 mode if "auto" mode was desired stable
authorDanek Duvall <duvall@comfychair.org>
Mon, 27 Jun 2011 11:36:42 -0700
branchstable
changeset 14758 1e6661e09818
parent 14757 f0b047a24c57
child 14759 c64bd320e4f0
child 14760 cebbc6b38c05
child 14800 756aab778446
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.
hgext/color.py
--- 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):