diff mercurial/discovery.py @ 17547:e6de4761d26f

checkheads: attend to phases when computing new heads with obsolete Checkheads was more permissive than expected. When the remote heads are public we don't need to search for successors. None will make a public head disappear.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Fri, 24 Aug 2012 16:52:45 +0200
parents 31f32a96e1e3
children eaa5fcc5bd20
line wrap: on
line diff
--- a/mercurial/discovery.py	Wed Aug 01 19:35:05 2012 +0200
+++ b/mercurial/discovery.py	Fri Aug 24 16:52:45 2012 +0200
@@ -293,11 +293,14 @@
             # more tricky for unsynced changes.
             newhs = set()
             for nh in candidate_newhs:
-                for suc in obsolete.anysuccessors(repo.obsstore, nh):
-                    if suc != nh and suc in allmissing:
-                        break
+                if repo[nh].phase() <= phases.public:
+                    newhs.add(nh)
                 else:
-                    newhs.add(nh)
+                    for suc in obsolete.anysuccessors(repo.obsstore, nh):
+                        if suc != nh and suc in allmissing:
+                            break
+                    else:
+                        newhs.add(nh)
         else:
             newhs = candidate_newhs
         if len(newhs) > len(oldhs):