##// END OF EJS Templates
perftemplating: allow to specify the template to test...
Boris Feld -
r38277:ae6e02fc default
parent child Browse files
Show More
@@ -909,7 +909,8 b' def perfmoonwalk(ui, repo, **opts):'
909 @command('perftemplating',
909 @command('perftemplating',
910 [('r', 'rev', [], 'revisions to run the template on'),
910 [('r', 'rev', [], 'revisions to run the template on'),
911 ] + formatteropts)
911 ] + formatteropts)
912 def perftemplating(ui, repo, **opts):
912 def perftemplating(ui, repo, testedtemplate=None, **opts):
913 """test the rendering time of a given template"""
913 if makelogtemplater is None:
914 if makelogtemplater is None:
914 ui.write_err('incompatible Mercurial version')
915 ui.write_err('incompatible Mercurial version')
915 return 1
916 return 1
@@ -922,9 +923,11 b' def perftemplating(ui, repo, **opts):'
922 revs = ['all()']
923 revs = ['all()']
923 revs = list(scmutil.revrange(repo, revs))
924 revs = list(scmutil.revrange(repo, revs))
924
925
925 template = ('{date|shortdate} [{rev}:{node|short}]'
926 defaulttemplate = ('{date|shortdate} [{rev}:{node|short}]'
926 ' {author|person}: {desc|firstline}\n')
927 ' {author|person}: {desc|firstline}\n')
927 displayer = makelogtemplater(nullui, repo, template)
928 if testedtemplate is None:
929 testedtemplate = defaulttemplate
930 displayer = makelogtemplater(nullui, repo, testedtemplate)
928 def format():
931 def format():
929 for r in revs:
932 for r in revs:
930 ctx = repo[r]
933 ctx = repo[r]
@@ -113,7 +113,7 b' perfstatus'
113 perfstatus (no help text available)
113 perfstatus (no help text available)
114 perftags (no help text available)
114 perftags (no help text available)
115 perftemplating
115 perftemplating
116 (no help text available)
116 test the rendering time of a given template
117 perfunidiff benchmark a unified diff between revisions
117 perfunidiff benchmark a unified diff between revisions
118 perfvolatilesets
118 perfvolatilesets
119 benchmark the computation of various volatile set
119 benchmark the computation of various volatile set
General Comments 0
You need to be logged in to leave comments. Login now