comparison mercurial/cmdutil.py @ 5976:9f1e6ab76069

templates: move filters to their own module This eliminates just about all Mercurial dependencies in templater.py
author Matt Mackall <mpm@selenic.com>
date Thu, 31 Jan 2008 14:44:19 -0600
parents d0576d065993
children 5ffa962783c4
comparison
equal deleted inserted replaced
5975:75d9fe70c654 5976:9f1e6ab76069
6 # of the GNU General Public License, incorporated herein by reference. 6 # of the GNU General Public License, incorporated herein by reference.
7 7
8 from node import * 8 from node import *
9 from i18n import _ 9 from i18n import _
10 import os, sys, bisect, stat 10 import os, sys, bisect, stat
11 import mdiff, bdiff, util, templater, patch, errno 11 import mdiff, bdiff, util, templater, templatefilters, patch, errno
12 12
13 revrangesep = ':' 13 revrangesep = ':'
14 14
15 class UnknownCommand(Exception): 15 class UnknownCommand(Exception):
16 """Exception raised if command is not in the command table.""" 16 """Exception raised if command is not in the command table."""
671 class changeset_templater(changeset_printer): 671 class changeset_templater(changeset_printer):
672 '''format changeset information.''' 672 '''format changeset information.'''
673 673
674 def __init__(self, ui, repo, patch, mapfile, buffered): 674 def __init__(self, ui, repo, patch, mapfile, buffered):
675 changeset_printer.__init__(self, ui, repo, patch, buffered) 675 changeset_printer.__init__(self, ui, repo, patch, buffered)
676 filters = templater.common_filters.copy() 676 filters = templatefilters.filters.copy()
677 filters['formatnode'] = (ui.debugflag and (lambda x: x) 677 filters['formatnode'] = (ui.debugflag and (lambda x: x)
678 or (lambda x: x[:12])) 678 or (lambda x: x[:12]))
679 self.t = templater.templater(mapfile, filters, 679 self.t = templater.templater(mapfile, filters,
680 cache={ 680 cache={
681 'parent': '{rev}:{node|formatnode} ', 681 'parent': '{rev}:{node|formatnode} ',