##// END OF EJS Templates
Clarify precedence for template/style in commands.show_changeset():...
Thomas Arendsen Hein -
r3192:f2ed2673 default
parent child Browse files
Show More
@@ -372,16 +372,31 b' class changeset_printer(object):'
372 372 self.ui.status("\n")
373 373
374 374 def show_changeset(ui, repo, opts):
375 '''show one changeset. uses template or regular display. caller
376 can pass in 'style' and 'template' options in opts.'''
377
375 """show one changeset using template or regular display.
376
377 Display format will be the first non-empty hit of:
378 1. option 'template'
379 2. option 'style'
380 3. [ui] setting 'logtemplate'
381 4. [ui] setting 'style'
382 If all of these values are either the unset or the empty string,
383 regular display via changeset_printer() is done.
384 """
385 # options
378 386 tmpl = opts.get('template')
387 mapfile = None
379 388 if tmpl:
380 389 tmpl = templater.parsestring(tmpl, quoted=False)
381 390 else:
391 mapfile = opts.get('style')
392 # ui settings
393 if not mapfile:
382 394 tmpl = ui.config('ui', 'logtemplate')
383 if tmpl: tmpl = templater.parsestring(tmpl)
384 mapfile = opts.get('style') or ui.config('ui', 'style')
395 if tmpl:
396 tmpl = templater.parsestring(tmpl)
397 else:
398 mapfile = ui.config('ui', 'style')
399
385 400 if tmpl or mapfile:
386 401 if mapfile:
387 402 if not os.path.isfile(mapfile):
General Comments 0
You need to be logged in to leave comments. Login now