comparison mercurial/cmdutil.py @ 8360:acc202b71619

templater: provide the standard template filters by default
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Tue, 12 May 2009 12:04:05 +0200
parents b87a50b7125c
children 52e6117a9940
comparison
equal deleted inserted replaced
8359:07ddec2ea203 8360:acc202b71619
710 class changeset_templater(changeset_printer): 710 class changeset_templater(changeset_printer):
711 '''format changeset information.''' 711 '''format changeset information.'''
712 712
713 def __init__(self, ui, repo, patch, diffopts, mapfile, buffered): 713 def __init__(self, ui, repo, patch, diffopts, mapfile, buffered):
714 changeset_printer.__init__(self, ui, repo, patch, diffopts, buffered) 714 changeset_printer.__init__(self, ui, repo, patch, diffopts, buffered)
715 filters = templatefilters.filters.copy() 715 formatnode = ui.debugflag and (lambda x: x) or (lambda x: x[:12])
716 filters['formatnode'] = (ui.debugflag and (lambda x: x) 716 self.t = templater.templater(mapfile, {'formatnode': formatnode},
717 or (lambda x: x[:12]))
718 self.t = templater.templater(mapfile, filters,
719 cache={ 717 cache={
720 'parent': '{rev}:{node|formatnode} ', 718 'parent': '{rev}:{node|formatnode} ',
721 'manifest': '{rev}:{node|formatnode}', 719 'manifest': '{rev}:{node|formatnode}',
722 'filecopy': '{name} ({source})'}) 720 'filecopy': '{name} ({source})'})
723 721