# HG changeset patch # User liscju # Date 2016-05-24 21:36:27 # Node ID 89bba2beb03ea62e7fc8bcf3272e3cda1065ad89 # Parent bf7b8157c483c3bdb14107099b6db08e94981181 bookmarks: allow pushing active bookmark on new remote head (issue5236) Before 'hg push -B .' on new remote head complained with: abort: push creates new remote head ... It was because _nowarnheads was not expanding active bookmark name, so it didn't add active bookmark "proper" name to no warn heads list. diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -240,15 +240,16 @@ def _oldheadssummary(repo, remoteheads, def _nowarnheads(pushop): # Compute newly pushed bookmarks. We don't warn about bookmarked heads. - - # internal config: bookmarks.pushing - newbookmarks = pushop.ui.configlist('bookmarks', 'pushing') - repo = pushop.repo.unfiltered() remote = pushop.remote localbookmarks = repo._bookmarks remotebookmarks = remote.listkeys('bookmarks') bookmarkedheads = set() + + # internal config: bookmarks.pushing + newbookmarks = [localbookmarks.expandname(b) + for b in pushop.ui.configlist('bookmarks', 'pushing')] + for bm in localbookmarks: rnode = remotebookmarks.get(bm) if rnode and rnode in repo: diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t --- a/tests/test-bookmarks-pushpull.t +++ b/tests/test-bookmarks-pushpull.t @@ -690,7 +690,7 @@ pushing a new bookmark on a new head doe $ echo c5 > f2 $ hg ci -Am5 created new head - $ hg push -B W + $ hg push -B . pushing to http://localhost:$HGPORT/ searching for changes remote: adding changesets