From patchwork Thu Feb 9 21:52:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,6,v2] ui: log time spent blocked on editor From: Simon Farnsworth X-Patchwork-Id: 18368 Message-Id: To: Date: Thu, 9 Feb 2017 13:52:16 -0800 # HG changeset patch # User Simon Farnsworth # Date 1486676443 28800 # Thu Feb 09 13:40:43 2017 -0800 # Node ID e21b9166fc2cdcda22a071de30f97b44c5796da1 # Parent be7dac985b12af413b43fa9685e29a90f80de4ef ui: log time spent blocked on editor The user's editor is outside our control. Log how long we spend blocked on it. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1075,13 +1075,14 @@ editor = self.geteditor() - self.system("%s \"%s\"" % (editor, name), - environ=environ, - onerr=error.Abort, errprefix=_("edit failed")) + with self.timeblockedsection('editor'): + self.system("%s \"%s\"" % (editor, name), + environ=environ, + onerr=error.Abort, errprefix=_("edit failed")) - f = open(name) - t = f.read() - f.close() + f = open(name) + t = f.read() + f.close() finally: os.unlink(name)