changeset 7516:a8376f2aa3b1

context: enforce memctx.files() unicity localrepo.commitctx() expects changed files lists to contain unique items and does not sort itself. Passing duplicates makes them evaluated more than once and changes the committed changelog id.
author Patrick Mezard <pmezard@gmail.com>
date Sun, 14 Dec 2008 17:35:19 +0100
parents ee5aba886108
children 49f34b43cf90 992d78981cba
files mercurial/context.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sat Dec 13 18:32:29 2008 +0100
+++ b/mercurial/context.py	Sun Dec 14 17:35:19 2008 +0100
@@ -734,7 +734,7 @@
         parents = [(p or nullid) for p in parents]
         p1, p2 = parents
         self._parents = [changectx(self._repo, p) for p in (p1, p2)]
-        files = util.sort(list(files))
+        files = util.sort(util.unique(files))
         self._status = [files, [], [], [], []]
         self._filectxfn = filectxfn