releasesApart

tcmts.cli.merge.releasesApart · #u35jdge6 · term · runs anywhere

The releases branch made that into's history doesn't have: each is an entry of the branch's, so a landing squashed would leave it out, and into could neither plan the next release from it nor push it.

import type { Codebase } from "#codebase/tcmts/cli/codebase";
import type { Release } from "#codebase/tcmts/store";

export function releasesApart(cb: Codebase, branch: string, into: string): Release[] {
  const head = cb.store.head(branch);
  const target = cb.store.head(into);
  return cb.store
    .releases()
    .filter((r) => cb.store.isAncestor(r.causal, head) && !cb.store.isAncestor(r.causal, target));
}

uses

used by