comparison mercurial/cmdutil.py @ 21944:0483ff40e326 stable

templates: re-add template listing support We used to have --style nosuch to list templates, but --style is now merged with --template/-T where random strings are acceptable templates. So we reserve 'list' to allow listing templates.
author Matt Mackall <mpm@selenic.com>
date Fri, 25 Jul 2014 15:35:09 -0500
parents 5375ba75df40
children be94ed4baa5d
comparison
equal deleted inserted replaced
21943:8534e670f4ee 21944:0483ff40e326
1123 try: 1123 try:
1124 tmpl = templater.parsestring(t) 1124 tmpl = templater.parsestring(t)
1125 except SyntaxError: 1125 except SyntaxError:
1126 tmpl = templater.parsestring(t, quoted=False) 1126 tmpl = templater.parsestring(t, quoted=False)
1127 return tmpl, None 1127 return tmpl, None
1128
1129 if tmpl == 'list':
1130 ui.write(_("available styles: %s\n") % templater.stylelist())
1131 raise util.Abort(_("specify a template"))
1128 1132
1129 # perhaps it's a path to a map or a template 1133 # perhaps it's a path to a map or a template
1130 if ('/' in tmpl or '\\' in tmpl) and os.path.isfile(tmpl): 1134 if ('/' in tmpl or '\\' in tmpl) and os.path.isfile(tmpl):
1131 # is it a mapfile for a style? 1135 # is it a mapfile for a style?
1132 if os.path.basename(tmpl).startswith("map-"): 1136 if os.path.basename(tmpl).startswith("map-"):