##// END OF EJS Templates
push: move obsolescence marker exchange in the exchange module...
Pierre-Yves David -
r20432:1b926f0b default
parent child Browse files
Show More
@@ -247,7 +247,7 b' def push(repo, remote, force=False, revs'
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()
@@ -258,6 +258,22 b' def push(repo, remote, force=False, revs'
258 _pushbookmark(pushop)
258 _pushbookmark(pushop)
259 return ret
259 return ret
260
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)
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
@@ -384,22 +384,6 b' def pushmarker(repo, key, old, new):'
384 finally:
384 finally:
385 lock.release()
385 lock.release()
386
386
387 def syncpush(repo, remote):
388 """utility function to push obsolete markers to a remote
389
390 Exist mostly to allow overriding for experimentation purpose"""
391 if (_enabled and repo.obsstore and
392 'obsolete' in remote.listkeys('namespaces')):
393 rslts = []
394 remotedata = repo.listkeys('obsolete')
395 for key in sorted(remotedata, reverse=True):
396 # reverse sort to ensure we end with dump0
397 data = remotedata[key]
398 rslts.append(remote.pushkey('obsolete', key, '', data))
399 if [r for r in rslts if not r]:
400 msg = _('failed to push some obsolete markers!\n')
401 repo.ui.warn(msg)
402
403 def syncpull(repo, remote, gettransaction):
387 def syncpull(repo, remote, gettransaction):
404 """utility function to pull obsolete markers from a remote
388 """utility function to pull obsolete markers from a remote
405
389
General Comments 0
You need to be logged in to leave comments. Login now