{#if logged || checks.length || reviews.length || requested.length}
{#if !merged}{/if} {#if merged}
{`Merged as ${merged.slice(0, 7)}`}
{:else} {#if queued && queue}
{queue.said}

{landing === null ? 'A runner lands it once its batch passes its checks.' : `It ${landsIn(landing)}, once its batch passes its checks.`}

{/if} {#if status?.autoMerge} {@const a = status.autoMerge} {#if a.state === 'set'}
Merges when checks pass

{`Set by ${a.by.handle}. It merges into ${base} once its checks pass.`}

{:else}
Merge cancelled

{a.state === 'pushed' ? `${a.pushedBy?.handle ?? 'Someone'} pushed to ${head?.branch ?? 'its branch'} after ${a.by.handle} set it.${status.may.autoMerge ? ' Set it again to merge this head.' : ''}` : `It was retargeted after ${a.by.handle} set it.`}

{/if} {/if} {#if checked}{/if} {/if} {#if stack && !merged}
{`Part of a stack of ${stack.pulls.length}`}{#if under.length && !queued && status?.may.queue}

{`Add this alone and it lands on ${base}. Add all ${under.length + 1} and they land on ${stack.into ?? base} in turn, lowest first.`}

{:else if queued && status?.may.queue}

Leaving the queue takes any pull waiting for this one with it.

{/if}
{/if} {#if logged && !merged && status} {@const s = status} {#if s.state === 'conflicting'}
This branch has conflicts that must be resolved

{`Merge ${base} into ${head?.branch ?? 'its branch'}, resolve the files that conflict, commit and push.`}

{#if s.conflicts?.length}

Conflicting files

    {#each s.conflicts as c (c.path)}
  • {c.path}
  • {/each}
{/if} {#if head}
From the command line
{/if}
{:else} {#if s.reviews === 'blocked'}
Review required

{`Pulls into ${base} need these reviews before they merge.`}

    {#each s.reviewsMissing ?? [] as m (m.text)}
  • {m.text.charAt(0).toUpperCase() + m.text.slice(1)}
  • {/each}
{/if}
{`No conflicts with ${base}`}

{method(s)}

{/if} {#if draft}
This pull is still a draft

{s.may.head ? 'It cannot be merged or queued until you mark it ready for review.' : 'It cannot be merged or queued until its author marks it ready for review.'}

{#if s.may.head}{/if}
{/if} {@const first = queueFirst(s) && !draft} {@const said = next(s)}
{#if said}

{said}

{/if} {#if s.queueBlocked && !queued && s.may.force}

To use the merge queue, delegate writes to this server in your settings.

{:else if s.queueBlocked && !queued}

The merge queue is off until the owner delegates writes to this server.

{/if} {#if offer(s)}{/if} {#if set && (s.may.merge || s.may.head)}{/if} {#if s.may.merge && !s.queueOnly} {:else if !s.may.merge} Only the owner and collaborators merge it. {/if} {#if s.may.queue && !queued}{/if} {#if s.may.queue && !queued && under.length}{/if} {#if s.may.queue && queued}{/if} {#if s.may.merge && !s.queueOnly && s.deletes}{/if} {#if s.may.base || s.may.head}
{/if}
{#if s.may.base || s.may.head}
{#if s.may.base} {/if} {#if s.may.head} {/if}
{/if} {:else if logged && !merged && !problem}
Checking whether it can merge…
{/if} {#if problem}{/if}
{/if}