equal
deleted
inserted
replaced
331 # The bookmarks extension is not enabled |
331 # The bookmarks extension is not enabled |
332 pass |
332 pass |
333 |
333 |
334 def _setupcmd(ui, cmd, table, func, effectsmap): |
334 def _setupcmd(ui, cmd, table, func, effectsmap): |
335 '''patch in command to command table and load effect map''' |
335 '''patch in command to command table and load effect map''' |
|
336 # check isatty() before anything else changes it (like pager) |
|
337 isatty = sys.__stdout__.isatty() |
|
338 |
336 def nocolor(orig, *args, **opts): |
339 def nocolor(orig, *args, **opts): |
337 |
340 |
338 if (opts['no_color'] or opts['color'] == 'never' or |
341 if (opts['no_color'] or opts['color'] == 'never' or |
339 (opts['color'] == 'auto' and (os.environ.get('TERM') == 'dumb' |
342 (opts['color'] == 'auto' and (os.environ.get('TERM') == 'dumb' |
340 or not sys.__stdout__.isatty()))): |
343 or not isatty))): |
341 del opts['no_color'] |
344 del opts['no_color'] |
342 del opts['color'] |
345 del opts['color'] |
343 return orig(*args, **opts) |
346 return orig(*args, **opts) |
344 |
347 |
345 oldshowpatch = extensions.wrapfunction(cmdutil.changeset_printer, |
348 oldshowpatch = extensions.wrapfunction(cmdutil.changeset_printer, |