changeset 6441:c9b8f2820bc0

rollback: unlink files truncated to length 0
author Brendan Cully <brendan@kublai.com>
date Mon, 31 Mar 2008 23:02:25 -0700
parents 101526031d06
children fa5454a451c6
files mercurial/transaction.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/transaction.py	Mon Mar 31 23:14:25 2008 -0500
+++ b/mercurial/transaction.py	Mon Mar 31 23:02:25 2008 -0700
@@ -96,9 +96,13 @@
     files = {}
     for l in open(file).readlines():
         f, o = l.split('\0')
-        files[f] = o
+        files[f] = int(o)
     for f in files:
         o = files[f]
-        opener(f, "a").truncate(int(o))
+        if o:
+            opener(f, "a").truncate(int(o))
+        else:
+            fn = opener(f).name
+            os.unlink(fn)
     os.unlink(file)