Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 32837: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 |
comparison
equal
deleted
inserted
replaced
32836:29558247b00e | 32837:50586a0a946f |
---|---|
1672 if not tmpl: | 1672 if not tmpl: |
1673 return None, None | 1673 return None, None |
1674 | 1674 |
1675 return formatter.lookuptemplate(ui, 'changeset', tmpl) | 1675 return formatter.lookuptemplate(ui, 'changeset', tmpl) |
1676 | 1676 |
1677 def makelogtemplater(ui, repo, tmpl, buffered=False): | |
1678 """Create a changeset_templater from a literal template 'tmpl'""" | |
1679 return changeset_templater(ui, repo, matchfn=None, diffopts={}, | |
1680 tmpl=tmpl, mapfile=None, buffered=buffered) | |
1681 | |
1677 def show_changeset(ui, repo, opts, buffered=False): | 1682 def show_changeset(ui, repo, opts, buffered=False): |
1678 """show one changeset using template or regular display. | 1683 """show one changeset using template or regular display. |
1679 | 1684 |
1680 Display format will be the first non-empty hit of: | 1685 Display format will be the first non-empty hit of: |
1681 1. option 'template' | 1686 1. option 'template' |