##// END OF EJS Templates
Attempt to recover journal automatically
mpm@selenic.com -
r43:42177b56 default
parent child Browse files
Show More
@@ -22,7 +22,9 b' class transaction:'
22
22
23 # abort here if the journal already exists
23 # abort here if the journal already exists
24 if os.path.exists(self.journal):
24 if os.path.exists(self.journal):
25 raise "Journal already exists!"
25 print "journal already exists, recovering"
26 self.recover()
27
26 self.file = open(self.journal, "w")
28 self.file = open(self.journal, "w")
27
29
28 def __del__(self):
30 def __del__(self):
@@ -59,4 +61,5 b' class transaction:'
59 for l in open(self.journal).readlines():
61 for l in open(self.journal).readlines():
60 f, o = l.split('\0')
62 f, o = l.split('\0')
61 self.opener(f, "a").truncate(int(o))
63 self.opener(f, "a").truncate(int(o))
64 os.unlink(self.journal)
62
65
General Comments 0
You need to be logged in to leave comments. Login now