Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/transaction.py @ 558:0ceea19182a9
transaction: __del__ should do nothing if the journal already exists
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
transaction: __del__ should do nothing if the journal already exists
manifest hash: c85f747ca762b7c446d306cbd7a20f8e566557fb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCxXbTywK+sNU5EO8RAvjsAKCcTSzN9OjtoAdaZgtjDs9380ia7ACfcXsx
FcNESqr4nX9b97WTGszJs48=
=C2sL
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Fri, 01 Jul 2005 09:01:07 -0800 |
parents | 03f27b1381f9 |
children | fbfbd4e506c3 |
comparison
equal
deleted
inserted
replaced
557:b9fee419a1bd | 558:0ceea19182a9 |
---|---|
29 self.journal = journal | 29 self.journal = journal |
30 | 30 |
31 self.file = open(self.journal, "w") | 31 self.file = open(self.journal, "w") |
32 | 32 |
33 def __del__(self): | 33 def __del__(self): |
34 if self.entries: self.abort() | 34 if self.journal: |
35 try: os.unlink(self.journal) | 35 if self.entries: self.abort() |
36 except: pass | 36 self.file.close() |
37 try: os.unlink(self.journal) | |
38 except: pass | |
37 | 39 |
38 def add(self, file, offset): | 40 def add(self, file, offset): |
39 if file in self.map: return | 41 if file in self.map: return |
40 self.entries.append((file, offset)) | 42 self.entries.append((file, offset)) |
41 self.map[file] = 1 | 43 self.map[file] = 1 |