diff mercurial/appendfile.py @ 2232:ef3c039e7ab8

Always remove appendopener tmp files (fixes issue235). test-hup triggered this bug by killing "hg serve --stdio".
author Thomas Arendsen Hein <thomas@intevation.de>
date Tue, 09 May 2006 17:03:00 +0200
parents 6886bc0b77af
children d7f866789d7e
line wrap: on
line diff
--- a/mercurial/appendfile.py	Tue May 09 13:26:16 2006 +0200
+++ b/mercurial/appendfile.py	Tue May 09 17:03:00 2006 +0200
@@ -134,10 +134,16 @@
             s = fp.read()
             fp.close()
             os.unlink(tmpname)
+            del self.tmpnames[name]
             fp = self.realopener(name, 'a')
             fp.write(s)
             fp.close()
 
+    def cleanup(self):
+        '''delete temp files (this discards unwritten data!)'''
+        for tmpname in self.tmpnames.values():
+            os.unlink(tmpname)
+
 # files for changelog and manifest are in different appendopeners, so
 # not mixed up together.