comparison mercurial/dispatch.py @ 8023:fd9debb3ea1b

profiling: Adding a profiling.format config variable Allows defining other output formats for profiling. If an invalid format is given, output a warning and ignore it. For now, only the standard 'text' value is supported.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Thu, 02 Apr 2009 16:01:30 +0900
parents 4f3fdfaa3874
children 9a1b86cfd29e
comparison
equal deleted inserted replaced
8022:4f3fdfaa3874 8023:fd9debb3ea1b
377 return cmdfunc() 377 return cmdfunc()
378 except error.SignatureError: 378 except error.SignatureError:
379 raise error.ParseError(cmd, _("invalid arguments")) 379 raise error.ParseError(cmd, _("invalid arguments"))
380 380
381 if options['profile']: 381 if options['profile']:
382 format = ui.config('profiling', 'format', default='text')
383
384 if not format in ['text']:
385 ui.warn(_("unrecognized profiling format '%s'"
386 " - Ignored\n") % format)
387 format = 'text'
388
382 output = ui.config('profiling', 'output') 389 output = ui.config('profiling', 'output')
383 390
384 if output: 391 if output:
385 path = os.path.expanduser(output) 392 path = os.path.expanduser(output)
386 path = ui.expandpath(path) 393 path = ui.expandpath(path)