comparison mercurial/progress.py @ 28171:2d20d1d2ea76

progress: display progress bar when HGPLAINEXCEPT contains "progress" This patch changes "progress.shouldprint()" so a feature name is provided to "ui.plain()" to determine if there is an exception specificed in HGPLAINEXCEPT for the progress extension. This will allow user-facing scripts to provide progress output while HGPLAIN is enabled.
author Matt Anderson <andersonmat@fb.com>
date Wed, 17 Feb 2016 15:18:30 -0800
parents 1aee2ab0f902
children 222b8170d69e
comparison
equal deleted inserted replaced
28170:bc010fcd836b 28171:2d20d1d2ea76
16 16
17 def spacejoin(*args): 17 def spacejoin(*args):
18 return ' '.join(s for s in args if s) 18 return ' '.join(s for s in args if s)
19 19
20 def shouldprint(ui): 20 def shouldprint(ui):
21 return not (ui.quiet or ui.plain()) and ( 21 return not (ui.quiet or ui.plain('progress')) and (
22 ui._isatty(sys.stderr) or ui.configbool('progress', 'assume-tty')) 22 ui._isatty(sys.stderr) or ui.configbool('progress', 'assume-tty'))
23 23
24 def fmtremaining(seconds): 24 def fmtremaining(seconds):
25 """format a number of remaining seconds in human readable way 25 """format a number of remaining seconds in human readable way
26 26