Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Include both the changelist and commit in the query #64501

Open
wants to merge 2 commits into
base: jhh/perforce-history-panel
Choose a base branch
from

Conversation

peterguy
Copy link
Contributor

A rather crude approach, but it works and it gives a suggestion of how to approach a solution.

@peterguy peterguy self-assigned this Aug 15, 2024
@cla-bot cla-bot bot added the cla-signed label Aug 15, 2024
.then(mapOrThrow(result => result.data?.repository?.commit ?? null)),
.then(
mapOrThrow(
result => result.data?.repository?.changelist?.commit ?? result.data?.repository?.commit ?? null
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the commit from the changelist if it exists. Otherwise, use the top-level commit. Fallback to null

Comment on lines +4 to +18
changelist(cid: $revspec) {
commit {
id
perforceChangelist {
cid
canonicalURL
}

blob(path: $path) {
...DiffViewGitBlob
}

...DiffViewCommit
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just copy/paste the commit structure into the changelist structure. One or the other will be populated, depending on the structure of revspec: if it's a CID, then changelist.commit will be populated. If it's a GH hash, then commit will be popultated.

@jasonhawkharris jasonhawkharris force-pushed the jhh/perforce-history-panel branch 7 times, most recently from 4faee50 to c6c654c Compare August 16, 2024 17:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants