Show More
@@ -116,11 +116,11 b' class kwtemplater(object):' | |||
|
116 | 116 | 'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}', |
|
117 | 117 | } |
|
118 | 118 | |
|
119 |
def __init__(self, ui, repo, inc, exc, restrict |
|
|
119 | def __init__(self, ui, repo, inc, exc, restrict): | |
|
120 | 120 | self.ui = ui |
|
121 | 121 | self.repo = repo |
|
122 | 122 | self.matcher = util.matcher(repo.root, inc=inc, exc=exc)[1] |
|
123 |
self.restrict |
|
|
123 | self.restrict = restrict | |
|
124 | 124 | self.commitnode = None |
|
125 | 125 | self.path = '' |
|
126 | 126 | |
@@ -159,7 +159,7 b' class kwtemplater(object):' | |||
|
159 | 159 | |
|
160 | 160 | def expand(self, node, data): |
|
161 | 161 | '''Returns data with keywords expanded.''' |
|
162 |
if self.restrict |
|
|
162 | if self.restrict or util.binary(data): | |
|
163 | 163 | return data |
|
164 | 164 | return self.substitute(node, data, self.re_kw.sub) |
|
165 | 165 | |
@@ -436,8 +436,8 b' def reposetup(ui, repo):' | |||
|
436 | 436 | return |
|
437 | 437 | |
|
438 | 438 | global _kwtemplater |
|
439 |
|
|
|
440 |
_kwtemplater = kwtemplater(ui, repo, inc, exc, |
|
|
439 | restrict = hgcmd in restricted.split() | |
|
440 | _kwtemplater = kwtemplater(ui, repo, inc, exc, restrict) | |
|
441 | 441 | |
|
442 | 442 | class kwrepo(repo.__class__): |
|
443 | 443 | def file(self, f, kwmatch=False): |
@@ -449,7 +449,7 b' def reposetup(ui, repo):' | |||
|
449 | 449 | |
|
450 | 450 | def wread(self, filename): |
|
451 | 451 | data = super(kwrepo, self).wread(filename) |
|
452 |
if |
|
|
452 | if restrict and _kwtemplater.matcher(filename): | |
|
453 | 453 | return _kwtemplater.shrink(data) |
|
454 | 454 | return data |
|
455 | 455 |
General Comments 0
You need to be logged in to leave comments.
Login now