diff --git a/client/web-sveltekit/src/lib/repo/HistoryPanel.gql b/client/web-sveltekit/src/lib/repo/HistoryPanel.gql index 9c5a69ebf984..5e2e40eca7e7 100644 --- a/client/web-sveltekit/src/lib/repo/HistoryPanel.gql +++ b/client/web-sveltekit/src/lib/repo/HistoryPanel.gql @@ -11,6 +11,10 @@ fragment HistoryPanel_HistoryConnection on GitCommitConnection { ...Avatar_Person } } + perforceChangelist { + cid + canonicalURL + } canonicalURL } pageInfo { diff --git a/client/web-sveltekit/src/lib/repo/HistoryPanel.svelte b/client/web-sveltekit/src/lib/repo/HistoryPanel.svelte index 61e0a457da3f..faa849ae8537 100644 --- a/client/web-sveltekit/src/lib/repo/HistoryPanel.svelte +++ b/client/web-sveltekit/src/lib/repo/HistoryPanel.svelte @@ -61,13 +61,17 @@ {#each $history.data as commit (commit.id)} {@const selected = commit.abbreviatedOID === selectedRev || commit.oid === selectedRev} + {@const isPerforceDepot = commit.perforceChangelist !== null} + {@const revURL = isPerforceDepot ? commit.perforceChangelist?.canonicalURL : commit.canonicalURL} + {@const revID = isPerforceDepot ? commit.perforceChangelist?.cid : commit.abbreviatedOID} + - {commit.abbreviatedOID} + {revID} {#if enableInlineDiff} - {commit.subject} + {commit.subject} {:else} {commit.subject} {/if} @@ -78,7 +82,7 @@ - {#if enableViewAtCommit} + {#if enableViewAtCommit && !isPerforceDepot} diff --git a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/+page.ts b/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/+page.ts index 3514d1d6d075..bba78e78e45b 100644 --- a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/+page.ts +++ b/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/+page.ts @@ -46,7 +46,11 @@ async function loadDiffView({ params, url }: PageLoadEvent) { revspec: revisionOverride, path: filePath, }) - .then(mapOrThrow(result => result.data?.repository?.commit ?? null)), + .then( + mapOrThrow( + result => result.data?.repository?.changelist?.commit ?? result.data?.repository?.commit ?? null + ) + ), } } diff --git a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/page.gql b/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/page.gql index dd5827fd627f..5df000d0130a 100644 --- a/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/page.gql +++ b/client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/page.gql @@ -1,6 +1,21 @@ query BlobDiffViewCommitQuery($repoName: String!, $revspec: String!, $path: String!) { repository(name: $repoName) { id + changelist(cid: $revspec) { + commit { + id + perforceChangelist { + cid + canonicalURL + } + + blob(path: $path) { + ...DiffViewGitBlob + } + + ...DiffViewCommit + } + } commit(rev: $revspec) { id perforceChangelist {