diff mercurial/discovery.py @ 17248:6ffb35b2284c stable

discovery: add extinct changesets to outgoing.excluded Before this change, push would incorrectly fast-path the bundle generation when extinct changesets are involved, because they are not added to outgoing.excluded. The reason to do so are related to outgoing.excluded being assumed to contain only secret changesets by scmutil.nochangesfound(), when displaying warnings like: changes found (ignored 9 secret changesets) Still, outgoing.excluded seems like a good API to report the extinct changesets instead of dedicated code and nothing in the docstring indicates it to be bound to secret changesets. This patch adds extinct changesets to outgoing.excluded and fixes scmutil.nochangesfound() to filter the excluded node list. Original version and test by Pierre-Yves.David@ens-lyon.org
author Patrick Mezard <patrick@mezard.eu>
date Wed, 25 Jul 2012 19:34:31 +0200
parents 738ad56dd8a6
children 98166640b356
line wrap: on
line diff
--- a/mercurial/discovery.py	Thu Jul 26 12:07:55 2012 +0200
+++ b/mercurial/discovery.py	Wed Jul 25 19:34:31 2012 +0200
@@ -116,7 +116,7 @@
         # use visible heads as it should be cached
         og.missingheads = visibleheads(repo)
         # extinct changesets are silently ignored
-        og.excluded = [ctx.node() for ctx in repo.set('secret()')]
+        og.excluded = [ctx.node() for ctx in repo.set('secret() or extinct()')]
     else:
         # compute common, missing and exclude secret stuff
         sets = repo.changelog.findcommonmissing(og.commonheads, onlyheads)
@@ -125,12 +125,10 @@
         og.excluded = excluded = []
         for node in allmissing:
             ctx = repo[node]
-            if not ctx.extinct():
-                # extinct changesets are silently ignored
-                if ctx.phase() >= phases.secret:
-                    excluded.append(node)
-                else:
-                    missing.append(node)
+            if ctx.phase() >= phases.secret or ctx.extinct():
+                excluded.append(node)
+            else:
+                missing.append(node)
         if len(missing) == len(allmissing):
             missingheads = onlyheads
         else: # update missing heads