mercurial/discovery.py
changeset 17549 be0fcbb1c92f
parent 17548 eaa5fcc5bd20
child 17550 fc530080013b
--- a/mercurial/discovery.py	Sun Aug 26 00:25:33 2012 +0200
+++ b/mercurial/discovery.py	Sun Aug 26 00:27:44 2012 +0200
@@ -271,19 +271,19 @@
             # Maybe we should abort if we push more that one head
             # for new branches ?
             continue
-        if heads[2]:
-            unsynced = True
-        oldhs = set(heads[0])
         candidate_newhs = set(heads[1])
         # add unsynced data
+        oldhs = set(heads[0])
         oldhs.update(heads[2])
         candidate_newhs.update(heads[2])
         dhs = None
+        discardedheads = set()
         if repo.obsstore:
             # remove future heads which are actually obsolete by another
             # pushed element:
             #
-            # XXX There is several case this case does not handle properly
+            # XXX as above, There are several cases this case does not handle
+            # XXX properly
             #
             # (1) if <nh> is public, it won't be affected by obsolete marker
             #     and a new is created
@@ -300,11 +300,14 @@
                 else:
                     for suc in obsolete.anysuccessors(repo.obsstore, nh):
                         if suc != nh and suc in allfuturecommon:
+                            discardedheads.add(nh)
                             break
                     else:
                         newhs.add(nh)
         else:
             newhs = candidate_newhs
+        if [h for h in heads[2] if h not in discardedheads]:
+            unsynced = True
         if len(newhs) > len(oldhs):
             # strip updates to existing remote heads from the new heads list
             dhs = list(newhs - bookmarkedheads - oldhs)