Mercurial > hg > mercurial-crew-with-dirclash
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 +++ b/mercurial/appendfile.py @@ -134,10 +134,16 @@ class appendopener(object): 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.