Show More
@@ -48,7 +48,7 b' normal behavior.' | |||||
48 | ''' |
|
48 | ''' | |
49 |
|
49 | |||
50 | import atexit, sys, os, signal, subprocess, errno, shlex |
|
50 | import atexit, sys, os, signal, subprocess, errno, shlex | |
51 | from mercurial import commands, dispatch, util, extensions |
|
51 | from mercurial import commands, dispatch, util, extensions, cmdutil | |
52 | from mercurial.i18n import _ |
|
52 | from mercurial.i18n import _ | |
53 |
|
53 | |||
54 | testedwith = 'internal' |
|
54 | testedwith = 'internal' | |
@@ -121,14 +121,20 b' def uisetup(ui):' | |||||
121 | attend = ui.configlist('pager', 'attend', attended) |
|
121 | attend = ui.configlist('pager', 'attend', attended) | |
122 | auto = options['pager'] == 'auto' |
|
122 | auto = options['pager'] == 'auto' | |
123 | always = util.parsebool(options['pager']) |
|
123 | always = util.parsebool(options['pager']) | |
124 | if (always or auto and |
|
124 | ||
125 | (cmd in attend or |
|
125 | cmds, _ = cmdutil.findcmd(cmd, commands.table) | |
126 | (cmd not in ui.configlist('pager', 'ignore') and not attend))): |
|
126 | ||
127 | ui.setconfig('ui', 'formatted', ui.formatted()) |
|
127 | ignore = ui.configlist('pager', 'ignore') | |
128 | ui.setconfig('ui', 'interactive', False) |
|
128 | for cmd in cmds: | |
129 | if util.safehasattr(signal, "SIGPIPE"): |
|
129 | if (always or auto and | |
130 | signal.signal(signal.SIGPIPE, signal.SIG_DFL) |
|
130 | (cmd in attend or | |
131 | _runpager(ui, p) |
|
131 | (cmd not in ignore and not attend))): | |
|
132 | ui.setconfig('ui', 'formatted', ui.formatted()) | |||
|
133 | ui.setconfig('ui', 'interactive', False) | |||
|
134 | if util.safehasattr(signal, "SIGPIPE"): | |||
|
135 | signal.signal(signal.SIGPIPE, signal.SIG_DFL) | |||
|
136 | _runpager(ui, p) | |||
|
137 | break | |||
132 | return orig(ui, options, cmd, cmdfunc) |
|
138 | return orig(ui, options, cmd, cmdfunc) | |
133 |
|
139 | |||
134 | extensions.wrapfunction(dispatch, '_runcommand', pagecmd) |
|
140 | extensions.wrapfunction(dispatch, '_runcommand', pagecmd) |
General Comments 0
You need to be logged in to leave comments.
Login now