resolveConflict

tcmts.studio.resolveConflict · #fuvfrlth · term · runs on the server

uses tcmts.studio.editableCodebase, which uses tcmts.share.servedCodebase, which uses process

Settle the conflicted name name by keeping one of its definitions, as tcm resolve does: ours or theirs (the sides of the merge that made it), or a definition's hash. What uses the others is re-derived against it. What it said.

import { editableCodebase, runTcm, tcmSaid } from "#codebase/tcmts/studio";

export async function resolveConflict(name: string, keep: string): Promise<string> {
  const cb = editableCodebase();
  const which = keep === "ours" || keep === "theirs" ? `--${keep}` : `#${keep.replace(/^#/, "")}`;
  return tcmSaid(
    await runTcm(cb.lay.root, ["resolve", name, which], { branch: true }),
    `tcm resolve ${name}`,
  );
}

uses

used by