context: enforce memctx.files() unicity
authorPatrick Mezard <pmezard@gmail.com>
Sun, 14 Dec 2008 17:35:19 +0100
changeset 7516 a8376f2aa3b1
parent 7515 ee5aba886108
child 7517 49f34b43cf90
child 7519 992d78981cba
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.
mercurial/context.py
--- 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