bookmarks: allow pushing active bookmark on new remote head (issue5236) stable
authorliscju <piotr.listkiewicz@gmail.com>
Tue, 24 May 2016 23:36:27 +0200
branchstable
changeset 29229 89bba2beb03e
parent 29196 bf7b8157c483
child 29237 ee935a6e1ea2
child 29254 c5912a0b156c
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.
mercurial/discovery.py
tests/test-bookmarks-pushpull.t
--- 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