Comments
Patch
@@ -41,11 +41,11 @@ def userrcpath():
else:
return [os.path.expanduser('~/.hgrc')]
-def termwidth():
+def termwidth(ui):
try:
import array
import termios
- for dev in (sys.stderr, sys.stdout, sys.stdin):
+ for dev in (ui.ferr, ui.fout, ui.fin):
try:
try:
fd = dev.fileno()
@@ -53,5 +53,5 @@ def userrcpath():
path.append(os.path.join(userprofile, '.hgrc'))
return path
-def termwidth():
+def termwidth(ui):
return win32.termwidth()
@@ -822,7 +822,7 @@ class ui(object):
return int(encoding.environ['COLUMNS'])
except ValueError:
pass
- return scmutil.termwidth()
+ return scmutil.termwidth(self)
def formatted(self):
'''should formatted output be used?