Skip to content

Commit

Permalink
Support for #39
Browse files Browse the repository at this point in the history
Add 2024.1 support for Open in P4V using p4vc workspacewindow

Option must be enabled in settings page
  • Loading branch information
SimpsonGSD committed Apr 5, 2024
1 parent d92722f commit 3a39f43
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
11 changes: 10 additions & 1 deletion P4EditVS/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,16 @@ private void ExecuteCommand(SelectedFile selectedFile, int commandId, bool immed
case OpenInP4VCommandId:
case CtxtOpenInP4VCommandId:
{
commandline = string.Format("p4v {0} -s \"{1}\"", globalOptions, filePath);
if (_package.GetUseP4V2024_1_OpenInP4V())
{
// P4V 2024.1 (2024.1/2573667) (2024/03/18) contains a breaking change (See #119251 (Change #2555854) at https://www.perforce.com/perforce/doc.current/user/p4vnotes.txt)
// that makes p4v -s no longer function. Instead we must call p4vc with workspacewindow.
commandline = string.Format("p4vc {0} workspacewindow -s \"{1}\"", globalOptions, filePath);
}
else
{
commandline = string.Format("p4v {0} -s \"{1}\"", globalOptions, filePath);
}
handler = CreateCommandRunnerResultHandler(GetBriefCommandDescription(commandId, filePath));
waitForResult = false; // We want to spawn the process and leave it running so we never want to wait for it to finish
}
Expand Down
16 changes: 16 additions & 0 deletions P4EditVS/P4EditVS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ public bool GetUseReadOnlyFlag()
return GetOptionsPage().UseReadOnlyFlag;
}

public bool GetUseP4V2024_1_OpenInP4V()
{
return GetOptionsPage().UseP4V2024_1_OpenInP4V;
}


#region Visual Studio suo interface

Expand Down Expand Up @@ -797,6 +802,17 @@ public bool UseReadOnlyFlag
set { _useReadOnlyFlag = value; }
}

private bool _useP4V2024_1_OpenInP4V = false;

[Category("Options")]
[DisplayName("P4V 2024.1 Open in P4V Support")]
[Description("P4V 2024.1 has a breaking change for Open in P4V. If you see a dialog telling you to run p4vc workspace window then enable this option to use the new method.")]
public bool UseP4V2024_1_OpenInP4V
{
get { return _useP4V2024_1_OpenInP4V; }
set { _useP4V2024_1_OpenInP4V = value; }
}

private string _userName = "";
private string _clientName = "";
private string _server = "";
Expand Down

0 comments on commit 3a39f43

Please sign in to comment.