Show More
@@ -1023,7 +1023,10 b' def _runcommand(ui, options, cmd, cmdfun' | |||||
1023 |
|
1023 | |||
1024 | output = ui.config('profiling', 'output') |
|
1024 | output = ui.config('profiling', 'output') | |
1025 |
|
1025 | |||
1026 | if output: |
|
1026 | if output == 'blackbox': | |
|
1027 | import StringIO | |||
|
1028 | fp = StringIO.StringIO() | |||
|
1029 | elif output: | |||
1027 | path = ui.expandpath(output) |
|
1030 | path = ui.expandpath(output) | |
1028 | fp = open(path, 'wb') |
|
1031 | fp = open(path, 'wb') | |
1029 | else: |
|
1032 | else: | |
@@ -1038,6 +1041,12 b' def _runcommand(ui, options, cmd, cmdfun' | |||||
1038 | return statprofile(ui, checkargs, fp) |
|
1041 | return statprofile(ui, checkargs, fp) | |
1039 | finally: |
|
1042 | finally: | |
1040 | if output: |
|
1043 | if output: | |
|
1044 | if output == 'blackbox': | |||
|
1045 | val = "Profile:\n%s" % fp.getvalue() | |||
|
1046 | # ui.log treats the input as a format string, | |||
|
1047 | # so we need to escape any % signs. | |||
|
1048 | val = val.replace('%', '%%') | |||
|
1049 | ui.log('profile', val) | |||
1041 | fp.close() |
|
1050 | fp.close() | |
1042 | else: |
|
1051 | else: | |
1043 | return checkargs() |
|
1052 | return checkargs() |
@@ -14,6 +14,9 b' test --profile' | |||||
14 | $ hg --profile --config profiling.output=../out st |
|
14 | $ hg --profile --config profiling.output=../out st | |
15 | $ grep CallCount ../out > /dev/null || cat ../out |
|
15 | $ grep CallCount ../out > /dev/null || cat ../out | |
16 |
|
16 | |||
|
17 | $ hg --profile --config profiling.output=blackbox --config extensions.blackbox= st | |||
|
18 | $ grep CallCount .hg/blackbox.log > /dev/null || cat .hg/blackbox.log | |||
|
19 | ||||
17 | $ hg --profile --config profiling.format=text st 2>../out |
|
20 | $ hg --profile --config profiling.format=text st 2>../out | |
18 | $ grep CallCount ../out > /dev/null || cat ../out |
|
21 | $ grep CallCount ../out > /dev/null || cat ../out | |
19 |
|
22 |
General Comments 0
You need to be logged in to leave comments.
Login now