Patchwork [1,of,3] perf: add option to perfstatus to get the status of unknown files

login
register
mail settings
Submitter Siddharth Agarwal
Date Dec. 3, 2012, 10:23 p.m.
Message ID <8909a6b5f30283782586.1354573433@sid0x220>
Download mbox | patch
Permalink /patch/1/
State Accepted
Commit 00ac420f24ee4f184a4d5d53e88d3955bf915935
Headers show

Comments

Siddharth Agarwal - Dec. 3, 2012, 10:23 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1354571633 28800
# Node ID 8909a6b5f3028378258675aa51a972b8bc0a77f0
# Parent  3e0c50582f2e047c117ba26803ab11f4784bb29b
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).
Matt Mackall - Dec. 3, 2012, 10:35 p.m.
On Mon, 2012-12-03 at 14:23 -0800, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # Date 1354571633 28800
> # Node ID 8909a6b5f3028378258675aa51a972b8bc0a77f0
> # Parent  3e0c50582f2e047c117ba26803ab11f4784bb29b
> perf: add option to perfstatus to get the status of unknown files

Queued for default, thanks.

Patch

diff -r 3e0c50582f2e -r 8909a6b5f302 contrib/perf.py
--- a/contrib/perf.py	Fri Nov 30 14:18:34 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, []),