Show More
@@ -422,6 +422,40 b' def _pushb2phases(pushop, bundler):' | |||||
422 | pushop.ui.warn(msg) |
|
422 | pushop.ui.warn(msg) | |
423 | return handlereply |
|
423 | return handlereply | |
424 |
|
424 | |||
|
425 | @b2partsgenerator('bookmarks') | |||
|
426 | def _pushb2bookmarks(pushop, bundler): | |||
|
427 | """handle phase push through bundle2""" | |||
|
428 | if 'bookmarks' in pushop.stepsdone: | |||
|
429 | return | |||
|
430 | b2caps = bundle2.bundle2caps(pushop.remote) | |||
|
431 | if 'b2x:pushkey' not in b2caps: | |||
|
432 | return | |||
|
433 | pushop.stepsdone.add('bookmarks') | |||
|
434 | part2book = [] | |||
|
435 | enc = pushkey.encode | |||
|
436 | for book, old, new in pushop.outbookmarks: | |||
|
437 | part = bundler.newpart('b2x:pushkey') | |||
|
438 | part.addparam('namespace', enc('bookmarks')) | |||
|
439 | part.addparam('key', enc(book)) | |||
|
440 | part.addparam('old', enc(old)) | |||
|
441 | part.addparam('new', enc(new)) | |||
|
442 | part2book.append((part.id, book)) | |||
|
443 | def handlereply(op): | |||
|
444 | for partid, book in part2book: | |||
|
445 | partrep = op.records.getreplies(partid) | |||
|
446 | results = partrep['pushkey'] | |||
|
447 | assert len(results) <= 1 | |||
|
448 | if not results: | |||
|
449 | pushop.ui.warn(_('server ignored bookmark %s update\n') % book) | |||
|
450 | else: | |||
|
451 | ret = int(results[0]['return']) | |||
|
452 | if ret: | |||
|
453 | pushop.ui.status(_("updating bookmark %s\n") % book) | |||
|
454 | else: | |||
|
455 | pushop.ui.warn(_('updating bookmark %s failed!\n') % book) | |||
|
456 | return handlereply | |||
|
457 | ||||
|
458 | ||||
425 | def _pushbundle2(pushop): |
|
459 | def _pushbundle2(pushop): | |
426 | """push data to the remote using bundle2 |
|
460 | """push data to the remote using bundle2 | |
427 |
|
461 |
General Comments 0
You need to be logged in to leave comments.
Login now