Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 32855:50586a0a946f
cmdutil: factor out helper to create changeset_templater with literal template
changeset_templater has lots of arguments, but most callers only need to
specify a literal template 'tmpl'.
"hg debugtemplate" has no diff option, which means 'opts' were effectively {},
so dropped opts.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 22 Apr 2017 18:42:03 +0900 |
parents | 9d76812f9b0b |
children | 615ec3f14aa9 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Wed Jun 14 23:56:58 2017 -0400 +++ b/mercurial/cmdutil.py Sat Apr 22 18:42:03 2017 +0900 @@ -1674,6 +1674,11 @@ return formatter.lookuptemplate(ui, 'changeset', tmpl) +def makelogtemplater(ui, repo, tmpl, buffered=False): + """Create a changeset_templater from a literal template 'tmpl'""" + return changeset_templater(ui, repo, matchfn=None, diffopts={}, + tmpl=tmpl, mapfile=None, buffered=buffered) + def show_changeset(ui, repo, opts, buffered=False): """show one changeset using template or regular display.