--- a/mercurial/discovery.py Fri Jun 01 17:05:31 2012 -0700
+++ b/mercurial/discovery.py Sun May 13 10:21:27 2012 +0200
@@ -226,11 +226,20 @@
# If there are more heads after the push than before, a suitable
# error message, depending on unsynced status, is displayed.
error = None
+ remotebookmarks = remote.listkeys('bookmarks')
+ localbookmarks = repo._bookmarks
+
for branch in branches:
newhs = set(newmap[branch])
oldhs = set(oldmap[branch])
+ dhs = None
if len(newhs) > len(oldhs):
- dhs = list(newhs - oldhs)
+ # strip updates to existing remote heads from the new heads list
+ bookmarkedheads = set([repo[bm].node() for bm in localbookmarks
+ if bm in remotebookmarks and
+ remote[bm] == repo[bm].ancestor(remote[bm])])
+ dhs = list(newhs - bookmarkedheads - oldhs)
+ if dhs:
if error is None:
if branch not in ('default', None):
error = _("push creates new remote head %s "