Mercurial > hg
comparison mercurial/dispatch.py @ 48998:91a60031aba2 stable
dispatch: fix silly blackbox entries when hg is interrupted
When hg is interrupted, it creates ui.log like this:
1970/01/01 00:00:00 user @0000000000000000000000000000000000000000 (62488)> killed!
exited 255 after 1.78 seconds
This is due to a scoping problem: two different uses of the name "msg"
collide. So rename one of them.
Differential Revision: https://phab.mercurial-scm.org/D12427
author | Valentin Gatien-Baron <vgatien-baron@janestreet.com> |
---|---|
date | Fri, 01 Apr 2022 12:46:58 -0400 |
parents | 56d037d07395 |
children | 12adf8c695ed |
comparison
equal
deleted
inserted
replaced
48991:d4752aeb20f1 | 48998:91a60031aba2 |
---|---|
285 req.ui.fmsg = req.fmsg | 285 req.ui.fmsg = req.fmsg |
286 except error.Abort as inst: | 286 except error.Abort as inst: |
287 ferr.write(inst.format()) | 287 ferr.write(inst.format()) |
288 return -1 | 288 return -1 |
289 | 289 |
290 msg = _formatargs(req.args) | 290 formattedargs = _formatargs(req.args) |
291 starttime = util.timer() | 291 starttime = util.timer() |
292 ret = 1 # default of Python exit code on unhandled exception | 292 ret = 1 # default of Python exit code on unhandled exception |
293 try: | 293 try: |
294 ret = _runcatch(req) or 0 | 294 ret = _runcatch(req) or 0 |
295 except error.ProgrammingError as inst: | 295 except error.ProgrammingError as inst: |
324 ) | 324 ) |
325 return_code = ret & 255 | 325 return_code = ret & 255 |
326 req.ui.log( | 326 req.ui.log( |
327 b"commandfinish", | 327 b"commandfinish", |
328 b"%s exited %d after %0.2f seconds\n", | 328 b"%s exited %d after %0.2f seconds\n", |
329 msg, | 329 formattedargs, |
330 return_code, | 330 return_code, |
331 duration, | 331 duration, |
332 return_code=return_code, | 332 return_code=return_code, |
333 duration=duration, | 333 duration=duration, |
334 canonical_command=req.canonical_command, | 334 canonical_command=req.canonical_command, |