Mercurial > public > mercurial-scm > hg
comparison mercurial/exchange.py @ 25480:d410336fdb3c
push: make pushkey part advisory
The current behavior (with bundle1) is to let the rest of the push succeed if
the pushkey call (phases, bookmarks) failed (this comes from the fact that each
item is sent in its own command).
We kept this behavior with bundle2, which is highly debatable, but let us keep
thing as they are now as a start. We are about to enforce 'mandatory' pushkey
part as 'mandatory' successful, so we need to marks parts as advisory to
preserve the current (debatable) behavior.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 27 May 2015 05:35:00 -0700 |
parents | f00a63a43c4b |
children | 8182163ae983 |
comparison
equal
deleted
inserted
replaced
25479:f00a63a43c4b | 25480:d410336fdb3c |
---|---|
521 return | 521 return |
522 pushop.stepsdone.add('phases') | 522 pushop.stepsdone.add('phases') |
523 part2node = [] | 523 part2node = [] |
524 enc = pushkey.encode | 524 enc = pushkey.encode |
525 for newremotehead in pushop.outdatedphases: | 525 for newremotehead in pushop.outdatedphases: |
526 part = bundler.newpart('pushkey') | 526 part = bundler.newpart('pushkey', mandatory=False) |
527 part.addparam('namespace', enc('phases')) | 527 part.addparam('namespace', enc('phases')) |
528 part.addparam('key', enc(newremotehead.hex())) | 528 part.addparam('key', enc(newremotehead.hex())) |
529 part.addparam('old', enc(str(phases.draft))) | 529 part.addparam('old', enc(str(phases.draft))) |
530 part.addparam('new', enc(str(phases.public))) | 530 part.addparam('new', enc(str(phases.public))) |
531 part2node.append((part.id, newremotehead)) | 531 part2node.append((part.id, newremotehead)) |
565 return | 565 return |
566 pushop.stepsdone.add('bookmarks') | 566 pushop.stepsdone.add('bookmarks') |
567 part2book = [] | 567 part2book = [] |
568 enc = pushkey.encode | 568 enc = pushkey.encode |
569 for book, old, new in pushop.outbookmarks: | 569 for book, old, new in pushop.outbookmarks: |
570 part = bundler.newpart('pushkey') | 570 part = bundler.newpart('pushkey', mandatory=False) |
571 part.addparam('namespace', enc('bookmarks')) | 571 part.addparam('namespace', enc('bookmarks')) |
572 part.addparam('key', enc(book)) | 572 part.addparam('key', enc(book)) |
573 part.addparam('old', enc(old)) | 573 part.addparam('old', enc(old)) |
574 part.addparam('new', enc(new)) | 574 part.addparam('new', enc(new)) |
575 action = 'update' | 575 action = 'update' |