statprof: require input file

statprof has a __main__ handler that allows viewing of previously
written data files. As Yuya pointed out during review, 82ee01726a77
broke this. This patch fixes that.
This commit is contained in:
Gregory Szorc 2017-01-18 22:45:07 -08:00
parent a0c4b1e6da
commit 9c03a7696d
2 changed files with 10 additions and 0 deletions

View File

@ -800,6 +800,10 @@ def main(argv=None):
else:
assert False, "unhandled option %s" % o
if not path:
print('must specify --file to load')
return 1
load_data(path=path)
display(**displayargs)

View File

@ -92,4 +92,10 @@ Various statprof formatters work
$ cat ../out
\[\[\d+.* (re)
statprof can be used as a standalone module
$ $PYTHON -m mercurial.statprof hotpath
must specify --file to load
[1]
$ cd ..