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).
--- 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, []),