contrib/perf.py
changeset 40744 594e84a2e574
parent 40743 415735bfcf2b
child 40746 82c189c511bd
equal deleted inserted replaced
40743:415735bfcf2b 40744:594e84a2e574
   536         len(cl.headrevs())
   536         len(cl.headrevs())
   537         clearcaches(cl)
   537         clearcaches(cl)
   538     timer(d)
   538     timer(d)
   539     fm.end()
   539     fm.end()
   540 
   540 
   541 @command(b'perftags', formatteropts)
   541 @command(b'perftags', formatteropts+
       
   542         [
       
   543             (b'', b'clear-revlogs', True, b'refresh changelog and manifest'),
       
   544         ])
   542 def perftags(ui, repo, **opts):
   545 def perftags(ui, repo, **opts):
   543     opts = _byteskwargs(opts)
   546     opts = _byteskwargs(opts)
   544     timer, fm = gettimer(ui, opts)
   547     timer, fm = gettimer(ui, opts)
   545     repocleartagscache = repocleartagscachefunc(repo)
   548     repocleartagscache = repocleartagscachefunc(repo)
       
   549     clearrevlogs = opts[b'clear_revlogs']
   546     def s():
   550     def s():
   547         clearchangelog(repo)
   551         if clearrevlogs:
   548         clearfilecache(repo.unfiltered(), 'manifest')
   552             clearchangelog(repo)
       
   553             clearfilecache(repo.unfiltered(), 'manifest')
   549         repocleartagscache()
   554         repocleartagscache()
   550     def t():
   555     def t():
   551         return len(repo.tags())
   556         return len(repo.tags())
   552     timer(t, setup=s)
   557     timer(t, setup=s)
   553     fm.end()
   558     fm.end()