mercurial/discovery.py
changeset 20398 2bc520bd0ce0
parent 20381 fff0a71f8177
child 20403 47f25736d006
equal deleted inserted replaced
20397:d7e78e6d97bd 20398:2bc520bd0ce0
   266 
   266 
   267     # 3. Check for new heads.
   267     # 3. Check for new heads.
   268     # If there are more heads after the push than before, a suitable
   268     # If there are more heads after the push than before, a suitable
   269     # error message, depending on unsynced status, is displayed.
   269     # error message, depending on unsynced status, is displayed.
   270     error = None
   270     error = None
   271     unsynced = False
       
   272     allmissing = set(outgoing.missing)
   271     allmissing = set(outgoing.missing)
   273     allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
   272     allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
   274     allfuturecommon.update(allmissing)
   273     allfuturecommon.update(allmissing)
   275     for branch, heads in sorted(headssum.iteritems()):
   274     for branch, heads in sorted(headssum.iteritems()):
   276         remoteheads, newheads, unsyncedheads = heads
   275         remoteheads, newheads, unsyncedheads = heads
   310                             break
   309                             break
   311                     else:
   310                     else:
   312                         newhs.add(nh)
   311                         newhs.add(nh)
   313         else:
   312         else:
   314             newhs = candidate_newhs
   313             newhs = candidate_newhs
   315         if [h for h in unsyncedheads if h not in discardedheads]:
   314         unsynced = sorted(h for h in unsyncedheads if h not in discardedheads)
   316             unsynced = True
   315         if unsynced:
       
   316             heads = ' '.join(short(h) for h in unsynced)
       
   317             if branch is None:
       
   318                 repo.ui.warn(_("remote has heads that are not known locally: "
       
   319                                "%s\n") % heads)
       
   320             else:
       
   321                 repo.ui.warn(_("remote has heads on branch '%s' that are "
       
   322                                "not known locally: %s\n") % (branch, heads))
   317         if remoteheads is None:
   323         if remoteheads is None:
   318             if len(newhs) > 1:
   324             if len(newhs) > 1:
   319                 dhs = list(newhs)
   325                 dhs = list(newhs)
   320                 if error is None:
   326                 if error is None:
   321                     error = (_("push creates new branch '%s' "
   327                     error = (_("push creates new branch '%s' "
   348                 repo.ui.note(_("new remote heads on branch '%s':\n") % branch)
   354                 repo.ui.note(_("new remote heads on branch '%s':\n") % branch)
   349             for h in dhs:
   355             for h in dhs:
   350                 repo.ui.note((" %s\n") % short(h))
   356                 repo.ui.note((" %s\n") % short(h))
   351     if error:
   357     if error:
   352         raise util.Abort(error, hint=hint)
   358         raise util.Abort(error, hint=hint)
   353 
       
   354     # 6. Check for unsynced changes on involved branches.
       
   355     if unsynced:
       
   356         repo.ui.warn(_("note: unsynced remote changes!\n"))