comparison mercurial/ui.py @ 31026:9c827087df38

ui: rename neverpager to disablepager I agree this is a clearer name for this method.
author Augie Fackler <augie@google.com>
date Sun, 19 Feb 2017 20:12:52 -0500
parents 219629d42786
children 88203f26ea57
comparison
equal deleted inserted replaced
31025:6cf2857526c7 31026:9c827087df38
158 if src: 158 if src:
159 self.fout = src.fout 159 self.fout = src.fout
160 self.ferr = src.ferr 160 self.ferr = src.ferr
161 self.fin = src.fin 161 self.fin = src.fin
162 self.pageractive = src.pageractive 162 self.pageractive = src.pageractive
163 self._neverpager = src._neverpager 163 self._disablepager = src._disablepager
164 164
165 self._tcfg = src._tcfg.copy() 165 self._tcfg = src._tcfg.copy()
166 self._ucfg = src._ucfg.copy() 166 self._ucfg = src._ucfg.copy()
167 self._ocfg = src._ocfg.copy() 167 self._ocfg = src._ocfg.copy()
168 self._trustusers = src._trustusers.copy() 168 self._trustusers = src._trustusers.copy()
177 else: 177 else:
178 self.fout = util.stdout 178 self.fout = util.stdout
179 self.ferr = util.stderr 179 self.ferr = util.stderr
180 self.fin = util.stdin 180 self.fin = util.stdin
181 self.pageractive = False 181 self.pageractive = False
182 self._neverpager = False 182 self._disablepager = False
183 183
184 # shared read-only environment 184 # shared read-only environment
185 self.environ = encoding.environ 185 self.environ = encoding.environ
186 186
187 self.httppasswordmgrdb = httppasswordmgrdbproxy() 187 self.httppasswordmgrdb = httppasswordmgrdbproxy()
836 def _isatty(self, fh): 836 def _isatty(self, fh):
837 if self.configbool('ui', 'nontty', False): 837 if self.configbool('ui', 'nontty', False):
838 return False 838 return False
839 return util.isatty(fh) 839 return util.isatty(fh)
840 840
841 def neverpager(self): 841 def disablepager(self):
842 self._neverpager = True 842 self._disablepager = True
843 843
844 def pager(self, command): 844 def pager(self, command):
845 """Start a pager for subsequent command output. 845 """Start a pager for subsequent command output.
846 846
847 Commands which produce a long stream of output should call 847 Commands which produce a long stream of output should call
852 852
853 Args: 853 Args:
854 command: The full, non-aliased name of the command. That is, "log" 854 command: The full, non-aliased name of the command. That is, "log"
855 not "history, "summary" not "summ", etc. 855 not "history, "summary" not "summ", etc.
856 """ 856 """
857 if (self._neverpager 857 if (self._disablepager
858 or self.pageractive 858 or self.pageractive
859 or command in self.configlist('pager', 'ignore') 859 or command in self.configlist('pager', 'ignore')
860 or not self.configbool('pager', 'attend-' + command, True) 860 or not self.configbool('pager', 'attend-' + command, True)
861 # TODO: if we want to allow HGPLAINEXCEPT=pager, 861 # TODO: if we want to allow HGPLAINEXCEPT=pager,
862 # formatted() will need some adjustment. 862 # formatted() will need some adjustment.