transaction: reset transaction on abort
Prevent the use of the transaction after it has been aborted.
Co-contributor: Sune Foldager <cryo@cyanite.org>
--- a/mercurial/transaction.py Fri Apr 24 09:56:53 2009 +0200
+++ b/mercurial/transaction.py Sun Apr 19 20:02:32 2009 +0200
@@ -94,6 +94,9 @@
self._abort()
def _abort(self):
+ self.count = 0
+ self.file.close()
+
if not self.entries: return
self.report(_("transaction abort!\n"))
@@ -109,13 +112,14 @@
self.entries = []
if not failed:
- self.file.close()
os.unlink(self.journal)
- self.journal = None
self.report(_("rollback completed\n"))
else:
self.report(_("rollback failed - please run hg recover\n"))
+ self.journal = None
+
+
def rollback(opener, file):
files = {}
for l in open(file).readlines():