Patchwork [7,of,8,v3] extdiff: log time spent in external diff program

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

Comments

Simon Farnsworth - Feb. 10, 2017, 9:06 p.m.
# HG changeset patch
# User Simon Farnsworth <simonfar@fb.com>
# Date 1486760569 28800
#      Fri Feb 10 13:02:49 2017 -0800
# Node ID fff5635e512c056195f2c91d976736fff690b46d
# Parent  7650c3dee1cab050f3835ae95590636473b58874
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: