sapling/contrib/traceprof.py
Jun Wu f1518f6d73 check-module-imports: fix fastannotate, absorb and traceprof
Summary:
Reorder the imports to make the module checker happy.
The module checker should be aware of Cython module paths. Do it manually.

Test Plan: Run `test-check-module-imports.t`

Reviewers: durham, #mercurial

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6688384

Signature: 6688384:1515540420:bec02696b24c12cb4fa2595fd235fc8f3246b2a2
2018-01-09 15:10:05 -08:00

21 lines
549 B
Python
Executable File

#!/usr/bin/env python
from __future__ import absolute_import, print_function
import os
import sys
from hgext import traceprof
from mercurial import ui as uimod
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])))
u = uimod.ui()
u.setconfig('traceprof', 'timethreshold', 0)
with traceprof.profile(u, sys.stderr):
execfile(sys.argv[0])