contrib/perf.py
changeset 38255 71d59b487d0c
parent 38254 6b91815fcdce
child 38256 b8f75bc9f623
equal deleted inserted replaced
38254:6b91815fcdce 38255:71d59b487d0c
   897     timer(moonwalk)
   897     timer(moonwalk)
   898     fm.end()
   898     fm.end()
   899 
   899 
   900 @command('perftemplating', formatteropts)
   900 @command('perftemplating', formatteropts)
   901 def perftemplating(ui, repo, *revs, **opts):
   901 def perftemplating(ui, repo, *revs, **opts):
       
   902     nullui = ui.copy()
       
   903     nullui.fout = open(os.devnull, 'wb')
       
   904     nullui.disablepager()
       
   905 
   902     def format():
   906     def format():
   903         commands.log(ui, repo, rev=revs, date='', user='',
   907         commands.log(nullui, repo, rev=revs, date='', user='',
   904                      template='{date|shortdate} [{rev}:{node|short}]'
   908                      template='{date|shortdate} [{rev}:{node|short}]'
   905                               ' {author|person}: {desc|firstline}\n')
   909                               ' {author|person}: {desc|firstline}\n')
   906 
   910 
   907     timer, fm = gettimer(ui, opts)
   911     timer, fm = gettimer(ui, opts)
   908     ui.pushbuffer()
       
   909     timer(format)
   912     timer(format)
   910     ui.popbuffer()
       
   911     fm.end()
   913     fm.end()
   912 
   914 
   913 @command('perfcca', formatteropts)
   915 @command('perfcca', formatteropts)
   914 def perfcca(ui, repo, **opts):
   916 def perfcca(ui, repo, **opts):
   915     timer, fm = gettimer(ui, opts)
   917     timer, fm = gettimer(ui, opts)