pull: prevent duplicated entry in `op.pulledsubset`
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 26 Mar 2014 15:55:32 -0700
changeset 20878 09e7118715eb
parent 20877 9e9e3a4e9261
child 20879 cd03854a2e06
pull: prevent duplicated entry in `op.pulledsubset` In the bare pull case we could add the same node multiple time to the `pulloperation.pulledsubset`. Beside being a bit wrong this confused the new revset implementation of `revset._revancestor` into giving bad result. This changeset fix the pull operation part. The fix for the revset itself will come in another changeset.
mercurial/exchange.py
--- a/mercurial/exchange.py	Thu Mar 20 01:24:45 2014 -0700
+++ b/mercurial/exchange.py	Wed Mar 26 15:55:32 2014 -0700
@@ -409,7 +409,12 @@
         if self.heads is None:
             # We pulled every thing possible
             # sync on everything common
-            return self.common + self.rheads
+            c = set(self.common)
+            ret = list(self.common)
+            for n in self.rheads:
+                if n not in c:
+                    ret.append(n)
+            return ret
         else:
             # We pulled a specific subset
             # sync on this subset