mercurial/transaction.py
changeset 582 df8a5a0098d4
parent 573 fbfbd4e506c3
child 785 46a8dd3145cc
child 793 445970ccf57a
--- a/mercurial/transaction.py	Sat Jul 02 18:31:13 2005 -0800
+++ b/mercurial/transaction.py	Sat Jul 02 18:57:59 2005 -0800
@@ -15,13 +15,14 @@
 import util
 
 class transaction:
-    def __init__(self, opener, journal, after = None):
+    def __init__(self, report, opener, journal, after = None):
         self.journal = None
 
         # abort here if the journal already exists
         if os.path.exists(journal):
             raise "journal already exists - run hg recover"
 
+        self.report = report
         self.opener = opener
         self.after = after
         self.entries = []
@@ -57,17 +58,17 @@
     def abort(self):
         if not self.entries: return
 
-        print "transaction abort!"
+        self.report("transaction abort!\n")
 
         for f, o in self.entries:
             try:
                 self.opener(f, "a").truncate(o)
             except:
-                print "failed to truncate", f
+                self.report("failed to truncate %s\n" % f)
 
         self.entries = []
 
-        print "rollback completed"
+        self.report("rollback completed\n")
 
 def rollback(opener, file):
     for l in open(file).readlines():