two fixes for the pager stuff
- open pipe in binary mode
- don't start a pager if stdout is not a tty (this prevents test-ssh
from hanging if you set ui.usepager=True in run-tests.py)
--- a/mercurial/ui.py Tue Mar 18 22:12:34 2008 +0100
+++ b/mercurial/ui.py Wed Mar 19 16:54:35 2008 -0300
@@ -385,7 +385,7 @@
self.buffers[-1].extend([str(a) for a in args])
else:
if self.getpager() and not self.pager:
- self.pager = os.popen(self.getpager(), "w")
+ self.pager = os.popen(self.getpager(), "wb")
sys.stderr = self.pager
sys.stdout = self.pager
for a in args:
@@ -495,6 +495,6 @@
def getpager(self):
'''return a pager'''
- if self.configbool("ui", "usepager", False):
+ if sys.stdout.isatty() and self.configbool("ui", "usepager", False):
return (self.config("ui", "pager")
or os.environ.get("PAGER"))