#rb Per.Larsson
#jira UE-160083
#rnx
#preflight 62f507c7b66d5d93139804a6
- If we are switching workspaces then we already know that the existing perforce settings are correct.
- The only reason we have to validate them is if we are switching to a different workspace and need to make sure that it exists.
- If we are just removing the workspace name entirely (which is valid for a number of operations) then we have nothing to check and we can just remove the workspace name from our p4 settings structure.
- This saves issuing a few pointless p4 commands.
[CL 21353145 by paul chipchase in ue5-main branch]
#rb Per.Larsson
#rnx
#jira UE-160619
#preflight 62f37c86b66d5d93133d67e3
- Based on work from Jess.Kube
### Virtualization
- The source control backend now takes an optional config option "ClientStream" which takes the name of the client stream to use.
- If a client stream is set then workspaces created for payload submission will use that and not provide a client-view mapping.
#ushell-cherrypick of 21195584 by Jess.Kube
### PerforceSourceControl
- Allow FCreateWorkspace to create workspaces with streams as well as classic workspaces cia FCreateWorkspace::SetStream.
- Add a method FCreateWorkspace::ClearClientViewMappings which will clear any client view mappings already added to the operation.
- If we detect that a FCreateWorkspace operation has both a stream set and client view mappings set then FPerforceCreateWorkspaceWorker will return an error. Perforce will allow us to creat a client spec with both entries, but will default to using the stream. Technically we could allow this too but it might cause unexpected behaviour to the caller. It is better to give a clear error and fail the workspace creation.
[CL 21316756 by paul chipchase in ue5-main branch]
#rb Sebastian.Nordgren
#rnx
#jira UE-158934
#preflight 62c829272823f28cf273a5aa
### Perforce Connection
- The test for bRequireWorkspace was inverted, we only want to require a workspace if the workspace is NOT optional.
- Combined the two if statements checking if we should try and auto assign a workspace to reduce indentation.
- Changed use of Len() == 0 to IsEmpty() for consistency
- Do not take the workspace name from the default environment if bRequireWorkspace is false
### PerforceSourceControlProvider
- When switching workspaces use EConnectionOptions::WorkspaceOptional when establishing the connection since we are providing the workspace name.
- Remove the check, the entire point of ::EnsureValidConnection is that it can change the workspace requested.
### PerforceSourceControloOperations
- Running FConnect command with perforce does not actually connect, but rather validates the clientspec. This needed to be changed to not give an error if the clientspec is empty.
- I'd rather allow FConnect to work for connections without a clientspec rather than avoid calling it at a higher level in case a different source control provider would require FConnect to be called at this point. Not calling it requires too much knowledge of the target source control provider to be safe.
### Future Work
- Currently the optional workspace flag is used to indicate that the workspace is being set for the connection manually and we don't want to auto evalute the workspace name. However we are really confusing two different issues here 1) having no client 2) having a specific client. In the second case we might want to allow defaulting to a valid workspace. So overall it would be better to have a flag indicating that it is okay to have no clientspec name and another flag indicating that we want to fallback to a valid name if the one we provided was not valid.
[CL 21008487 by paul chipchase in ue5-main branch]
#rb Trivial
#jira UE-155232 - Capture/Profile performance data for P4.
#preflight 62b1e14c405a18a061f2d594
[CL 20758715 by Patrick Laflamme in ue5-main branch]
#rb trivial
#rnx
#preflight 626f823667326112684d0c24
- Because the commands do not return data in tagged format it was being written directly to stdout, this would cause odd log messages stating that a workspace had been create/deleted that would be displayed outside of our normal logging format.
[CL 20006887 by paul chipchase in ue5-main branch]
#rb martin.ridgers, wouter.burgers
#rnx
#preflight 626be80153253f874bcbee3c
- Some commands do not return tagged output even when we set that as our preference and will print the output to stdout as we are not currently collecting the standard output messages.
-- We could collect this output and return as info to the caller but that would involve adding more parameters which I am loath to do at the moment. At some point I plan to replace all of the FPerforceConnection::Run input and output parameters with single data structures and unify the different connection types at which point adding support for returning all info output would make sense.
- To supress this output we would normally pass -q as a global-opt for the command, which in the case of the cpp API requires us to call ::SetQuiet on the client users but for that we need to be able to pass in the request to FPerforceConnection::Run.
-- Note that calling ::SetQuiet is pretty much the same as overriding ClientUser::OuputInfo
- At this point we had two bool parameters in ::Run already, so when adding a third we might as well convert this to a bitfield of flags.
- It seems that the former parameter bInAllowRetry was never hooked to anything since the last large source conde API refactor near a decade a go, so that could just be removed.
- I felt that the former parameter 'bInStandardDebugOutput' was not clearly named, in the end if it was true we would log the full p4 command (and timing of the command in VeryVerbose mode) and in almost all cases this was set to true. So I flipped the flag so it is not set to opt out of logging a command.
- I removed one overload of FPerforceConnection::Run by setting the flags to have a default value. This should help discourage anyone from adding more parameters to the method.
[CL 20006796 by paul chipchase in ue5-main branch]
#rb trivial
#rnx
#preflight 6256abb45f20a0a34d9d62e9
- This way of invoking an operation was missing a call to FPerforceSourceControlCommand::ReturnResults which will pass the info/error messages from the command to the operation that the caller passed into the provider in the first place.
- This will allow the caller to gain access to any messages generated during the operation.
[CL 19737642 by paul chipchase in ue5-main branch]