mercurial/discovery.py
branchstable
changeset 44667 b561f3a68e41
parent 44450 7d5455b988ec
child 44729 26ce8e751503
--- a/mercurial/discovery.py	Thu Apr 02 12:05:41 2020 -0400
+++ b/mercurial/discovery.py	Mon Apr 06 00:24:57 2020 +0200
@@ -67,6 +67,10 @@
         ancestorsof=ancestorsof,
     )
     common, anyinc, srvheads = res
+    if heads and not anyinc:
+        # server could be lying on the advertised heads
+        has_node = repo.changelog.hasnode
+        anyinc = any(not has_node(n) for n in heads)
     return (list(common), anyinc, heads or list(srvheads))