# HG changeset patch # User Thomas Arendsen Hein # Date 1159551787 -7200 # Node ID f2ed26736dfa9f4fdbe1492c223eda20efd14599 # Parent a73a785ea8e1624a57c2e9479345b5cd2a953127 Clarify precedence for template/style in commands.show_changeset(): Display format will be the first non-empty hit of: 1. option 'template' 2. option 'style' 3. [ui] setting 'logtemplate' 4. [ui] setting 'style' If all of these values are either the unset or the empty string, regular display via changeset_printer() is done. diff -r a73a785ea8e1 -r f2ed26736dfa mercurial/commands.py --- a/mercurial/commands.py Fri Sep 29 18:39:49 2006 +0200 +++ b/mercurial/commands.py Fri Sep 29 19:43:07 2006 +0200 @@ -372,16 +372,31 @@ self.ui.status("\n") def show_changeset(ui, repo, opts): - '''show one changeset. uses template or regular display. caller - can pass in 'style' and 'template' options in opts.''' - + """show one changeset using template or regular display. + + Display format will be the first non-empty hit of: + 1. option 'template' + 2. option 'style' + 3. [ui] setting 'logtemplate' + 4. [ui] setting 'style' + If all of these values are either the unset or the empty string, + regular display via changeset_printer() is done. + """ + # options tmpl = opts.get('template') + mapfile = None if tmpl: tmpl = templater.parsestring(tmpl, quoted=False) else: - tmpl = ui.config('ui', 'logtemplate') - if tmpl: tmpl = templater.parsestring(tmpl) - mapfile = opts.get('style') or ui.config('ui', 'style') + mapfile = opts.get('style') + # ui settings + if not mapfile: + tmpl = ui.config('ui', 'logtemplate') + if tmpl: + tmpl = templater.parsestring(tmpl) + else: + mapfile = ui.config('ui', 'style') + if tmpl or mapfile: if mapfile: if not os.path.isfile(mapfile):