--- a/hgext/obsolete.py Mon Sep 19 01:11:10 2011 +0200
+++ b/hgext/obsolete.py Mon Sep 19 01:55:35 2011 +0200
@@ -350,7 +350,10 @@
f = self.opener('obsolete-relations', 'w', atomictemp=True)
try:
_obsserialise(self._obssubrels, f)
- f.rename()
+ try:
+ f.rename()
+ except AttributeError: # old version
+ f.close()
finally:
f.close()
--- a/hgext/states.py Mon Sep 19 01:11:10 2011 +0200
+++ b/hgext/states.py Mon Sep 19 01:55:35 2011 +0200
@@ -636,7 +636,10 @@
try:
for h in heads:
f.write(hex(h) + '\n')
- f.rename()
+ try:
+ f.rename()
+ except AttributeError: # old version
+ f.close()
finally:
f.close()
@@ -852,7 +855,10 @@
try:
for st in self._enabledstates:
f.write(st.name + '\n')
- f.rename()
+ try:
+ f.rename()
+ except AttributeError: # old version
+ f.close()
finally:
f.close()