# HG changeset patch # User Matt Anderson # Date 1455751110 28800 # Node ID 2d20d1d2ea76db70424a75bb64a0d83cd21ce7a7 # Parent bc010fcd836bd892bf7c7bf39db7253ff114a11d 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. diff -r bc010fcd836b -r 2d20d1d2ea76 mercurial/help/environment.txt --- a/mercurial/help/environment.txt Wed Feb 17 19:38:44 2016 +0000 +++ b/mercurial/help/environment.txt Wed Feb 17 15:18:30 2016 -0800 @@ -69,6 +69,8 @@ Preserve internationalization. ``revsetalias`` Don't remove revset aliases. + ``progress`` + Don't hide progress output. Setting HGPLAINEXCEPT to anything (even an empty string) will enable plain mode. diff -r bc010fcd836b -r 2d20d1d2ea76 mercurial/progress.py --- a/mercurial/progress.py Wed Feb 17 19:38:44 2016 +0000 +++ b/mercurial/progress.py Wed Feb 17 15:18:30 2016 -0800 @@ -18,7 +18,7 @@ return ' '.join(s for s in args if s) def shouldprint(ui): - return not (ui.quiet or ui.plain()) and ( + return not (ui.quiet or ui.plain('progress')) and ( ui._isatty(sys.stderr) or ui.configbool('progress', 'assume-tty')) def fmtremaining(seconds): diff -r bc010fcd836b -r 2d20d1d2ea76 tests/test-progress.t --- a/tests/test-progress.t Wed Feb 17 19:38:44 2016 +0000 +++ b/tests/test-progress.t Wed Feb 17 15:18:30 2016 -0800 @@ -79,6 +79,12 @@ no progress with --quiet $ hg -y loop 3 --quiet +test plain mode exception + $ HGPLAINEXCEPT=progress hg -y loop 1 + \r (no-eol) (esc) + loop [ ] 0/1\r (no-eol) (esc) + \r (no-eol) (esc) + test nested short-lived topics (which shouldn't display with nestdelay): $ hg -y loop 3 --nested