diff --git a/mercurial/discovery.py b/mercurial/discovery.py index c7d30fdb13b229537269030c94c7b2540b6d34a0_bWVyY3VyaWFsL2Rpc2NvdmVyeS5weQ==..ba7eeeac9603077c6759235078297e63ae92078b_bWVyY3VyaWFsL2Rpc2NvdmVyeS5weQ== 100644 --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -279,7 +279,7 @@ if bookmarks.validdest(repo, rctx, lctx): bookmarkedheads.add(lctx.node()) else: - if bm in newbookmarks: + if bm in newbookmarks and bm not in remotebookmarks: bookmarkedheads.add(repo[bm].node()) # 3. Check for new heads. diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t index c7d30fdb13b229537269030c94c7b2540b6d34a0_dGVzdHMvdGVzdC1ib29rbWFya3MtcHVzaHB1bGwudA==..ba7eeeac9603077c6759235078297e63ae92078b_dGVzdHMvdGVzdC1ib29rbWFya3MtcHVzaHB1bGwudA== 100644 --- a/tests/test-bookmarks-pushpull.t +++ b/tests/test-bookmarks-pushpull.t @@ -678,6 +678,26 @@ $ hg -R ../b id -r W cc978a373a53 tip W +pushing an existing but divergent bookmark with -B still requires -f + + $ hg clone -q . r + $ hg up -q X + $ echo 1 > f2 + $ hg ci -qAml + + $ cd r + $ hg up -q X + $ echo 2 > f2 + $ hg ci -qAmr + $ hg push -B X + pushing to $TESTTMP/addmarks (glob) + searching for changes + remote has heads on branch 'default' that are not known locally: a2a606d9ff1b + abort: push creates new remote head 54694f811df9 with bookmark 'X'! + (pull and merge or see "hg help push" for details about pushing new heads) + [255] + $ cd .. + Check summary output for incoming/outgoing bookmarks $ hg bookmarks -d X