654 droots = pushop.remotephases.draft_roots |
655 droots = pushop.remotephases.draft_roots |
655 |
656 |
656 extracond = b'' |
657 extracond = b'' |
657 if not pushop.remotephases.publishing: |
658 if not pushop.remotephases.publishing: |
658 extracond = b' and public()' |
659 extracond = b' and public()' |
659 revset = b'heads((%%ld::%%ln) %s)' % extracond |
660 revset = b'heads((%%ld::%%ld) %s)' % extracond |
660 # Get the list of all revs draft on remote by public here. |
661 # Get the list of all revs draft on remote by public here. |
661 # XXX Beware that revset break if droots is not strictly |
662 # XXX Beware that revset break if droots is not strictly |
662 # XXX root we may want to ensure it is but it is costly |
663 # XXX root we may want to ensure it is but it is costly |
663 fallback = list(unfi.set(revset, droots, pushop.fallbackheads)) |
664 fallback = list(unfi.set(revset, droots, fallbackheads_rev)) |
664 if not pushop.remotephases.publishing and pushop.publish: |
665 if not pushop.remotephases.publishing and pushop.publish: |
665 future = list( |
666 future = list( |
666 unfi.set( |
667 unfi.set( |
667 b'%ln and (not public() or %ld::)', pushop.futureheads, droots |
668 b'%ld and (not public() or %ld::)', futureheads_rev, droots |
668 ) |
669 ) |
669 ) |
670 ) |
670 elif not outgoing.missing: |
671 elif not outgoing.missing: |
671 future = fallback |
672 future = fallback |
672 else: |
673 else: |
673 # adds changeset we are going to push as draft |
674 # adds changeset we are going to push as draft |
674 # |
675 # |
675 # should not be necessary for publishing server, but because of an |
676 # should not be necessary for publishing server, but because of an |
676 # issue fixed in xxxxx we have to do it anyway. |
677 # issue fixed in xxxxx we have to do it anyway. |
677 fdroots = list( |
678 missing_rev = [to_rev(n) for n in outgoing.missing] |
678 unfi.set(b'roots(%ln + %ld::)', outgoing.missing, droots) |
679 fdroots = list(unfi.set(b'roots(%ld + %ld::)', missing_rev, droots)) |
679 ) |
|
680 fdroots = [f.rev() for f in fdroots] |
680 fdroots = [f.rev() for f in fdroots] |
681 future = list(unfi.set(revset, fdroots, pushop.futureheads)) |
681 future = list(unfi.set(revset, fdroots, futureheads_rev)) |
682 pushop.outdatedphases = future |
682 pushop.outdatedphases = future |
683 pushop.fallbackoutdatedphases = fallback |
683 pushop.fallbackoutdatedphases = fallback |
684 |
684 |
685 |
685 |
686 @pushdiscovery(b'obsmarker') |
686 @pushdiscovery(b'obsmarker') |