comparison mercurial/exchange.py @ 20433:6af248474224

push: feed pushoperation object to _pushobsolete function This will allow the obsolete marker synchronisation to have full information on the ongoing push and pass information to other operation.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 30 Jan 2014 17:56:09 -0800
parents 1b926f0bbf8a
children e009e59e4566
comparison
equal deleted inserted replaced
20432:1b926f0bbf8a 20433:6af248474224
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 _pushobsolete(pushop.repo, pushop.remote) 250 _pushobsolete(pushop)
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 260
261 def _pushobsolete(repo, remote): 261 def _pushobsolete(pushop):
262 """utility function to push obsolete markers to a remote 262 """utility function to push obsolete markers to a remote
263 263
264 Exist mostly to allow overriding for experimentation purpose""" 264 Exist mostly to allow overriding for experimentation purpose"""
265 repo = pushop.repo
266 remote = pushop.remote
265 if (obsolete._enabled and repo.obsstore and 267 if (obsolete._enabled and repo.obsstore and
266 'obsolete' in remote.listkeys('namespaces')): 268 'obsolete' in remote.listkeys('namespaces')):
267 rslts = [] 269 rslts = []
268 remotedata = repo.listkeys('obsolete') 270 remotedata = repo.listkeys('obsolete')
269 for key in sorted(remotedata, reverse=True): 271 for key in sorted(remotedata, reverse=True):