D7109: dirstate: add some traces on listdir calls

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Oct 16 10:22:22 EDT 2019


Closed by commit rHGbc5c4919a1a0: dirstate: add some traces on listdir calls (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7109?vs=17179&id=17207

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7109/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7109

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -16,6 +16,9 @@
 from .i18n import _
 from .node import nullid
 from .pycompat import delattr
+
+from hgdemandimport import tracing
+
 from . import (
     encoding,
     error,
@@ -951,6 +954,7 @@
         def traverse(work, alreadynormed):
             wadd = work.append
             while work:
+                tracing.counter('dirstate.walk work', len(work))
                 nd = work.pop()
                 visitentries = match.visitchildrenset(nd)
                 if not visitentries:
@@ -961,7 +965,8 @@
                 if nd != b'':
                     skip = b'.hg'
                 try:
-                    entries = listdir(join(nd), stat=True, skip=skip)
+                    with tracing.log('dirstate.walk.traverse listdir %s', nd):
+                        entries = listdir(join(nd), stat=True, skip=skip)
                 except OSError as inst:
                     if inst.errno in (errno.EACCES, errno.ENOENT):
                         match.bad(



To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel


More information about the Mercurial-devel mailing list