contrib/perf.py
changeset 18871 a2d4ab4f575d
parent 18845 c1f416e4bc80
child 18877 2e9fe9e2671f
equal deleted inserted replaced
18869:e8b4b139a545 18871:a2d4ab4f575d
    51 def perfstatus(ui, repo, **opts):
    51 def perfstatus(ui, repo, **opts):
    52     #m = match.always(repo.root, repo.getcwd())
    52     #m = match.always(repo.root, repo.getcwd())
    53     #timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False,
    53     #timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False,
    54     #                                                False))))
    54     #                                                False))))
    55     timer(lambda: sum(map(len, repo.status(**opts))))
    55     timer(lambda: sum(map(len, repo.status(**opts))))
       
    56 
       
    57 @command('perfaddremove')
       
    58 def perfaddremove(ui, repo):
       
    59     try:
       
    60         oldquiet = repo.ui.quiet
       
    61         repo.ui.quiet = True
       
    62         timer(lambda: scmutil.addremove(repo, dry_run=True))
       
    63     finally:
       
    64         repo.ui.quiet = oldquiet
    56 
    65 
    57 def clearcaches(cl):
    66 def clearcaches(cl):
    58     # behave somewhat consistently across internal API changes
    67     # behave somewhat consistently across internal API changes
    59     if util.safehasattr(cl, 'clearcaches'):
    68     if util.safehasattr(cl, 'clearcaches'):
    60         cl.clearcaches()
    69         cl.clearcaches()