Add type for conflict hashes fetched from resolve :dumpjson

Summary:
D56850550 added `"hashes": {"local": "abc", "other": "def"}` hashes to the json output of `sl resolve --tool internal:dumpjson`. This is useful for ISL to show what's being rebased during a conflict.

If you're not yet using a version of sl that has this feature, this would be missing from the JSON, so we make these values nullable. Even if you do have this version of sl, some generated conflicts will not have these values either.

Reviewed By: zzl0

Differential Revision: D56861539

fbshipit-source-id: e35d48a80046fe6d9c7ce7ee675e8dc00ba308a8
This commit is contained in:
Evan Krause 2024-05-02 09:50:39 -07:00 committed by Facebook GitHub Bot
parent 1972cd1f1e
commit 3df6a77dd5
2 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,10 @@ export type ResolveCommandConflictOutput = [
path: string;
}>;
pathconflicts: Array<never>;
hashes?: {
local?: string;
other?: string;
};
},
];
@ -280,6 +284,7 @@ export function computeNewConflicts(
files: [],
fetchStartTimestamp,
fetchCompletedTimestamp: Date.now(),
hashes: newConflictData.hashes,
};
const previousFiles = previousConflicts?.files ?? [];

View File

@ -424,6 +424,7 @@ type ConflictInfo = {
files: Array<ChangedFile & {conflictType: ConflictType}>;
fetchStartTimestamp: number;
fetchCompletedTimestamp: number;
hashes?: {local?: string; other?: string};
};
export type MergeConflicts =
| ({state: 'loading'} & AllUndefined<ConflictInfo>)