##// END OF EJS Templates
ui: introduce neverpager() call...
Augie Fackler -
r30994:3ed6e439 default
parent child Browse files
Show More
@@ -749,6 +749,9 b' def _dispatch(req):'
749 for ui_ in uis:
749 for ui_ in uis:
750 ui_.setconfig('ui', 'interactive', 'off', '-y')
750 ui_.setconfig('ui', 'interactive', 'off', '-y')
751
751
752 if options['pager'] != 'auto' and not util.parsebool(options['pager']):
753 ui.neverpager()
754
752 if cmdoptions.get('insecure', False):
755 if cmdoptions.get('insecure', False):
753 for ui_ in uis:
756 for ui_ in uis:
754 ui_.insecureconnections = True
757 ui_.insecureconnections = True
@@ -155,6 +155,7 b' class ui(object):'
155 self.ferr = src.ferr
155 self.ferr = src.ferr
156 self.fin = src.fin
156 self.fin = src.fin
157 self.pageractive = src.pageractive
157 self.pageractive = src.pageractive
158 self._neverpager = src._neverpager
158
159
159 self._tcfg = src._tcfg.copy()
160 self._tcfg = src._tcfg.copy()
160 self._ucfg = src._ucfg.copy()
161 self._ucfg = src._ucfg.copy()
@@ -173,6 +174,7 b' class ui(object):'
173 self.ferr = util.stderr
174 self.ferr = util.stderr
174 self.fin = util.stdin
175 self.fin = util.stdin
175 self.pageractive = False
176 self.pageractive = False
177 self._neverpager = False
176
178
177 # shared read-only environment
179 # shared read-only environment
178 self.environ = encoding.environ
180 self.environ = encoding.environ
@@ -831,6 +833,9 b' class ui(object):'
831 return False
833 return False
832 return util.isatty(fh)
834 return util.isatty(fh)
833
835
836 def neverpager(self):
837 self._neverpager = True
838
834 def pager(self, command):
839 def pager(self, command):
835 """Start a pager for subsequent command output.
840 """Start a pager for subsequent command output.
836
841
@@ -844,7 +849,8 b' class ui(object):'
844 command: The full, non-aliased name of the command. That is, "log"
849 command: The full, non-aliased name of the command. That is, "log"
845 not "history, "summary" not "summ", etc.
850 not "history, "summary" not "summ", etc.
846 """
851 """
847 if (self.pageractive
852 if (self._neverpager
853 or self.pageractive
848 # TODO: if we want to allow HGPLAINEXCEPT=pager,
854 # TODO: if we want to allow HGPLAINEXCEPT=pager,
849 # formatted() will need some adjustment.
855 # formatted() will need some adjustment.
850 or not self.formatted()
856 or not self.formatted()
General Comments 0
You need to be logged in to leave comments. Login now