--- a/hgkw/keyword.py Fri Jul 13 12:57:59 2007 +0200
+++ b/hgkw/keyword.py Sat Jul 14 20:28:45 2007 +0200
@@ -167,17 +167,18 @@
return text
return self.re_kw.sub(r'$\1$', text)
- def overwrite(self, candidates):
+ def overwrite(self, candidates, mn):
'''Overwrites candidates in working dir expanding keywords.'''
files = []
+ m = self.repo.manifest.read(mn)
for f in candidates:
- data = self.repo.wfile(f).read()
+ data = self.repo.wread(f)
if not util.binary(data):
self.path = f
data, kwct = self.re_kw.subn(self.kwsub, data)
if kwct:
self.ui.debug(_('overwriting %s expanding keywords\n') % f)
- self.repo.wfile(f, 'w').write(data)
+ self.repo.wwrite(f, data, m.flags(f))
files.append(f)
if files:
self.repo.dirstate.update(files, 'n')
@@ -271,13 +272,13 @@
if node is None:
return node
- candidates = self.changelog.read(node)[3]
- candidates = [f for f in candidates if kwfmatcher(f)
+ cl = self.changelog.read(node)
+ candidates = [f for f in cl[3] if kwfmatcher(f)
and f not in removed
and not os.path.islink(self.wjoin(f))]
if candidates:
kwt = kwtemplater(ui, self, node=node)
- kwt.overwrite(candidates)
+ kwt.overwrite(candidates, cl[0])
return node
finally: