comparison mercurial/cmdutil.py @ 22582:4fe5fa49eac8 stable

templater: fix precedence of --style and --template options Since e3eb480a9391, --template option is ignored if --style is specified, which is wrong according to the doc of show_changeset(): Display format will be the first non-empty hit of: 1. option 'template' 2. option 'style' ...
author Yuya Nishihara <yuya@tcha.org>
date Tue, 30 Sep 2014 23:15:56 +0900
parents 0c838e7459a5
children cd1b43226b34
comparison
equal deleted inserted replaced
22577:a111e460318a 22582:4fe5fa49eac8
1085 """ 1085 """
1086 Find the template matching the given template spec or style. 1086 Find the template matching the given template spec or style.
1087 """ 1087 """
1088 1088
1089 # ui settings 1089 # ui settings
1090 if not tmpl and not style: 1090 if not tmpl and not style: # template are stronger than style
1091 tmpl = ui.config('ui', 'logtemplate') 1091 tmpl = ui.config('ui', 'logtemplate')
1092 if tmpl: 1092 if tmpl:
1093 try: 1093 try:
1094 tmpl = templater.parsestring(tmpl) 1094 tmpl = templater.parsestring(tmpl)
1095 except SyntaxError: 1095 except SyntaxError:
1096 tmpl = templater.parsestring(tmpl, quoted=False) 1096 tmpl = templater.parsestring(tmpl, quoted=False)
1097 return tmpl, None 1097 return tmpl, None
1098 else: 1098 else:
1099 style = util.expandpath(ui.config('ui', 'style', '')) 1099 style = util.expandpath(ui.config('ui', 'style', ''))
1100 1100
1101 if style: 1101 if not tmpl and style:
1102 mapfile = style 1102 mapfile = style
1103 if not os.path.split(mapfile)[0]: 1103 if not os.path.split(mapfile)[0]:
1104 mapname = (templater.templatepath('map-cmdline.' + mapfile) 1104 mapname = (templater.templatepath('map-cmdline.' + mapfile)
1105 or templater.templatepath(mapfile)) 1105 or templater.templatepath(mapfile))
1106 if mapname: 1106 if mapname: