perf: add option to perfstatus to get the status of unknown files
authorSiddharth Agarwal <sid0@fb.com>
Mon, 03 Dec 2012 13:53:53 -0800
changeset 18033 00ac420f24ee
parent 18032 a9e623bb440e
child 18034 1a570f04de07
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).
contrib/perf.py
--- 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, []),