changeset 29229:89bba2beb03e stable

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.
author liscju <piotr.listkiewicz@gmail.com>
date Tue, 24 May 2016 23:36:27 +0200
parents bf7b8157c483
children ee935a6e1ea2 c5912a0b156c
files mercurial/discovery.py tests/test-bookmarks-pushpull.t
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/discovery.py	Thu May 12 06:13:59 2016 -0700
+++ b/mercurial/discovery.py	Tue May 24 23:36:27 2016 +0200
@@ -240,15 +240,16 @@
 
 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:
--- a/tests/test-bookmarks-pushpull.t	Thu May 12 06:13:59 2016 -0700
+++ b/tests/test-bookmarks-pushpull.t	Tue May 24 23:36:27 2016 +0200
@@ -690,7 +690,7 @@
   $ 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