histedit: log the time taken to read in the commands list
authorSimon Farnsworth <simonfar@fb.com>
Wed, 15 Feb 2017 13:34:06 -0800
changeset 30983 d4825798818b
parent 30982 08e6f4dac2ca
child 30984 15f9084a9a0c
histedit: log the time taken to read in the commands list If we're being fed an external command list from stdin (histedit --commands -), then the time spent reading stdin is outside our control. Log it.
hgext/histedit.py
--- a/hgext/histedit.py	Wed Feb 15 13:34:06 2017 -0800
+++ b/hgext/histedit.py	Wed Feb 15 13:34:06 2017 -0800
@@ -992,7 +992,8 @@
 
 def _readfile(ui, path):
     if path == '-':
-        return ui.fin.read()
+        with ui.timeblockedsection('histedit'):
+            return ui.fin.read()
     else:
         with open(path, 'rb') as f:
             return f.read()