Patchwork blackbox: fix exception when logging commands with format characters

login
register
mail settings
Submitter Durham Goode
Date March 1, 2013, 2:33 a.m.
Message ID <6980c9cc2eb4ee69a530.1362105222@dev350.prn1.facebook.com>
Download mbox | patch
Permalink /patch/1063/
State Superseded
Commit 6aca4d1c744ed8f6c1305525ded7590abaa72d06
Headers show

Comments

Durham Goode - March 1, 2013, 2:33 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1362075146 28800
#      Thu Feb 28 10:12:26 2013 -0800
# Node ID 6980c9cc2eb4ee69a530c6c55b44955fb16c53e7
# Parent  0e272121ea4e33027061f8fb9700074ae8f6c63d
blackbox: fix exception when logging commands with format characters

When running commands like 'hg export -o mypatch-%N.patch', the blackbox
would throw an exception because it tried to format %N. This change
prevents it from trying to format the command string.

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -737,7 +737,7 @@ 
         ui.warn(_("warning: --repository ignored\n"))
 
     msg = ' '.join(' ' in a and repr(a) or a for a in fullargs)
-    ui.log("command", msg + "\n")
+    ui.log("command", '%s\n', msg)
     d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
     starttime = time.time()
     ret = None