Patchwork [7,of,7,V2] copies: add time information to the debug information

login
register
mail settings
Submitter Boris Feld
Date Oct. 1, 2018, 4:46 p.m.
Message ID <ea41c3e0af57cd4e75cc.1538412390@localhost.localdomain>
Download mbox | patch
Permalink /patch/35260/
State New
Headers show

Comments

Boris Feld - Oct. 1, 2018, 4:46 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1536335028 14400
#      Fri Sep 07 11:43:48 2018 -0400
# Node ID ea41c3e0af57cd4e75ccfd258f523bcac6cd6c8f
# Parent  f2217ab4eabea69017826084288abc00c0cf40b7
# EXP-Topic copy-perf
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r ea41c3e0af57
copies: add time information to the debug information

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -204,11 +204,16 @@  def _committedforwardcopies(a, b, match)
         fctx = b[f]
         fctx._ancestrycontext = ancestrycontext
 
+        if debug:
+            start = util.timer()
         ofctx = _tracefile(fctx, am, limit)
         if ofctx:
             if debug:
                 dbg('debug.copies:          rename of: %s\n' % ofctx._path)
             cm[f] = ofctx.path()
+        if debug:
+            dbg('debug.copies:          time: %s seconds\n'
+                % (util.timer() - start))
     return cm
 
 def _forwardcopies(a, b, match=None):
diff --git a/tests/test-mv-cp-st-diff.t b/tests/test-mv-cp-st-diff.t
--- a/tests/test-mv-cp-st-diff.t
+++ b/tests/test-mv-cp-st-diff.t
@@ -1676,6 +1676,7 @@  Check debug output for copy tracing
   debug.copies:      missing file to search: 1
   debug.copies:        tracing file: renamed
   debug.copies:          rename of: f
+  debug.copies:          time: * seconds (glob)
   A renamed
     f
   R f