mercurial/commands.py
changeset 3192 f2ed26736dfa
parent 3189 a73a785ea8e1
child 3193 a6d0cd63068c
equal deleted inserted replaced
3189:a73a785ea8e1 3192:f2ed26736dfa
   370                 self.ui.status(_("summary:     %s\n") %
   370                 self.ui.status(_("summary:     %s\n") %
   371                                description.splitlines()[0])
   371                                description.splitlines()[0])
   372         self.ui.status("\n")
   372         self.ui.status("\n")
   373 
   373 
   374 def show_changeset(ui, repo, opts):
   374 def show_changeset(ui, repo, opts):
   375     '''show one changeset.  uses template or regular display.  caller
   375     """show one changeset using template or regular display.
   376     can pass in 'style' and 'template' options in opts.'''
   376 
   377 
   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     tmpl = opts.get('template')
   386     tmpl = opts.get('template')
       
   387     mapfile = None
   379     if tmpl:
   388     if tmpl:
   380         tmpl = templater.parsestring(tmpl, quoted=False)
   389         tmpl = templater.parsestring(tmpl, quoted=False)
   381     else:
   390     else:
   382         tmpl = ui.config('ui', 'logtemplate')
   391         mapfile = opts.get('style')
   383         if tmpl: tmpl = templater.parsestring(tmpl)
   392         # ui settings
   384     mapfile = opts.get('style') or ui.config('ui', 'style')
   393         if not mapfile:
       
   394             tmpl = ui.config('ui', 'logtemplate')
       
   395             if tmpl:
       
   396                 tmpl = templater.parsestring(tmpl)
       
   397             else:
       
   398                 mapfile = ui.config('ui', 'style')
       
   399 
   385     if tmpl or mapfile:
   400     if tmpl or mapfile:
   386         if mapfile:
   401         if mapfile:
   387             if not os.path.isfile(mapfile):
   402             if not os.path.isfile(mapfile):
   388                 mapname = templater.templatepath('map-cmdline.' + mapfile)
   403                 mapname = templater.templatepath('map-cmdline.' + mapfile)
   389                 if not mapname: mapname = templater.templatepath(mapfile)
   404                 if not mapname: mapname = templater.templatepath(mapfile)