mercurial/discovery.py
changeset 19840 b00ba31313c3
parent 18382 f3b21beb9802
child 19934 bfc6ed892349
equal deleted inserted replaced
19839:a32ef044b99a 19840:b00ba31313c3
   267     unsynced = False
   267     unsynced = False
   268     allmissing = set(outgoing.missing)
   268     allmissing = set(outgoing.missing)
   269     allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
   269     allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
   270     allfuturecommon.update(allmissing)
   270     allfuturecommon.update(allmissing)
   271     for branch, heads in sorted(headssum.iteritems()):
   271     for branch, heads in sorted(headssum.iteritems()):
   272         if heads[0] is None:
       
   273             # Maybe we should abort if we push more that one head
       
   274             # for new branches ?
       
   275             continue
       
   276         candidate_newhs = set(heads[1])
   272         candidate_newhs = set(heads[1])
   277         # add unsynced data
   273         # add unsynced data
   278         oldhs = set(heads[0])
   274         if heads[0] is None:
       
   275             oldhs = set()
       
   276         else:
       
   277             oldhs = set(heads[0])
   279         oldhs.update(heads[2])
   278         oldhs.update(heads[2])
   280         candidate_newhs.update(heads[2])
   279         candidate_newhs.update(heads[2])
   281         dhs = None
   280         dhs = None
   282         discardedheads = set()
   281         discardedheads = set()
   283         if repo.obsstore:
   282         if repo.obsstore:
   308                         newhs.add(nh)
   307                         newhs.add(nh)
   309         else:
   308         else:
   310             newhs = candidate_newhs
   309             newhs = candidate_newhs
   311         if [h for h in heads[2] if h not in discardedheads]:
   310         if [h for h in heads[2] if h not in discardedheads]:
   312             unsynced = True
   311             unsynced = True
   313         if len(newhs) > len(oldhs):
   312         if heads[0] is None:
       
   313             if 1 < len(newhs):
       
   314                 dhs = list(newhs)
       
   315                 if error is None:
       
   316                     error = (_("push creates multiple headed new branch '%s'")
       
   317                              % (branch))
       
   318                     hint = _("merge or"
       
   319                              " see \"hg help push\" for detail about"
       
   320                              " pushing new heads")
       
   321         elif len(newhs) > len(oldhs):
   314             # strip updates to existing remote heads from the new heads list
   322             # strip updates to existing remote heads from the new heads list
   315             dhs = sorted(newhs - bookmarkedheads - oldhs)
   323             dhs = sorted(newhs - bookmarkedheads - oldhs)
   316         if dhs:
   324         if dhs:
   317             if error is None:
   325             if error is None:
   318                 if branch not in ('default', None):
   326                 if branch not in ('default', None):