hgext/notify.py
changeset 24987 fd7287f0b43c
parent 24306 6ddc86eedc3b
child 25186 80c5b2666a96
equal deleted inserted replaced
24986:fb9b7b937b3e 24987:fd7287f0b43c
   136 import email, socket, time
   136 import email, socket, time
   137 # On python2.4 you have to import this by name or they fail to
   137 # On python2.4 you have to import this by name or they fail to
   138 # load. This was not a problem on Python 2.7.
   138 # load. This was not a problem on Python 2.7.
   139 import email.Parser
   139 import email.Parser
   140 from mercurial.i18n import _
   140 from mercurial.i18n import _
   141 from mercurial import patch, cmdutil, templater, util, mail
   141 from mercurial import patch, cmdutil, util, mail
   142 import fnmatch
   142 import fnmatch
   143 
   143 
   144 testedwith = 'internal'
   144 testedwith = 'internal'
   145 
   145 
   146 # template for single changeset can include email headers.
   146 # template for single changeset can include email headers.
   188         mapfile = self.ui.config('notify', 'style')
   188         mapfile = self.ui.config('notify', 'style')
   189         template = (self.ui.config('notify', hooktype) or
   189         template = (self.ui.config('notify', hooktype) or
   190                     self.ui.config('notify', 'template'))
   190                     self.ui.config('notify', 'template'))
   191         if not mapfile and not template:
   191         if not mapfile and not template:
   192             template = deftemplates.get(hooktype) or single_template
   192             template = deftemplates.get(hooktype) or single_template
   193         if template:
       
   194             template = templater.parsestring(template, quoted=False)
       
   195         self.t = cmdutil.changeset_templater(self.ui, self.repo, False, None,
   193         self.t = cmdutil.changeset_templater(self.ui, self.repo, False, None,
   196                                              template, mapfile, False)
   194                                              template, mapfile, False)
   197 
   195 
   198     def strip(self, path):
   196     def strip(self, path):
   199         '''strip leading slashes from local path, turn into web-safe path.'''
   197         '''strip leading slashes from local path, turn into web-safe path.'''