mercurial/discovery.py
changeset 20184 a14d93b2fb1b
parent 20051 b988b3b19303
child 20225 d2704c48f417
--- a/mercurial/discovery.py	Thu Nov 21 15:46:49 2013 -0500
+++ b/mercurial/discovery.py	Mon Nov 11 21:16:54 2013 +1100
@@ -219,7 +219,8 @@
     unsynced = inc and set([None]) or set()
     return {None: (oldheads, newheads, unsynced)}
 
-def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False):
+def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False,
+               newbookmarks=[]):
     """Check that a push won't add any outgoing head
 
     raise Abort error and display ui message as needed.
@@ -259,6 +260,9 @@
             lctx, rctx = repo[bm], repo[rnode]
             if bookmarks.validdest(repo, rctx, lctx):
                 bookmarkedheads.add(lctx.node())
+        else:
+            if bm in newbookmarks:
+                bookmarkedheads.add(repo[bm].node())
 
     # 3. Check for new heads.
     # If there are more heads after the push than before, a suitable