--- a/hgext/obsolete.py Sat Jan 07 11:20:59 2012 +0100
+++ b/hgext/obsolete.py Sat Jan 07 11:26:48 2012 +0100
@@ -387,15 +387,19 @@
def _writeobsrels(self):
"""Write obsolete relation on disk"""
# XXX handle lock
- f = self.opener('obsolete-relations', 'w', atomictemp=True)
+ lock = self.wlock()
try:
- _obsserialise(self._obssubrels, f)
+ f = self.opener('obsolete-relations', 'w', atomictemp=True)
try:
- f.rename()
- except AttributeError: # old version
+ _obsserialise(self._obssubrels, f)
+ try:
+ f.rename()
+ except AttributeError: # old version
+ f.close()
+ finally:
f.close()
finally:
- f.close()
+ lock.release()
### local clone support