comparison mercurial/ui.py @ 34039:31a2eb0f74e5

pager: do not start pager if `ui` has been `pushbuffer`-ed The `pushbuffer`, `popbuffer` APIs are intended to capture internal output. They will prevent `ui.write` from writing to the actual `ui.fout`. So a pager won't receive the output and do the right thing. In general, it does not make sense to start a pager if ui is in the "pushbuffer" mode. Differential Revision: https://phab.mercurial-scm.org/D574
author Jun Wu <quark@fb.com>
date Wed, 30 Aug 2017 14:04:55 -0700
parents af20468eb0a4
children 6e6452bc441d
comparison
equal deleted inserted replaced
34038:37b82485097f 34039:31a2eb0f74e5
960 or not self.configbool('pager', 'attend-' + command, True) 960 or not self.configbool('pager', 'attend-' + command, True)
961 # TODO: if we want to allow HGPLAINEXCEPT=pager, 961 # TODO: if we want to allow HGPLAINEXCEPT=pager,
962 # formatted() will need some adjustment. 962 # formatted() will need some adjustment.
963 or not self.formatted() 963 or not self.formatted()
964 or self.plain() 964 or self.plain()
965 or self._buffers
965 # TODO: expose debugger-enabled on the UI object 966 # TODO: expose debugger-enabled on the UI object
966 or '--debugger' in pycompat.sysargv): 967 or '--debugger' in pycompat.sysargv):
967 # We only want to paginate if the ui appears to be 968 # We only want to paginate if the ui appears to be
968 # interactive, the user didn't say HGPLAIN or 969 # interactive, the user didn't say HGPLAIN or
969 # HGPLAINEXCEPT=pager, and the user didn't specify --debug. 970 # HGPLAINEXCEPT=pager, and the user didn't specify --debug.