mercurial/discovery.py
changeset 26936 d47ac02fcefa
parent 26935 c4a7bbc78c74
child 29229 89bba2beb03e
equal deleted inserted replaced
26935:c4a7bbc78c74 26936:d47ac02fcefa
   236         unsynced = set([None])
   236         unsynced = set([None])
   237     else:
   237     else:
   238         unsynced = set()
   238         unsynced = set()
   239     return {None: (oldheads, newheads, unsynced)}
   239     return {None: (oldheads, newheads, unsynced)}
   240 
   240 
   241 def _nowarnheads(repo, remote, newbookmarks):
   241 def _nowarnheads(pushop):
   242     # Compute newly pushed bookmarks. We don't warn about bookmarked heads.
   242     # Compute newly pushed bookmarks. We don't warn about bookmarked heads.
       
   243 
       
   244     # internal config: bookmarks.pushing
       
   245     newbookmarks = pushop.ui.configlist('bookmarks', 'pushing')
       
   246 
       
   247     repo = pushop.repo.unfiltered()
       
   248     remote = pushop.remote
   243     localbookmarks = repo._bookmarks
   249     localbookmarks = repo._bookmarks
   244     remotebookmarks = remote.listkeys('bookmarks')
   250     remotebookmarks = remote.listkeys('bookmarks')
   245     bookmarkedheads = set()
   251     bookmarkedheads = set()
   246     for bm in localbookmarks:
   252     for bm in localbookmarks:
   247         rnode = remotebookmarks.get(bm)
   253         rnode = remotebookmarks.get(bm)
   265     remote = pushop.remote
   271     remote = pushop.remote
   266     outgoing = pushop.outgoing
   272     outgoing = pushop.outgoing
   267     remoteheads = pushop.remoteheads
   273     remoteheads = pushop.remoteheads
   268     newbranch = pushop.newbranch
   274     newbranch = pushop.newbranch
   269     inc = bool(pushop.incoming)
   275     inc = bool(pushop.incoming)
   270 
       
   271     # internal config: bookmarks.pushing
       
   272     newbookmarks = pushop.ui.configlist('bookmarks', 'pushing')
       
   273 
   276 
   274     # Check for each named branch if we're creating new remote heads.
   277     # Check for each named branch if we're creating new remote heads.
   275     # To be a remote head after push, node must be either:
   278     # To be a remote head after push, node must be either:
   276     # - unknown locally
   279     # - unknown locally
   277     # - a local outgoing head descended from update
   280     # - a local outgoing head descended from update
   294                            % branchnames,
   297                            % branchnames,
   295                          hint=_("use 'hg push --new-branch' to create"
   298                          hint=_("use 'hg push --new-branch' to create"
   296                                 " new remote branches"))
   299                                 " new remote branches"))
   297 
   300 
   298     # 2. Find heads that we need not warn about
   301     # 2. Find heads that we need not warn about
   299     nowarnheads = _nowarnheads(repo, remote, newbookmarks)
   302     nowarnheads = _nowarnheads(pushop)
   300 
   303 
   301     # 3. Check for new heads.
   304     # 3. Check for new heads.
   302     # If there are more heads after the push than before, a suitable
   305     # If there are more heads after the push than before, a suitable
   303     # error message, depending on unsynced status, is displayed.
   306     # error message, depending on unsynced status, is displayed.
   304     errormsg = None
   307     errormsg = None