##// END OF EJS Templates
discovery: only calculate closed branches if required...
Pulkit Goyal -
r42402:d0e773ad default
parent child Browse files
Show More
@@ -340,15 +340,15 b' def checkheads(pushop):'
340 pushop.pushbranchmap = headssum
340 pushop.pushbranchmap = headssum
341 newbranches = [branch for branch, heads in headssum.iteritems()
341 newbranches = [branch for branch, heads in headssum.iteritems()
342 if heads[0] is None]
342 if heads[0] is None]
343 # Makes a set of closed branches
343 # 1. Check for new branches on the remote.
344 if newbranches and not newbranch: # new branch requires --new-branch
345 branchnames = ', '.join(sorted(newbranches))
346 # Calculate how many of the new branches are closed branches
344 closedbranches = set()
347 closedbranches = set()
345 for tag, heads, tip, isclosed in repo.branchmap().iterbranches():
348 for tag, heads, tip, isclosed in repo.branchmap().iterbranches():
346 if isclosed:
349 if isclosed:
347 closedbranches.add(tag)
350 closedbranches.add(tag)
348 closedbranches = (closedbranches & set(newbranches))
351 closedbranches = (closedbranches & set(newbranches))
349 # 1. Check for new branches on the remote.
350 if newbranches and not newbranch: # new branch requires --new-branch
351 branchnames = ', '.join(sorted(newbranches))
352 if closedbranches:
352 if closedbranches:
353 errmsg = (_("push creates new remote branches: %s (%d closed)!")
353 errmsg = (_("push creates new remote branches: %s (%d closed)!")
354 % (branchnames, len(closedbranches)))
354 % (branchnames, len(closedbranches)))
General Comments 0
You need to be logged in to leave comments. Login now