merge stable together stable
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 11 Jan 2010 22:41:02 +0100
branchstable
changeset 10231 9bf3ebdb19ae
parent 10225 6521605bc200 (current diff)
parent 10229 9df52218810d (diff)
child 10233 69e07d234cc6
child 10242 ecd0a5c8bbe5
merge stable together
--- a/contrib/shrink-revlog.py	Sat Jan 09 23:16:36 2010 +0100
+++ b/contrib/shrink-revlog.py	Mon Jan 11 22:41:02 2010 +0100
@@ -212,7 +212,8 @@
           'Running \'hg verify\' is strongly recommended.)\n'
           % (oldindexfn, olddatafn))
 
-try:
-    main()
-except KeyboardInterrupt:
-    sys.exit("interrupted")
+if __name__ == "__main__":
+    try:
+        main()
+    except KeyboardInterrupt:
+        sys.exit("interrupted")
--- a/mercurial/transaction.py	Sat Jan 09 23:16:36 2010 +0100
+++ b/mercurial/transaction.py	Mon Jan 11 22:41:02 2010 +0100
@@ -42,8 +42,6 @@
 
 class transaction(object):
     def __init__(self, report, opener, journal, after=None, createmode=None):
-        self.journal = None
-
         self.count = 1
         self.report = report
         self.opener = opener
@@ -140,14 +138,14 @@
         self.count = 0
         self.file.close()
 
-        if not self.entries:
-            if self.journal:
-                os.unlink(self.journal)
-            return
+        try:
+            if not self.entries:
+                if self.journal:
+                    os.unlink(self.journal)
+                return
 
-        self.report(_("transaction abort!\n"))
+            self.report(_("transaction abort!\n"))
 
-        try:
             try:
                 _playback(self.journal, self.report, self.opener, self.entries, False)
                 self.report(_("rollback completed\n"))