--- a/hgkw/keyword.py Sun Sep 02 15:01:51 2007 +0200
+++ b/hgkw/keyword.py Sun Sep 02 15:09:56 2007 +0200
@@ -189,6 +189,14 @@
return cmdutil.changeset_templater(self.ui, self.repo,
False, None, '', False)
+ def _wwrite(self, f, data, man):
+ '''Makes repo.wwrite backwards compatible.'''
+ try:
+ self.repo.wwrite(f, data, man.flags(f))
+ except AttributeError:
+ # older versions want file descriptor as 3. optional arg
+ self.repo.wwrite(f, data)
+
def _ctxnode(self, node):
'''Obtains missing node from file context.'''
if not self.node:
@@ -241,11 +249,7 @@
data, kwfound = fp.read(man[f])
if kwfound:
notify(_('overwriting %s %s keywords\n') % (f, action))
- try:
- self.repo.wwrite(f, data, man.flags(f))
- except AttributeError:
- # older versions want file descriptor as 3. optional arg
- self.repo.wwrite(f, data)
+ self._wwrite(f, data, man)
overwritten.append(f)
if overwritten:
try: