##// END OF EJS Templates
scmutil: make termwidth() obtain stdio from ui...
Yuya Nishihara -
r30310:5c379b1f default
parent child Browse files
Show More
@@ -41,11 +41,11 b' def userrcpath():'
41 41 else:
42 42 return [os.path.expanduser('~/.hgrc')]
43 43
44 def termwidth():
44 def termwidth(ui):
45 45 try:
46 46 import array
47 47 import termios
48 for dev in (sys.stderr, sys.stdout, sys.stdin):
48 for dev in (ui.ferr, ui.fout, ui.fin):
49 49 try:
50 50 try:
51 51 fd = dev.fileno()
@@ -53,5 +53,5 b' def userrcpath():'
53 53 path.append(os.path.join(userprofile, '.hgrc'))
54 54 return path
55 55
56 def termwidth():
56 def termwidth(ui):
57 57 return win32.termwidth()
@@ -822,7 +822,7 b' class ui(object):'
822 822 return int(encoding.environ['COLUMNS'])
823 823 except ValueError:
824 824 pass
825 return scmutil.termwidth()
825 return scmutil.termwidth(self)
826 826
827 827 def formatted(self):
828 828 '''should formatted output be used?
General Comments 0
You need to be logged in to leave comments. Login now