changeset 15986:ba959f6e10f8 stable

discovery: fix regression when checking heads for pre 1.4 client (issue3218) This code is not run by the test suite and silly name error were lurking here.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 24 Jan 2012 19:49:30 +0100
parents 740b1b4c7958
children b5f6a63b4ded
files mercurial/discovery.py mercurial/localrepo.py
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/discovery.py	Wed Jan 25 14:06:04 2012 -0600
+++ b/mercurial/discovery.py	Tue Jan 24 19:49:30 2012 +0100
@@ -131,7 +131,7 @@
 
     return og
 
-def checkheads(repo, remote, outgoing, remoteheads, newbranch=False):
+def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False):
     """Check that a push won't add any outgoing head
 
     raise Abort error and display ui message as needed.
@@ -190,9 +190,9 @@
         # Construct {old,new}map with branch = None (topological branch).
         # (code based on _updatebranchcache)
         oldheads = set(h for h in remoteheads if h in cl.nodemap)
-        newheads = oldheads.union(outg)
+        newheads = oldheads.union(outgoing.missing)
         if len(newheads) > 1:
-            for latest in reversed(outg):
+            for latest in reversed(outgoing.missing):
                 if latest not in newheads:
                     continue
                 minhrev = min(cl.rev(h) for h in newheads)
--- a/mercurial/localrepo.py	Wed Jan 25 14:06:04 2012 -0600
+++ b/mercurial/localrepo.py	Tue Jan 24 19:49:30 2012 +0100
@@ -1635,7 +1635,8 @@
                     # something to push
                     if not force:
                         discovery.checkheads(self, remote, outgoing,
-                                             remoteheads, newbranch)
+                                             remoteheads, newbranch,
+                                             bool(inc))
 
                     # create a changegroup from local
                     if revs is None and not outgoing.excluded: