Patchwork D12427: dispatch: stop sometimes generating silly blackbox entries

login
register
mail settings
Submitter phabricator
Date April 1, 2022, 4:47 p.m.
Message ID <differential-rev-PHID-DREV-bfaqknuuuhxtmw3be3n2-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50773/
State New
Headers show

Comments

phabricator - April 1, 2022, 4:47 p.m.
valentin.gatienbaron created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12427

AFFECTED FILES
  mercurial/dispatch.py

CHANGE DETAILS




To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -269,7 +269,7 @@ 
             ferr.write(inst.format())
             return -1
 
-        msg = _formatargs(req.args)
+        formattedargs = _formatargs(req.args)
         starttime = util.timer()
         ret = 1  # default of Python exit code on unhandled exception
         try:
@@ -308,7 +308,7 @@ 
             req.ui.log(
                 b"commandfinish",
                 b"%s exited %d after %0.2f seconds\n",
-                msg,
+                formattedargs,
                 return_code,
                 duration,
                 return_code=return_code,