Skip to content

Commit

Permalink
Fix view in p4v for versions 2023.2+
Browse files Browse the repository at this point in the history
p4vc.bat workspacewindow was added in p4v 2023.2/2443448, and 2024.1/2573667 deprecated p4v -s and p4v -t
  • Loading branch information
belkiss committed Jul 4, 2024
1 parent b8a4cde commit 4847278
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions NiftyPerforce/P4Operations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ internal static class P4Operations

private static bool s_p4vcHistorySupported;
private static bool s_p4vcDiffHaveSupported;
private static bool s_p4vcWorkspaceWindowSupported;

private static bool LockOp(string token)
{
Expand Down Expand Up @@ -274,6 +275,9 @@ public static bool P4VShowFile(string filename)
if (filename.Length == 0)
return false;

if (s_p4vcWorkspaceWindowSupported)
return AsyncProcess.Schedule(s_p4vcExeName!, GetUserInfoStringFull(true, Path.GetDirectoryName(filename)) + " workspacewindow -s \"" + filename + "\"", s_p4vcDir!, null, null, 0);

if (!string.IsNullOrEmpty(s_p4vDir)) // note that the cmd line also accepts -t to open P4V with a specific tab shown
return AsyncProcess.Schedule("p4v.exe", " -win 0 " + GetUserInfoStringFull(true, Path.GetDirectoryName(filename)) + " -s \"" + filename + "\"", s_p4vDir!, null, null, 0);

Expand Down Expand Up @@ -541,6 +545,10 @@ private static void DetermineSupportedFeatures()
{
bool p4vcBat = s_p4vcExeName == P4vcBatFileName;

// workspacewindow was added in p4v 2023.2/2443448, and 2024.1/2573667 deprecated p4v -s and p4v -t
s_p4vcWorkspaceWindowSupported = p4vcBat && P4VCHasCommand("workspacewindow");
Log.Info("[{0}] p4vc workspacewindow", s_p4vcWorkspaceWindowSupported ? "X" : " ");

// since p4vc.bat was introduced with 2021.1/2075061, if we have it we know we have diffhave, hence history

// diffhave was added in p4v 2020.1/1946989
Expand Down

0 comments on commit 4847278

Please sign in to comment.