changeset 18033:00ac420f24ee

perf: add option to perfstatus to get the status of unknown files When status needs to look at unknown files (e.g. when running hg status), it needs to use a completely different algorithm than when it doesn't (e.g. when running hg diff).
author Siddharth Agarwal <sid0@fb.com>
date Mon, 03 Dec 2012 13:53:53 -0800
parents a9e623bb440e
children 1a570f04de07
files contrib/perf.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Tue Dec 04 10:29:18 2012 -0800
+++ b/contrib/perf.py	Mon Dec 03 13:53:53 2012 -0800
@@ -40,11 +40,11 @@
         except Exception:
             timer(lambda: len(list(cmdutil.walk(repo, pats, {}))))
 
-def perfstatus(ui, repo, *pats):
+def perfstatus(ui, repo, **opts):
     #m = match.always(repo.root, repo.getcwd())
     #timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False,
     #                                                False))))
-    timer(lambda: sum(map(len, repo.status())))
+    timer(lambda: sum(map(len, repo.status(**opts))))
 
 def clearcaches(cl):
     # behave somewhat consistently across internal API changes
@@ -238,7 +238,9 @@
     'perfnodelookup': (perfnodelookup, []),
     'perfparents': (perfparents, []),
     'perfstartup': (perfstartup, []),
-    'perfstatus': (perfstatus, []),
+    'perfstatus': (perfstatus,
+                   [('u', 'unknown', False,
+                     'ask status to look for unknown files')]),
     'perfwalk': (perfwalk, []),
     'perfmanifest': (perfmanifest, []),
     'perfchangeset': (perfchangeset, []),