mercurial/exchange.py
changeset 20432 1b926f0bbf8a
parent 20431 bebf8b8479f3
child 20433 6af248474224
equal deleted inserted replaced
20431:bebf8b8479f3 20432:1b926f0bbf8a
   245                                               str(phases.public))
   245                                               str(phases.public))
   246                     if not r:
   246                     if not r:
   247                         pushop.ui.warn(_('updating %s to public failed!\n')
   247                         pushop.ui.warn(_('updating %s to public failed!\n')
   248                                        % newremotehead)
   248                                        % newremotehead)
   249             pushop.ui.debug('try to push obsolete markers to remote\n')
   249             pushop.ui.debug('try to push obsolete markers to remote\n')
   250             obsolete.syncpush(pushop.repo, pushop.remote)
   250             _pushobsolete(pushop.repo, pushop.remote)
   251         finally:
   251         finally:
   252             if lock is not None:
   252             if lock is not None:
   253                 lock.release()
   253                 lock.release()
   254     finally:
   254     finally:
   255         if locallock is not None:
   255         if locallock is not None:
   256             locallock.release()
   256             locallock.release()
   257 
   257 
   258     _pushbookmark(pushop)
   258     _pushbookmark(pushop)
   259     return ret
   259     return ret
       
   260 
       
   261 def _pushobsolete(repo, remote):
       
   262     """utility function to push obsolete markers to a remote
       
   263 
       
   264     Exist mostly to allow overriding for experimentation purpose"""
       
   265     if (obsolete._enabled and repo.obsstore and
       
   266         'obsolete' in remote.listkeys('namespaces')):
       
   267         rslts = []
       
   268         remotedata = repo.listkeys('obsolete')
       
   269         for key in sorted(remotedata, reverse=True):
       
   270             # reverse sort to ensure we end with dump0
       
   271             data = remotedata[key]
       
   272             rslts.append(remote.pushkey('obsolete', key, '', data))
       
   273         if [r for r in rslts if not r]:
       
   274             msg = _('failed to push some obsolete markers!\n')
       
   275             repo.ui.warn(msg)
   260 
   276 
   261 def _pushbookmark(pushop):
   277 def _pushbookmark(pushop):
   262     """Update bookmark position on remote"""
   278     """Update bookmark position on remote"""
   263     ui = pushop.ui
   279     ui = pushop.ui
   264     repo = pushop.repo.unfiltered()
   280     repo = pushop.repo.unfiltered()