mercurial/discovery.py
branchstable
changeset 44729 26ce8e751503
parent 44667 b561f3a68e41
parent 44470 a08bbdf839ae
child 45142 75f6491b66a7
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])