##// END OF EJS Templates
dispatch: ignore failure to flush ui...
Martin von Zweigbergk -
r49384:2f2107c0 default
parent child Browse files
Show More
@@ -252,9 +252,14 b' def dispatch(req):'
252 err = e
252 err = e
253 status = -1
253 status = -1
254
254
255 ret = _flushstdio(req.ui, err)
255 # Somehow we have to catcht he exception here; catching it inside
256 if ret and not status:
256 # _flushstdio() doesn't work.
257 status = ret
257 try:
258 ret = _flushstdio(req.ui, err)
259 if ret and not status:
260 status = ret
261 except BaseException:
262 pass
258 return status
263 return status
259
264
260
265
@@ -314,7 +319,10 b' def _rundispatch(req):'
314 ret = -1
319 ret = -1
315 finally:
320 finally:
316 duration = util.timer() - starttime
321 duration = util.timer() - starttime
317 req.ui.flush() # record blocked times
322 try:
323 req.ui.flush() # record blocked times
324 except BaseException:
325 pass
318 if req.ui.logblockedtimes:
326 if req.ui.logblockedtimes:
319 req.ui._blockedtimes[b'command_duration'] = duration * 1000
327 req.ui._blockedtimes[b'command_duration'] = duration * 1000
320 req.ui.log(
328 req.ui.log(
@@ -338,7 +346,10 b' def _rundispatch(req):'
338 except: # exiting, so no re-raises
346 except: # exiting, so no re-raises
339 ret = ret or -1
347 ret = ret or -1
340 # do flush again since ui.log() and exit handlers may write to ui
348 # do flush again since ui.log() and exit handlers may write to ui
341 req.ui.flush()
349 try:
350 req.ui.flush()
351 except BaseException:
352 pass
342 return ret
353 return ret
343
354
344
355
@@ -459,7 +470,10 b' def _runcatch(req):'
459 try:
470 try:
460 return _dispatch(req)
471 return _dispatch(req)
461 finally:
472 finally:
462 ui.flush()
473 try:
474 ui.flush() # record blocked times
475 except BaseException:
476 pass
463 except: # re-raises
477 except: # re-raises
464 # enter the debugger when we hit an exception
478 # enter the debugger when we hit an exception
465 if req.earlyoptions[b'debugger']:
479 if req.earlyoptions[b'debugger']:
@@ -219,8 +219,7 b' use shell=True in the subprocess call:'
219 #endif
219 #endif
220
220
221 A complicated pager command gets worse behavior. Bonus points if you can
221 A complicated pager command gets worse behavior. Bonus points if you can
222 improve this. Windows apparently does this better, but only sometimes?
222 improve this.
223 #if windows
224 $ hg log --limit 3 \
223 $ hg log --limit 3 \
225 > --config pager.pager='this-command-better-never-exist --seriously' \
224 > --config pager.pager='this-command-better-never-exist --seriously' \
226 > 2>/dev/null || true
225 > 2>/dev/null || true
@@ -240,11 +239,6 b' improve this. Windows apparently does th'
240 date: Thu Jan 01 00:00:00 1970 +0000 (?)
239 date: Thu Jan 01 00:00:00 1970 +0000 (?)
241 summary: modify a 8 (?)
240 summary: modify a 8 (?)
242 (?)
241 (?)
243 #else
244 $ hg log --limit 3 \
245 > --config pager.pager='this-command-better-never-exist --seriously' \
246 > 2>/dev/null || true
247 #endif
248
242
249 Pager works with shell aliases.
243 Pager works with shell aliases.
250
244
General Comments 0
You need to be logged in to leave comments. Login now