Add option to use Visual Studio built-in diff for Diff Against Have Revision#44
Open
rtsummit wants to merge 2 commits into
Open
Add option to use Visual Studio built-in diff for Diff Against Have Revision#44rtsummit wants to merge 2 commits into
rtsummit wants to merge 2 commits into
Conversation
Adds a "Use Visual Studio Diff" option (default on) that runs `p4 print` to fetch the have revision into a temp file, then opens the comparison in VS via IVsDifferenceService.OpenComparisonWindow2 instead of launching p4vc diffhave in P4V. Temp files are tracked in a static list and deleted on package Dispose, so they don't accumulate across the session. Users who prefer the existing P4VC diff window can turn the option off in Tools > Options > P4EditVS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The hosted windows-2019 image has been deprecated, causing the pipeline to fail with "No image label found to route agent pool" before the build even starts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use Visual Studio Diffoption (Tools > Options > P4EditVS, default on) that opens "Diff Against Have Revision" inside Visual Studio usingIVsDifferenceServiceinstead of launchingp4vc diffhavein P4V.p4 print -q -o <temp>into%TEMP%\P4EditVS_<guid>_have<ext>, preserving the file extension so VS picks the right content type.p4vc diffhavebehaviour is preserved — flip the option off to restore it.Why
Keeps diff inside the IDE so the workflow doesn't break to switch focus to P4V. The original
p4vc diffhavepath is unchanged behind the toggle for users who prefer it.Implementation notes
VSDIFFOPT_LeftFileIsTemporaryalone does not reliably remove the temp file, and per-frame close hooks race with the diff editor still holding the file handle. Temp paths are instead tracked in a static list and cleaned up onP4EditVS.Dispose.Runner/ OutputWindow / status bar conventions are reused —p4 printfailures show up in the P4EditVS output pane and as a status bar failure, identical to other commands.IVsDifferenceService/SVsDifferenceServiceare present in both the VS2019 and VS2022 SDKs used by this project).Test plan
<filename>#haveon the left and the workspace file on the right.%TEMP%\P4EditVS_*files are removed.p4vc diffhavecodepath runs unchanged (note:p4vc diffhavebehaviour itself is outside the scope of this PR).p4 printfailure (e.g. file with no have revision) surfaces in the P4EditVS output pane and as a status bar failure — needs verification.🤖 Generated with Claude Code