##// END OF EJS Templates
rollback: unlink files truncated to length 0
Brendan Cully -
r6441:c9b8f282 default
parent child Browse files
Show More
@@ -96,9 +96,13 b' def rollback(opener, file):'
96 files = {}
96 files = {}
97 for l in open(file).readlines():
97 for l in open(file).readlines():
98 f, o = l.split('\0')
98 f, o = l.split('\0')
99 files[f] = o
99 files[f] = int(o)
100 for f in files:
100 for f in files:
101 o = files[f]
101 o = files[f]
102 opener(f, "a").truncate(int(o))
102 if o:
103 opener(f, "a").truncate(int(o))
104 else:
105 fn = opener(f).name
106 os.unlink(fn)
103 os.unlink(file)
107 os.unlink(file)
104
108
General Comments 0
You need to be logged in to leave comments. Login now