Catch an AttributeError in wwrite triggered by older Hg versions
Thanks to Norman Walsh for reporting.
--- a/hgkw/keyword.py Wed Jul 18 16:17:04 2007 +0200
+++ b/hgkw/keyword.py Wed Jul 18 21:24:04 2007 +0200
@@ -213,7 +213,11 @@
data, cnt = fp.read(man[f])
if cnt:
notify(_('overwriting %s %s keywords\n') % (f, action))
- self.repo.wwrite(f, data, man.flags(f))
+ 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)
files.append(f)
if files:
self.repo.dirstate.update(files, 'n')