Mercurial > hg-stable
changeset 9841:7cd6dee6fe37
pager: provide a default attend list
The default list includes commands which normally print large amounts of
text. This should be more user-friendly than paging all commands by default,
which can be confusing when the pager swallows input prompts (with, e.g.,
record, merge, HTTP/SSH authentication, etc.)
author | Brodie Rao <me+hg@dackz.net> |
---|---|
date | Thu, 12 Nov 2009 10:29:40 -0500 |
parents | 18d5935c0c62 |
children | d3dbdca92458 |
files | hgext/pager.py |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/pager.py Thu Nov 12 12:46:00 2009 +0100 +++ b/hgext/pager.py Thu Nov 12 10:29:40 2009 -0500 @@ -35,10 +35,13 @@ ignore = version, help, update You can also enable the pager only for certain commands using -pager.attend:: +pager.attend. Below is the default list of commands to be paged:: [pager] - attend = log + attend = annotate, cat, diff, export, glog, log, qdiff + +Setting pager.attend to an empty value will cause all commands to be +paged. If pager.attend is present, pager.ignore will be ignored. @@ -53,7 +56,7 @@ def pagecmd(orig, ui, options, cmd, cmdfunc): p = ui.config("pager", "pager", os.environ.get("PAGER")) if p and sys.stdout.isatty() and '--debugger' not in sys.argv: - attend = ui.configlist('pager', 'attend') + attend = ui.configlist('pager', 'attend', attended) if (cmd in attend or (cmd not in ui.configlist('pager', 'ignore') and not attend)): sys.stderr = sys.stdout = util.popen(p, "wb") @@ -62,3 +65,5 @@ return orig(ui, options, cmd, cmdfunc) extensions.wrapfunction(dispatch, '_runcommand', pagecmd) + +attended = ['annotate', 'cat', 'diff', 'export', 'glog', 'log', 'qdiff']