Patchwork [5,of,6,v2] extdiff: log time spent in external diff program

login
register
mail settings
Submitter Simon Farnsworth
Date Feb. 9, 2017, 9:52 p.m.
Message ID <acb1103ff1de3c9c40a4.1486677138@devvm022.lla2.facebook.com>
Download mbox | patch
Permalink /patch/18371/
State Changes Requested
Headers show

Comments

Simon Farnsworth - Feb. 9, 2017, 9:52 p.m.
# HG changeset patch
# User Simon Farnsworth <simonfar@fb.com>
# Date 1486676255 28800
#      Thu Feb 09 13:37:35 2017 -0800
# Node ID acb1103ff1de3c9c40a4b1c6b19ca65161329d02
# Parent  ff695f191c30036c1171d8509f55ec60d19e0614
extdiff: log time spent in external diff program

We can't fix the time external diff programs take to run. Log that duration
for us to remove from any stats we gather

Patch

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -273,7 +273,8 @@ 
         cmdline = re.sub(regex, quote, cmdline)
 
         ui.debug('running %r in %s\n' % (cmdline, tmproot))
-        ui.system(cmdline, cwd=tmproot)
+        with ui.timeblockedsection('extdiff'):
+            ui.system(cmdline, cwd=tmproot)
 
         for copy_fn, working_fn, mtime in fns_and_mtime:
             if os.lstat(copy_fn).st_mtime != mtime: