# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1275917334 -7200 # Node ID c89309fa907df045bbb9b9ddf90add1e0b9168b9 # Parent 22a737306ba5b533a15aa5465cb1f17477147c0c color: use ui.formatted(). diff -r 22a737306ba5 -r c89309fa907d hgext/color.py --- a/hgext/color.py Mon Jun 07 16:14:12 2010 +0200 +++ b/hgext/color.py Mon Jun 07 15:28:54 2010 +0200 @@ -198,14 +198,10 @@ _effects.update(w32effects) elif mode != 'ansi': return - - # check isatty() before anything else changes it (like pager) - isatty = sys.__stdout__.isatty() - def colorcmd(orig, ui_, opts, cmd, cmdfunc): if (opts['color'] == 'always' or (opts['color'] == 'auto' and (os.environ.get('TERM') != 'dumb' - and isatty))): + and ui_.formatted()))): global _buffers _buffers = ui_._buffers extensions.wrapfunction(ui_, 'popbuffer', popbuffer)