equal
deleted
inserted
replaced
235 with remote.commandexecutor() as e: |
235 with remote.commandexecutor() as e: |
236 remotemap = e.callcommand(b'branchmap', {}).result() |
236 remotemap = e.callcommand(b'branchmap', {}).result() |
237 |
237 |
238 knownnode = cl.hasnode # do not use nodemap until it is filtered |
238 knownnode = cl.hasnode # do not use nodemap until it is filtered |
239 # A. register remote heads of branches which are in outgoing set |
239 # A. register remote heads of branches which are in outgoing set |
240 for branch, heads in pycompat.iteritems(remotemap): |
240 for branch, heads in remotemap.items(): |
241 # don't add head info about branches which we don't have locally |
241 # don't add head info about branches which we don't have locally |
242 if branch not in branches: |
242 if branch not in branches: |
243 continue |
243 continue |
244 known = [] |
244 known = [] |
245 unsynced = [] |
245 unsynced = [] |
259 # This will possibly add new heads and remove existing ones. |
259 # This will possibly add new heads and remove existing ones. |
260 newmap = branchmap.remotebranchcache( |
260 newmap = branchmap.remotebranchcache( |
261 repo, |
261 repo, |
262 ( |
262 ( |
263 (branch, heads[1]) |
263 (branch, heads[1]) |
264 for branch, heads in pycompat.iteritems(headssum) |
264 for branch, heads in headssum.items() |
265 if heads[0] is not None |
265 if heads[0] is not None |
266 ), |
266 ), |
267 ) |
267 ) |
268 newmap.update(repo, (ctx.rev() for ctx in missingctx)) |
268 newmap.update(repo, (ctx.rev() for ctx in missingctx)) |
269 for branch, newheads in pycompat.iteritems(newmap): |
269 for branch, newheads in newmap.items(): |
270 headssum[branch][1][:] = newheads |
270 headssum[branch][1][:] = newheads |
271 for branch, items in pycompat.iteritems(headssum): |
271 for branch, items in headssum.items(): |
272 for l in items: |
272 for l in items: |
273 if l is not None: |
273 if l is not None: |
274 l.sort() |
274 l.sort() |
275 headssum[branch] = items + ([],) |
275 headssum[branch] = items + ([],) |
276 |
276 |
377 headssum = _headssummary(pushop) |
377 headssum = _headssummary(pushop) |
378 else: |
378 else: |
379 headssum = _oldheadssummary(repo, remoteheads, outgoing, inc) |
379 headssum = _oldheadssummary(repo, remoteheads, outgoing, inc) |
380 pushop.pushbranchmap = headssum |
380 pushop.pushbranchmap = headssum |
381 newbranches = [ |
381 newbranches = [ |
382 branch |
382 branch for branch, heads in headssum.items() if heads[0] is None |
383 for branch, heads in pycompat.iteritems(headssum) |
|
384 if heads[0] is None |
|
385 ] |
383 ] |
386 # 1. Check for new branches on the remote. |
384 # 1. Check for new branches on the remote. |
387 if newbranches and not newbranch: # new branch requires --new-branch |
385 if newbranches and not newbranch: # new branch requires --new-branch |
388 branchnames = b', '.join(sorted(newbranches)) |
386 branchnames = b', '.join(sorted(newbranches)) |
389 # Calculate how many of the new branches are closed branches |
387 # Calculate how many of the new branches are closed branches |