[PATCH 1 of 4] profiling: Adding a profiling.format config variable

Martin Geisler mg at daimi.au.dk
Thu Apr 2 12:38:48 CDT 2009


Nicolas Dumazet <nicdumz at gmail.com> writes:

> # HG changeset patch
> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
> # Date 1238655690 -32400
> # Node ID 506f038fa0e7c714dbe6b51e478b1bb8467a4177
> # Parent  026bcd12a0adba249c2e1e1b43ccd4a8207c2e57
> profiling: Adding a profiling.format config variable
>
> Checked when using --profile or --lsprof
> Possible values : 'hotshot', 'lsprof'
>
> If an invalid format is given, output a warning and ignore it.
>
> diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
> --- a/mercurial/dispatch.py
> +++ b/mercurial/dispatch.py
> @@ -378,40 +378,56 @@
>          except error.SignatureError:
>              raise error.ParseError(cmd, _("invalid arguments"))
>  
> -    if options['profile']:
> -        import hotshot, hotshot.stats
> -        prof = hotshot.Profile("hg.prof")
> -        try:
> +    if options['profile'] or options['lsprof']:
> +        format = ui.config('profiling', 'format')
> +
> +        if format and not format in ['hotshot', 'lsprof']:
> +            ui.warning(_("Unknown profiling format '%s'"
> +                        " - Ignored\n") % format)

Output from Mercurial should start with lowercase like this:

  unknown profiling format '%s' - ignored

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20090402/5a4eccdb/attachment.pgp 


More information about the Mercurial-devel mailing list