mercurial/discovery.py
changeset 32672 315d74d0f059
parent 32671 81cbfaea1e0f
child 32673 bd966b9f3274
equal deleted inserted replaced
32671:81cbfaea1e0f 32672:315d74d0f059
   233                                  for branch, heads in headssum.iteritems()
   233                                  for branch, heads in headssum.iteritems()
   234                                  if heads[0] is not None)
   234                                  if heads[0] is not None)
   235     newmap.update(repo, (ctx.rev() for ctx in missingctx))
   235     newmap.update(repo, (ctx.rev() for ctx in missingctx))
   236     for branch, newheads in newmap.iteritems():
   236     for branch, newheads in newmap.iteritems():
   237         headssum[branch][1][:] = newheads
   237         headssum[branch][1][:] = newheads
       
   238     for branch, items in headssum.iteritems():
       
   239         for l in items:
       
   240             if l is not None:
       
   241                 l.sort()
   238     return headssum
   242     return headssum
   239 
   243 
   240 def _oldheadssummary(repo, remoteheads, outgoing, inc=False):
   244 def _oldheadssummary(repo, remoteheads, outgoing, inc=False):
   241     """Compute branchmapsummary for repo without branchmap support"""
   245     """Compute branchmapsummary for repo without branchmap support"""
   242 
   246 
   243     # 1-4b. old servers: Check for new topological heads.
   247     # 1-4b. old servers: Check for new topological heads.
   244     # Construct {old,new}map with branch = None (topological branch).
   248     # Construct {old,new}map with branch = None (topological branch).
   245     # (code based on update)
   249     # (code based on update)
   246     knownnode = repo.changelog.hasnode # no nodemap until it is filtered
   250     knownnode = repo.changelog.hasnode # no nodemap until it is filtered
   247     oldheads = list(h for h in remoteheads if knownnode(h))
   251     oldheads = sorted(h for h in remoteheads if knownnode(h))
   248     # all nodes in outgoing.missing are children of either:
   252     # all nodes in outgoing.missing are children of either:
   249     # - an element of oldheads
   253     # - an element of oldheads
   250     # - another element of outgoing.missing
   254     # - another element of outgoing.missing
   251     # - nullrev
   255     # - nullrev
   252     # This explains why the new head are very simple to compute.
   256     # This explains why the new head are very simple to compute.
   253     r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
   257     r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
   254     newheads = list(c.node() for c in r)
   258     newheads = sorted(c.node() for c in r)
   255     # set some unsynced head to issue the "unsynced changes" warning
   259     # set some unsynced head to issue the "unsynced changes" warning
   256     if inc:
   260     if inc:
   257         unsynced = [None]
   261         unsynced = [None]
   258     else:
   262     else:
   259         unsynced = []
   263         unsynced = []