# HG changeset patch # User Gregory Szorc # Date 1484808307 28800 # Node ID 262c2be8ea5a4f36fb7348cb5a940cf78f2dffa9 # Parent b3d2e8cce78c04dbf6f20f0846b6ea8b622983c4 statprof: require input file statprof has a __main__ handler that allows viewing of previously written data files. As Yuya pointed out during review, f42cd5434cc2 broke this. This patch fixes that. diff -r b3d2e8cce78c -r 262c2be8ea5a mercurial/statprof.py --- a/mercurial/statprof.py Wed Jan 18 23:43:41 2017 -0500 +++ b/mercurial/statprof.py Wed Jan 18 22:45:07 2017 -0800 @@ -800,6 +800,10 @@ else: assert False, "unhandled option %s" % o + if not path: + print('must specify --file to load') + return 1 + load_data(path=path) display(**displayargs) diff -r b3d2e8cce78c -r 262c2be8ea5a tests/test-profile.t --- a/tests/test-profile.t Wed Jan 18 23:43:41 2017 -0500 +++ b/tests/test-profile.t Wed Jan 18 22:45:07 2017 -0800 @@ -92,4 +92,10 @@ $ cat ../out \[\[\d+.* (re) +statprof can be used as a standalone module + + $ $PYTHON -m mercurial.statprof hotpath + must specify --file to load + [1] + $ cd ..