##// END OF EJS Templates
logtoprocess: fix message formatting...
Boris Feld -
r40437:6bd477ee default
parent child Browse files
Show More
@@ -113,10 +113,8 b' def uisetup(ui):'
113 # try to format the log message given the remaining
113 # try to format the log message given the remaining
114 # arguments
114 # arguments
115 try:
115 try:
116 # Python string formatting with % either uses a
116 # Format the message as blackbox does
117 # dictionary *or* tuple, but not both. If we have
117 formatted = msg[0] % msg[1:]
118 # keyword options, assume we need a mapping.
119 formatted = msg[0] % (opts or msg[1:])
120 except (TypeError, KeyError):
118 except (TypeError, KeyError):
121 # Failed to apply the arguments, ignore
119 # Failed to apply the arguments, ignore
122 formatted = msg[0]
120 formatted = msg[0]
@@ -19,7 +19,7 b' Test if logtoprocess correctly captures '
19 > )
19 > )
20 > @command(b'foo', [])
20 > @command(b'foo', [])
21 > def foo(ui, repo):
21 > def foo(ui, repo):
22 > ui.log('foo', 'a message: %(bar)s\n', bar='spam')
22 > ui.log('foo', 'a message: %s\n', 'spam')
23 > EOF
23 > EOF
24 $ cp $HGRCPATH $HGRCPATH.bak
24 $ cp $HGRCPATH $HGRCPATH.bak
25 $ cat >> $HGRCPATH << EOF
25 $ cat >> $HGRCPATH << EOF
@@ -39,7 +39,7 b' Test if logtoprocess correctly captures '
39 > foo=(echo 'logtoprocess foo output:';
39 > foo=(echo 'logtoprocess foo output:';
40 > echo "\$EVENT";
40 > echo "\$EVENT";
41 > echo "\$MSG1";
41 > echo "\$MSG1";
42 > echo "\$OPT_BAR") > $TESTTMP/foo.log
42 > echo "\$MSG2") > $TESTTMP/foo.log
43 > EOF
43 > EOF
44
44
45 Running a command triggers both a ui.log('command') and a
45 Running a command triggers both a ui.log('command') and a
General Comments 0
You need to be logged in to leave comments. Login now