D845: perf: remove fallbacks to ancient versions of dirstate.walk()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Sep 29 21:53:10 UTC 2017


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  If the call to dirstate.walk() failed, we would try to fall back to
  older versions. These were removed in https://phab.mercurial-scm.org/rHGd3d1d39da2faad013b420507c9526b945f25ebb7 (walk: remove
  cmdutil.walk, 2008-05-12) and https://phab.mercurial-scm.org/rHGf8299c84b5b6180d4076d542cddc291993ac8edb (dirstate: fold statwalk
  and walk, 2008-06-26). We don't care about testing performance of
  versions that old versions at this point, so let's clean up.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/perf.py

CHANGE DETAILS

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -370,15 +370,8 @@
 @command('perfwalk', formatteropts)
 def perfwalk(ui, repo, *pats, **opts):
     timer, fm = gettimer(ui, opts)
-    try:
-        m = scmutil.match(repo[None], pats, {})
-        timer(lambda: len(list(repo.dirstate.walk(m, [], True, False))))
-    except Exception:
-        try:
-            m = scmutil.match(repo[None], pats, {})
-            timer(lambda: len([b for a, b, c in repo.dirstate.statwalk([], m)]))
-        except Exception:
-            timer(lambda: len(list(cmdutil.walk(repo, pats, {}))))
+    m = scmutil.match(repo[None], pats, {})
+    timer(lambda: len(list(repo.dirstate.walk(m, [], True, False))))
     fm.end()
 
 @command('perfannotate', formatteropts)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list