comparison mercurial/debugcommands.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 bcca357bb792
children 2ecce24dfcd3
comparison
equal deleted inserted replaced
32836:29558247b00e 32837:50586a0a946f
2118 ui.note(templater.prettyformat(tree), '\n') 2118 ui.note(templater.prettyformat(tree), '\n')
2119 newtree = templater.expandaliases(tree, aliases) 2119 newtree = templater.expandaliases(tree, aliases)
2120 if newtree != tree: 2120 if newtree != tree:
2121 ui.note(("* expanded:\n"), templater.prettyformat(newtree), '\n') 2121 ui.note(("* expanded:\n"), templater.prettyformat(newtree), '\n')
2122 2122
2123 mapfile = None
2124 if revs is None: 2123 if revs is None:
2125 k = 'debugtemplate' 2124 k = 'debugtemplate'
2126 t = formatter.maketemplater(ui, k, tmpl) 2125 t = formatter.maketemplater(ui, k, tmpl)
2127 ui.write(templater.stringify(t(k, ui=ui, **props))) 2126 ui.write(templater.stringify(t(k, ui=ui, **props)))
2128 else: 2127 else:
2129 displayer = cmdutil.changeset_templater(ui, repo, None, opts, tmpl, 2128 displayer = cmdutil.makelogtemplater(ui, repo, tmpl)
2130 mapfile, buffered=False)
2131 for r in revs: 2129 for r in revs:
2132 displayer.show(repo[r], **props) 2130 displayer.show(repo[r], **props)
2133 displayer.close() 2131 displayer.close()
2134 2132
2135 @command('debugupdatecaches', []) 2133 @command('debugupdatecaches', [])