Submitter | Simon Farnsworth |
---|---|
Date | Feb. 13, 2017, 5:29 p.m. |
Message ID | <b7557fd38e32b4d82b99.1487006948@devvm022.lla2.facebook.com> |
Download | mbox | patch |
Permalink | /patch/18452/ |
State | Changes Requested |
Headers | show |
Comments
On Mon, Feb 13, 2017 at 9:29 AM, Simon Farnsworth <simonfar@fb.com> wrote: > histedit: log the time taken to read in the commands list > > If we're being fed an external command list (histedit --commands), then the > time spent reading that file is out of our control. Log it. > I don't think it's worth measuring this, and this patch can reasonably be dropped.
On 13/02/2017 18:03, Bryan O'Sullivan wrote: > > On Mon, Feb 13, 2017 at 9:29 AM, Simon Farnsworth <simonfar@fb.com > <mailto:simonfar@fb.com>> wrote: > > histedit: log the time taken to read in the commands list > > If we're being fed an external command list (histedit --commands), > then the > time spent reading that file is out of our control. Log it. > > > I don't think it's worth measuring this, and this patch can reasonably > be dropped. I disagree, because the external list can also be fed from stdin. I'll beef up this commit message to make it clearer.
Patch
diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -991,11 +991,12 @@ return goalnew def _readfile(ui, path): - if path == '-': - return ui.fin.read() - else: - with open(path, 'rb') as f: - return f.read() + with ui.timeblockedsection('histedit'): + if path == '-': + return ui.fin.read() + else: + with open(path, 'rb') as f: + return f.read() def _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs): # TODO only abort if we try to histedit mq patches, not just