/** Whether a conflict is a replace conflict: a binary file or subrepo pin changed two ways, with no markers to edit. */
22
export function isReplaceConflict(c: ConflictInfo): boolean {
23
return c.kind === "replace" && !!c.path;
24
}
25
26
/**
27
* The choices for a replace conflict. A file offers each side (the version
28
* the side's change made); a subrepo pin offers the pin the nested
29
* repository holds now, since oxy settles a pin with what the working copy
30
* holds there, or opening it to move it first. `subjects` maps a side's
31
* ChangeId to its subject line, where known.
32
*/
33
export function replaceChoices(c: ConflictInfo, subrepo: boolean, subjects: Map<string, string> = new Map()): SettleChoice[] {
34
if (subrepo) {
35
return [
36
{ label: "$(check) Keep the pin the subrepo holds now", description: c.path, detail: "Settles the pin conflict with the nested repository's current state (oxy resolve)", action: "keep-current" },
37
{ label: "$(folder-opened) Open the subrepo to move it first", detail: "Check out the side you want inside it, then come back and keep that pin", action: "open-subrepo" },
detail: `The version change ${id.slice(0, 8)} made replaces every other`,
44
action: "keep-side",
45
change: id,
46
}));
47
return [
48
...sides,
49
{ label: "$(edit) Keep what the working copy holds now", description: c.path, detail: "Settles with the file as it is on disk; its .oxy-conflict-N candidates are removed (oxy resolve)", action: "keep-current" },
50
];
51
}
52
53
/** The `.oxy-conflict-N` candidates of `path` among a directory's entries (names, not paths). */
54
export function candidatesOf(name: string, entries: string[]): string[] {
"The withdrawal is signed with your key and kept beside the tag's creation, and oxy push sends it to remotes that have the tag. It is logged, not erased, and the name can never be used again.",
64
};
65
}
66
67
/** One line saying what `oxy resolve --both` did. */