mercurial/exchange.py
changeset 35314 483b5dd0f1aa
parent 35277 44b8b5ad30eb
child 35356 a29fe459fc49
--- a/mercurial/exchange.py	Wed Dec 06 22:44:51 2017 +0100
+++ b/mercurial/exchange.py	Wed Dec 06 23:33:01 2017 +0100
@@ -514,7 +514,11 @@
 def _pushdiscoverychangeset(pushop):
     """discover the changeset that need to be pushed"""
     fci = discovery.findcommonincoming
-    commoninc = fci(pushop.repo, pushop.remote, force=pushop.force)
+    if pushop.revs:
+        commoninc = fci(pushop.repo, pushop.remote, force=pushop.force,
+                        ancestorsof=pushop.revs)
+    else:
+        commoninc = fci(pushop.repo, pushop.remote, force=pushop.force)
     common, inc, remoteheads = commoninc
     fco = discovery.findcommonoutgoing
     outgoing = fco(pushop.repo, pushop.remote, onlyheads=pushop.revs,