comparison hgext/keyword.py @ 24987:fd7287f0b43c

templater: remove noop calls of parsestring(s, quoted=False) (API) Since db7463aa080f, parsestring(s, quoted=False) just returns s.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 04 May 2015 10:01:03 +0900
parents 4ecbd88cde9a
children 80c5b2666a96
comparison
equal deleted inserted replaced
24986:fb9b7b937b3e 24987:fd7287f0b43c
81 like CVS' $Log$, are not supported. A keyword template map "Log = 81 like CVS' $Log$, are not supported. A keyword template map "Log =
82 {desc}" expands to the first line of the changeset description. 82 {desc}" expands to the first line of the changeset description.
83 ''' 83 '''
84 84
85 from mercurial import commands, context, cmdutil, dispatch, filelog, extensions 85 from mercurial import commands, context, cmdutil, dispatch, filelog, extensions
86 from mercurial import localrepo, match, patch, templatefilters, templater, util 86 from mercurial import localrepo, match, patch, templatefilters, util
87 from mercurial import scmutil, pathutil 87 from mercurial import scmutil, pathutil
88 from mercurial.hgweb import webcommands 88 from mercurial.hgweb import webcommands
89 from mercurial.i18n import _ 89 from mercurial.i18n import _
90 import os, re, tempfile 90 import os, re, tempfile
91 91
189 self.restrict = kwtools['hgcmd'] in restricted.split() 189 self.restrict = kwtools['hgcmd'] in restricted.split()
190 self.postcommit = False 190 self.postcommit = False
191 191
192 kwmaps = self.ui.configitems('keywordmaps') 192 kwmaps = self.ui.configitems('keywordmaps')
193 if kwmaps: # override default templates 193 if kwmaps: # override default templates
194 self.templates = dict((k, templater.parsestring(v, False)) 194 self.templates = dict(kwmaps)
195 for k, v in kwmaps)
196 else: 195 else:
197 self.templates = _defaultkwmaps(self.ui) 196 self.templates = _defaultkwmaps(self.ui)
198 197
199 @util.propertycache 198 @util.propertycache
200 def escape(self): 199 def escape(self):