comparison mercurial/discovery.py @ 44729:26ce8e751503 stable 5.4rc0

merge default into stable for 5.4 release
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 16 Apr 2020 22:51:09 +0530
parents b561f3a68e41 a08bbdf839ae
children 75f6491b66a7
comparison
equal deleted inserted replaced
44692:539490756a72 44729:26ce8e751503
190 # recompute common and missingheads as if -r<rev> had been given for 190 # recompute common and missingheads as if -r<rev> had been given for
191 # each head of missing, and --base <rev> for each head of the proper 191 # each head of missing, and --base <rev> for each head of the proper
192 # ancestors of missing 192 # ancestors of missing
193 og._computecommonmissing() 193 og._computecommonmissing()
194 cl = repo.changelog 194 cl = repo.changelog
195 missingrevs = set(cl.rev(n) for n in og._missing) 195 missingrevs = {cl.rev(n) for n in og._missing}
196 og._common = set(cl.ancestors(missingrevs)) - missingrevs 196 og._common = set(cl.ancestors(missingrevs)) - missingrevs
197 commonheads = set(og.commonheads) 197 commonheads = set(og.commonheads)
198 og.missingheads = [h for h in og.missingheads if h not in commonheads] 198 og.missingheads = [h for h in og.missingheads if h not in commonheads]
199 199
200 return og 200 return og
266 headssum[branch] = items + ([],) 266 headssum[branch] = items + ([],)
267 267
268 # If there are no obsstore, no post processing are needed. 268 # If there are no obsstore, no post processing are needed.
269 if repo.obsstore: 269 if repo.obsstore:
270 torev = repo.changelog.rev 270 torev = repo.changelog.rev
271 futureheads = set(torev(h) for h in outgoing.missingheads) 271 futureheads = {torev(h) for h in outgoing.missingheads}
272 futureheads |= set(torev(h) for h in outgoing.commonheads) 272 futureheads |= {torev(h) for h in outgoing.commonheads}
273 allfuturecommon = repo.changelog.ancestors(futureheads, inclusive=True) 273 allfuturecommon = repo.changelog.ancestors(futureheads, inclusive=True)
274 for branch, heads in sorted(pycompat.iteritems(headssum)): 274 for branch, heads in sorted(pycompat.iteritems(headssum)):
275 remoteheads, newheads, unsyncedheads, placeholder = heads 275 remoteheads, newheads, unsyncedheads, placeholder = heads
276 result = _postprocessobsolete(pushop, allfuturecommon, newheads) 276 result = _postprocessobsolete(pushop, allfuturecommon, newheads)
277 headssum[branch] = ( 277 headssum[branch] = (
450 if dhs: 450 if dhs:
451 if errormsg is None: 451 if errormsg is None:
452 if branch not in (b'default', None): 452 if branch not in (b'default', None):
453 errormsg = _( 453 errormsg = _(
454 b"push creates new remote head %s on branch '%s'!" 454 b"push creates new remote head %s on branch '%s'!"
455 ) % (short(dhs[0]), branch) 455 ) % (short(dhs[0]), branch,)
456 elif repo[dhs[0]].bookmarks(): 456 elif repo[dhs[0]].bookmarks():
457 errormsg = _( 457 errormsg = _(
458 b"push creates new remote head %s " 458 b"push creates new remote head %s "
459 b"with bookmark '%s'!" 459 b"with bookmark '%s'!"
460 ) % (short(dhs[0]), repo[dhs[0]].bookmarks()[0]) 460 ) % (short(dhs[0]), repo[dhs[0]].bookmarks()[0])