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.
--- 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):