Commit Graph

30 Commits

Author SHA1 Message Date
Kevin Bullock
deaad9124d pager: make example of setting pager less silly 2010-10-29 00:57:34 -05:00
Martin Geisler
94a99c16c9 pager: backout 211c3a983bd3 (issue2441) 2010-10-29 14:47:45 +02:00
Brodie Rao
64fa99143f pager: don't run pager if nothing is written to stdout/stderr
This decides when to run the pager based on the first call to
ui.write() and ui.write_err(). This has the side effect of not the
output of subprocesses that write output before hg does.
2010-10-10 12:21:49 -05:00
Brodie Rao
6b1702dd44 pager: add global --pager=<auto/boolean> option 2010-10-10 12:21:48 -05:00
Brodie Rao
5a1e1994ac help: refer to user configuration file more consistently
Currently, a number of commands and help topics mention the user hgrc
file in different ways. Among these are following:

1. .hgrc - "please specify your commit editor/username in your .hgrc
file", bookmarks, color, hgk, pager, hg help environment

2. $HOME/.hgrc - hg help paths, hgrc(5), hg(1)

3. ~/.hgrc - hgrc(5)

In addition to being inconsistent, none of these make sense on
Windows. This patch replaces the above with a more general term of
"[your] configuration file".
2010-08-27 22:36:35 -04:00
Yuya Nishihara
968bdb2fd0 pager: respect HGPLAIN
Pager shouldn't be enabled for scripting use.
2010-06-20 01:20:12 +09:00
Dan Villiom Podlaski Christiansen
e64c6d6314 pager: set ui.formatted() prior to redirecting stdout. 2010-06-07 15:34:48 +02:00
Brodie Rao
97e764bcba pager: exec pager using /bin/sh -c
This mimics the behavior of popen() and ensures setting the pager to something
like "LESS=FSRX less" will work.
2010-05-19 09:54:12 -05:00
Matt Mackall
0eed4acf96 Merge with stable 2010-05-16 14:38:32 -05:00
Brodie Rao
6239bef137 pager: fork and exec pager as parent process
With the pager as the child process instead of the parent process, the
termination of the parent Mercurial process can cause the terminal to return
before the pager exits. Inverting the relationship prevents that issue.

Platforms without fork() will continue to use util.popen().
2010-05-03 14:00:34 -05:00
Martin Geisler
f1853c5e82 Use hg role in help strings 2010-04-22 10:24:49 +02:00
Brodie Rao
0f2039e2cc pager: set ui.interactive=False when enabled
This stops interactive-only things like progress bars from showing up
inside the pager.
2010-02-19 22:16:42 -05:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Martin Geisler
70de345b15 hgext: enable extensions without "hgext." prefix in help texts 2009-12-22 00:50:03 +01:00
Brodie Rao
4f62e5a654 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.)
2009-11-12 10:29:40 -05:00
Martin Geisler
5cca165d9b pager: wrap docstrings at 70 characters 2009-07-26 01:56:02 +02:00
Martin Geisler
cf2fd9726e pager: use reST syntax for literal blocks 2009-07-23 00:24:03 +02:00
Martin Geisler
42ae308e52 pager: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Martin Geisler
1978b6086c pager: word-wrap help texts at 70 characters 2009-04-04 23:18:13 +02:00
Matt Mackall
e564d351f3 extensions: use new wrapper functions 2008-10-22 17:34:52 -05:00
Dirkjan Ochtman
2f149e4634 replace usage of os.popen() with util.popen()
To make this possible, I added a mode parameter to both implementations of
util.popen(), defaulting to 'r' (as it does in the Python stdlib).
2008-04-14 14:34:38 +02:00
Christian Ebert
87c730b788 pager: make config info accessible with "hg help pager" 2008-04-03 13:47:05 +02:00
Dirkjan Ochtman
c31920c8cc Merge from crew-stable. 2008-04-03 11:16:07 +02:00
Gilles Moris
5b548b29f2 Pager extension: switch it off if --debugger is set
The pager is preventing the debugger prompt and much of the
debugger output to be refreshed. Moreover the pager does not
make sense when debugging line by line.

(This supersedes the similar ui.debugflag patch. Disabling
the pager for debug output doesn't make that much sense,
as this is actually when the pager might be useful.)
2008-04-03 11:11:31 +02:00
David Soria Parra ext:(%20php.net%3E)
daf7ac79da Pager extension: switch it off if --debugger is set
The pager is preventing the debugger prompt and much of the
debugger output to be refreshed. Moreover the pager does not
make sense when debugging line by line (Thanks to Gilles Moris).
2008-04-03 10:49:42 +02:00
David Soria Parra ext:(%20php.net%3E)
b9cec105a4 pager: Add a configuration to enable/disable the pager for certain commands
Add the configuration options pager.ignore and pager.attend.
You can disable the pager on certain commands by adding them to the
pager.ignore setting. To whitelist commands, you can add them to pager.attend.
To disable or enable global commands like 'hg version' or 'hg help'
you have to use your global .hgrc. (thanks, Matt Mackall)
2008-03-29 19:41:50 +01:00
Matt Mackall
a0ccc8000c pager: further simplify code, clean up comments 2008-03-20 11:12:35 -05:00
David Soria Parra
190db7278a Use the pager given by the environment to display long output
Unix systems usually have a PAGER environment variable set.
If it is set, mercurial will use the pager application to display
output.

Two configuration variables are available to influence the
behaviour of the pager:
  pager.application
    sets the application to be used
  pager.quiet
   silences Broken Pipe errors that might occur when the user
   quits the pager before mercurial finished to write the output
2008-03-20 00:57:14 +01:00