merge with stable
authorMatt Mackall <mpm@selenic.com>
Wed, 05 Nov 2014 11:16:31 -0600
changeset 23193 14c6aab35a39
parent 23190 383ff455cab8 (current diff)
parent 23192 73cfaa348650 (diff)
child 23194 8c29000c4295
merge with stable
--- a/mercurial/setdiscovery.py	Wed Nov 05 23:24:47 2014 +0900
+++ b/mercurial/setdiscovery.py	Wed Nov 05 11:16:31 2014 -0600
@@ -134,6 +134,8 @@
     roundtrips += 1
     ownheads = dag.heads()
     sample = _limitsample(ownheads, initialsamplesize)
+    # indices between sample and externalized version must match
+    sample = list(sample)
     if remote.local():
         # stopgap until we have a proper localpeer that supports batch()
         srvheadhashes = remote.heads()
@@ -165,7 +167,7 @@
         ui.debug("all remote heads known locally\n")
         return (srvheadhashes, False, srvheadhashes,)
 
-    if sample and util.all(yesno):
+    if sample and len(ownheads) <= initialsamplesize and util.all(yesno):
         ui.note(_("all local heads known remotely\n"))
         ownheadhashes = dag.externalizeall(ownheads)
         return (ownheadhashes, True, srvheadhashes,)