# HG changeset patch # User Christian Ebert # Date 1202599934 -3600 # Node ID c5dfb272ff4f5d4443f30e9b8eca6cbefc710b8a # Parent 9c51c755118bc91f5f41186a2485a26695b1da98 Make restrict entirely a kwtemplater attribute diff -r 9c51c755118b -r c5dfb272ff4f hgkw/keyword.py --- a/hgkw/keyword.py Sun Feb 10 00:15:03 2008 +0100 +++ b/hgkw/keyword.py Sun Feb 10 00:32:14 2008 +0100 @@ -141,11 +141,11 @@ 'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}', } - def __init__(self, ui, repo, inc, exc, restrict): + def __init__(self, ui, repo, inc, exc, hgcmd): self.ui = ui self.repo = repo self.matcher = util.matcher(repo.root, inc=inc, exc=exc)[1] - self.restrict = restrict + self.restrict = hgcmd in restricted.split() self.commitnode = None self.path = '' @@ -451,8 +451,7 @@ if node1 is not None and node1 != repo.changectx().node(): hgcmd = 'diff1' - restrict = hgcmd in restricted.split() - _kwtemplater = kwtemplater(ui, repo, inc, exc, restrict) + _kwtemplater = kwtemplater(ui, repo, inc, exc, hgcmd) class kwrepo(repo.__class__): def file(self, f, kwmatch=False): @@ -464,7 +463,7 @@ def wread(self, filename): data = super(kwrepo, self).wread(filename) - if restrict and _kwtemplater.matcher(filename): + if _kwtemplater.restrict and _kwtemplater.matcher(filename): return _kwtemplater.shrink(data) return data