# HG changeset patch # User mpm@selenic.com # Date 1115713925 28800 # Node ID 42177b56b949e4b4a7fb710247bd73831e27a1b8 # Parent 91f1fa8471586b6f41d2e9c9aca73f46bd0c5f91 Attempt to recover journal automatically diff -r 91f1fa847158 -r 42177b56b949 mercurial/transaction.py --- a/mercurial/transaction.py Tue May 10 00:31:00 2005 -0800 +++ b/mercurial/transaction.py Tue May 10 00:32:05 2005 -0800 @@ -22,7 +22,9 @@ # abort here if the journal already exists if os.path.exists(self.journal): - raise "Journal already exists!" + print "journal already exists, recovering" + self.recover() + self.file = open(self.journal, "w") def __del__(self): @@ -59,4 +61,5 @@ for l in open(self.journal).readlines(): f, o = l.split('\0') self.opener(f, "a").truncate(int(o)) + os.unlink(self.journal)