hgkw/keyword.py
changeset 551 ad5b41dddcda
parent 550 8533c85fe57d
child 552 baee5f7bfd32
equal deleted inserted replaced
548:b7b183546a15 551:ad5b41dddcda
    81 like CVS' $Log$, are not supported. A keyword template map
    81 like CVS' $Log$, are not supported. A keyword template map
    82 "Log = {desc}" expands to the first line of the changeset description.
    82 "Log = {desc}" expands to the first line of the changeset description.
    83 '''
    83 '''
    84 
    84 
    85 from mercurial import commands, cmdutil, dispatch, filelog, revlog, extensions
    85 from mercurial import commands, cmdutil, dispatch, filelog, revlog, extensions
    86 from mercurial import patch, localrepo, templater, templatefilters, util
    86 from mercurial import patch, localrepo, templater, templatefilters, util, match
    87 from mercurial.hgweb import webcommands
    87 from mercurial.hgweb import webcommands
    88 from mercurial.lock import release
    88 from mercurial.lock import release
    89 from mercurial.node import nullid, hex
    89 from mercurial.node import nullid, hex
    90 from mercurial.i18n import _
    90 from mercurial.i18n import _
    91 import re, shutil, tempfile, time
    91 import re, shutil, tempfile, time
   125     }
   125     }
   126 
   126 
   127     def __init__(self, ui, repo):
   127     def __init__(self, ui, repo):
   128         self.ui = ui
   128         self.ui = ui
   129         self.repo = repo
   129         self.repo = repo
   130         self.matcher = util.matcher(repo.root,
   130         self.matcher = match.match(repo.root, '', [],
   131                                     inc=kwtools['inc'], exc=kwtools['exc'])[1]
   131                                    kwtools['inc'], kwtools['exc'])
   132         self.restrict = kwtools['hgcmd'] in restricted.split()
   132         self.restrict = kwtools['hgcmd'] in restricted.split()
   133 
   133 
   134         kwmaps = self.ui.configitems('keywordmaps')
   134         kwmaps = self.ui.configitems('keywordmaps')
   135         if kwmaps: # override default templates
   135         if kwmaps: # override default templates
   136             kwmaps = [(k, templater.parsestring(v, False))
   136             kwmaps = [(k, templater.parsestring(v, False))