changeset 83:97a5c943db19

Compat with mercurial 1.9.2
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 19 Sep 2011 01:55:35 +0200
parents 8108d566a8b5
children c4cc5f3bcf12
files hgext/obsolete.py hgext/states.py
diffstat 2 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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()