mercurial/exchange.py
changeset 44372 8407031f195f
parent 44282 877805928f85
child 44452 9d2b2df2c2ba
--- a/mercurial/exchange.py	Thu Feb 13 22:06:57 2020 -0500
+++ b/mercurial/exchange.py	Thu Feb 13 22:51:17 2020 -0500
@@ -856,7 +856,11 @@
     for b, scid, dcid in addsrc:
         if b in explicit:
             explicit.remove(b)
-            pushop.outbookmarks.append((b, b'', scid))
+            if bookmod.isdivergent(b):
+                pushop.ui.warn(_(b'cannot push divergent bookmark %s!\n') % b)
+                pushop.bkresult = 2
+            else:
+                pushop.outbookmarks.append((b, b'', scid))
     # search for overwritten bookmark
     for b, scid, dcid in list(advdst) + list(diverge) + list(differ):
         if b in explicit: