Show More
@@ -238,6 +238,23 b' def _oldheadssummary(repo, remoteheads, ' | |||||
238 | unsynced = set() |
|
238 | unsynced = set() | |
239 | return {None: (oldheads, newheads, unsynced)} |
|
239 | return {None: (oldheads, newheads, unsynced)} | |
240 |
|
240 | |||
|
241 | def _nowarnheads(repo, remote, newbookmarks): | |||
|
242 | # Compute newly pushed bookmarks. We don't warn about bookmarked heads. | |||
|
243 | localbookmarks = repo._bookmarks | |||
|
244 | remotebookmarks = remote.listkeys('bookmarks') | |||
|
245 | bookmarkedheads = set() | |||
|
246 | for bm in localbookmarks: | |||
|
247 | rnode = remotebookmarks.get(bm) | |||
|
248 | if rnode and rnode in repo: | |||
|
249 | lctx, rctx = repo[bm], repo[rnode] | |||
|
250 | if bookmarks.validdest(repo, rctx, lctx): | |||
|
251 | bookmarkedheads.add(lctx.node()) | |||
|
252 | else: | |||
|
253 | if bm in newbookmarks and bm not in remotebookmarks: | |||
|
254 | bookmarkedheads.add(repo[bm].node()) | |||
|
255 | ||||
|
256 | return bookmarkedheads | |||
|
257 | ||||
241 | def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False, |
|
258 | def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False, | |
242 | newbookmarks=[]): |
|
259 | newbookmarks=[]): | |
243 | """Check that a push won't add any outgoing head |
|
260 | """Check that a push won't add any outgoing head | |
@@ -268,19 +285,8 b' def checkheads(repo, remote, outgoing, r' | |||||
268 | hint=_("use 'hg push --new-branch' to create" |
|
285 | hint=_("use 'hg push --new-branch' to create" | |
269 | " new remote branches")) |
|
286 | " new remote branches")) | |
270 |
|
287 | |||
271 | # 2. Compute newly pushed bookmarks. We don't warn about bookmarked heads. |
|
288 | # 2. Find heads that we need not warn about | |
272 | localbookmarks = repo._bookmarks |
|
289 | nowarnheads = _nowarnheads(repo, remote, newbookmarks) | |
273 | remotebookmarks = remote.listkeys('bookmarks') |
|
|||
274 | bookmarkedheads = set() |
|
|||
275 | for bm in localbookmarks: |
|
|||
276 | rnode = remotebookmarks.get(bm) |
|
|||
277 | if rnode and rnode in repo: |
|
|||
278 | lctx, rctx = repo[bm], repo[rnode] |
|
|||
279 | if bookmarks.validdest(repo, rctx, lctx): |
|
|||
280 | bookmarkedheads.add(lctx.node()) |
|
|||
281 | else: |
|
|||
282 | if bm in newbookmarks and bm not in remotebookmarks: |
|
|||
283 | bookmarkedheads.add(repo[bm].node()) |
|
|||
284 |
|
290 | |||
285 | # 3. Check for new heads. |
|
291 | # 3. Check for new heads. | |
286 | # If there are more heads after the push than before, a suitable |
|
292 | # If there are more heads after the push than before, a suitable | |
@@ -366,7 +372,7 b' def checkheads(repo, remote, outgoing, r' | |||||
366 | " pushing new heads") |
|
372 | " pushing new heads") | |
367 | elif len(newhs) > len(oldhs): |
|
373 | elif len(newhs) > len(oldhs): | |
368 | # remove bookmarked or existing remote heads from the new heads list |
|
374 | # remove bookmarked or existing remote heads from the new heads list | |
369 |
dhs = sorted(newhs - |
|
375 | dhs = sorted(newhs - nowarnheads - oldhs) | |
370 | if dhs: |
|
376 | if dhs: | |
371 | if errormsg is None: |
|
377 | if errormsg is None: | |
372 | if branch not in ('default', None): |
|
378 | if branch not in ('default', None): |
General Comments 0
You need to be logged in to leave comments.
Login now