2017-05-23 21:49:20 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
from __future__ import absolute_import, print_function
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2018-01-10 02:10:05 +03:00
|
|
|
from hgext import traceprof
|
|
|
|
from mercurial import ui as uimod
|
|
|
|
|
2017-05-23 21:49:20 +03:00
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.argv = sys.argv[1:]
|
|
|
|
if not sys.argv:
|
|
|
|
print("usage: traceprof.py <script> <arguments...>", file=sys.stderr)
|
|
|
|
sys.exit(2)
|
|
|
|
sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])))
|
2018-01-10 02:10:05 +03:00
|
|
|
u = uimod.ui()
|
2017-05-26 19:03:58 +03:00
|
|
|
u.setconfig('traceprof', 'timethreshold', 0)
|
|
|
|
with traceprof.profile(u, sys.stderr):
|
2017-05-23 21:49:20 +03:00
|
|
|
execfile(sys.argv[0])
|