color: show mode warning based on ui.formatted
ui.interactive is only for input and ui.formatted is for output.
--- a/hgext/color.py Thu Nov 10 15:14:05 2016 -0500
+++ b/hgext/color.py Fri Nov 11 13:06:05 2016 +1100
@@ -275,8 +275,8 @@
def modewarn():
# only warn if color.mode was explicitly set and we're in
- # an interactive terminal
- if mode == realmode and ui.interactive():
+ # a formatted terminal
+ if mode == realmode and ui.formatted():
ui.warn(_('warning: failed to set color mode to %s\n') % mode)
if realmode == 'win32':