224 |
224 |
225 # 5. Check for new heads. |
225 # 5. Check for new heads. |
226 # If there are more heads after the push than before, a suitable |
226 # If there are more heads after the push than before, a suitable |
227 # error message, depending on unsynced status, is displayed. |
227 # error message, depending on unsynced status, is displayed. |
228 error = None |
228 error = None |
|
229 remotebookmarks = remote.listkeys('bookmarks') |
|
230 localbookmarks = repo._bookmarks |
|
231 |
229 for branch in branches: |
232 for branch in branches: |
230 newhs = set(newmap[branch]) |
233 newhs = set(newmap[branch]) |
231 oldhs = set(oldmap[branch]) |
234 oldhs = set(oldmap[branch]) |
|
235 dhs = None |
232 if len(newhs) > len(oldhs): |
236 if len(newhs) > len(oldhs): |
233 dhs = list(newhs - oldhs) |
237 # strip updates to existing remote heads from the new heads list |
|
238 bookmarkedheads = set([repo[bm].node() for bm in localbookmarks |
|
239 if bm in remotebookmarks and |
|
240 remote[bm] == repo[bm].ancestor(remote[bm])]) |
|
241 dhs = list(newhs - bookmarkedheads - oldhs) |
|
242 if dhs: |
234 if error is None: |
243 if error is None: |
235 if branch not in ('default', None): |
244 if branch not in ('default', None): |
236 error = _("push creates new remote head %s " |
245 error = _("push creates new remote head %s " |
237 "on branch '%s'!") % (short(dhs[0]), branch) |
246 "on branch '%s'!") % (short(dhs[0]), branch) |
238 else: |
247 else: |