Mercurial > hg-stable
changeset 27306:bafb1235f505
perf: add optional rev for perflog and perftemplating
author | timeless <timeless@mozdev.org> |
---|---|
date | Fri, 04 Dec 2015 18:08:50 +0000 |
parents | 5831cfbf0e33 |
children | f36dc0062b1a |
files | contrib/perf.py |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Fri Dec 04 18:18:07 2015 +0000 +++ b/contrib/perf.py Fri Dec 04 18:08:50 2015 +0000 @@ -368,10 +368,12 @@ @command('perflog', [('', 'rename', False, 'ask log to follow renames')] + formatteropts) -def perflog(ui, repo, **opts): +def perflog(ui, repo, rev=None, **opts): + if rev is None: + rev=[] timer, fm = gettimer(ui, opts) ui.pushbuffer() - timer(lambda: commands.log(ui, repo, rev=[], date='', user='', + timer(lambda: commands.log(ui, repo, rev=rev, date='', user='', copies=opts.get('rename'))) ui.popbuffer() fm.end() @@ -391,10 +393,12 @@ fm.end() @command('perftemplating', formatteropts) -def perftemplating(ui, repo, **opts): +def perftemplating(ui, repo, rev=None, **opts): + if rev is None: + rev=[] timer, fm = gettimer(ui, opts) ui.pushbuffer() - timer(lambda: commands.log(ui, repo, rev=[], date='', user='', + timer(lambda: commands.log(ui, repo, rev=rev, date='', user='', template='{date|shortdate} [{rev}:{node|short}]' ' {author|person}: {desc|firstline}\n')) ui.popbuffer()