Mercurial > public > mercurial-scm > hg-stable
diff mercurial/transaction.py @ 582:df8a5a0098d4
Remove all remaining print statements
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Remove all remaining print statements
Convert most prints to ui.warn or ui.write
Pass a write function into transactions
manifest hash: d1b0af7a344fc087a5acfe3ae87b782c20d043e0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCx1Q3ywK+sNU5EO8RAqSTAJwM5t/m+JOlf2ZXOjuItCSdFiubcwCdFm3G
HoicikSYpTgfCj2pIRfyLjo=
=Loqo
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Sat, 02 Jul 2005 18:57:59 -0800 |
parents | fbfbd4e506c3 |
children | 46a8dd3145cc 445970ccf57a |
line wrap: on
line diff
--- 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():