# HG changeset patch # User mpm@selenic.com # Date 1115713860 28800 # Node ID 91f1fa8471586b6f41d2e9c9aca73f46bd0c5f91 # Parent df3f4625387818eb3e69a73de3f60dd9215aa96e Fix multiple changes to file per transaction diff --git a/mercurial/transaction.py b/mercurial/transaction.py --- a/mercurial/transaction.py +++ b/mercurial/transaction.py @@ -17,6 +17,7 @@ class transaction: def __init__(self, opener, journal): self.opener = opener self.entries = [] + self.map = {} self.journal = journal # abort here if the journal already exists @@ -30,7 +31,9 @@ class transaction: except: pass def add(self, file, offset): + if file in self.map: return self.entries.append((file, offset)) + self.map[file] = 1 # add enough data to the journal to do the truncate self.file.write("%s\0%d\n" % (file, offset)) self.file.flush()