Patchwork [10,of,10,v5] histedit: log the time taken to read in the commands list

login
register
mail settings
Submitter Simon Farnsworth
Date Feb. 15, 2017, 10:07 p.m.
Message ID <b9cf9ffdf15f67b42e87.1487196420@devvm022.lla2.facebook.com>
Download mbox | patch
Permalink /patch/18523/
State Accepted
Headers show

Comments

Simon Farnsworth - Feb. 15, 2017, 10:07 p.m.
# HG changeset patch
# User Simon Farnsworth <simonfar@fb.com>
# Date 1487194446 28800
#      Wed Feb 15 13:34:06 2017 -0800
# Node ID b9cf9ffdf15f67b42e87272e2fb328102e8284ba
# Parent  c17e5f194dca47819ca2d636a3c9cfdf02733ba7
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.
Bryan O'Sullivan - Feb. 16, 2017, 12:05 a.m.
On Wed, Feb 15, 2017 at 2:07 PM, Simon Farnsworth <simonfar@fb.com> wrote:

> histedit: log the time taken to read in the commands list
>

Series looks great. Ship it!
via Mercurial-devel - Feb. 16, 2017, 9:53 p.m.
On Wed, Feb 15, 2017 at 4:05 PM, Bryan O'Sullivan <bos@serpentine.com> wrote:
>
> On Wed, Feb 15, 2017 at 2:07 PM, Simon Farnsworth <simonfar@fb.com> wrote:
>>
>> histedit: log the time taken to read in the commands list
>
>
> Series looks great. Ship it!

Looks like this was queued (by Augie), thanks. I'm working my way
through it now.


>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -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()