##// END OF EJS Templates
make ui flush output. this makes error happen if printing to /dev/full....
Vadim Gelfer -
r1837:6f67a4c9 default
parent child Browse files
Show More
@@ -2860,6 +2860,7 b' def dispatch(args):'
2860 else:
2860 else:
2861 d = lambda: func(u, *args, **cmdoptions)
2861 d = lambda: func(u, *args, **cmdoptions)
2862
2862
2863 try:
2863 if options['profile']:
2864 if options['profile']:
2864 import hotshot, hotshot.stats
2865 import hotshot, hotshot.stats
2865 prof = hotshot.Profile("hg.prof")
2866 prof = hotshot.Profile("hg.prof")
@@ -2868,8 +2869,8 b' def dispatch(args):'
2868 return prof.runcall(d)
2869 return prof.runcall(d)
2869 except:
2870 except:
2870 try:
2871 try:
2871 u.warn(_('exception raised - generating profile '
2872 u.warn(_('exception raised - generating '
2872 'anyway\n'))
2873 'profile anyway\n'))
2873 except:
2874 except:
2874 pass
2875 pass
2875 raise
2876 raise
@@ -2881,6 +2882,8 b' def dispatch(args):'
2881 stats.print_stats(40)
2882 stats.print_stats(40)
2882 else:
2883 else:
2883 return d()
2884 return d()
2885 finally:
2886 u.flush()
2884 except:
2887 except:
2885 # enter the debugger when we hit an exception
2888 # enter the debugger when we hit an exception
2886 if options['debugger']:
2889 if options['debugger']:
@@ -132,6 +132,12 b' class ui(object):'
132 for a in args:
132 for a in args:
133 sys.stderr.write(str(a))
133 sys.stderr.write(str(a))
134
134
135 def flush(self):
136 try:
137 sys.stdout.flush()
138 finally:
139 sys.stderr.flush()
140
135 def readline(self):
141 def readline(self):
136 return sys.stdin.readline()[:-1]
142 return sys.stdin.readline()[:-1]
137 def prompt(self, msg, pat, default="y"):
143 def prompt(self, msg, pat, default="y"):
General Comments 0
You need to be logged in to leave comments. Login now