Allow Mirage to connect to the perforce source control provider even if it was not specified in the config file or command line.

#rb PJ.Kack
#rnx
#preflight 60fff7d57f21c90001f9399d

- When we check the source control provider name, we will now attempt to set it to "Perforce" if it is current the default "None" provider.
- If the user has specified a different source control provider than "Perforce" we will give a fatal error that the content virtualization graph containing the source control backend will not work with that setup.
- This part of the workflow might need to change in the future or at least the Mirage documentation must make very clear that when using source control as the persistent storage backend that a connection to perforce will be required, at least until we support our source control solutions but even then the connect to that provider will be required.

[CL 16968160 by paul chipchase in ue5-main branch]
This commit is contained in:
paul chipchase
2021-07-27 09:45:11 -04:00
parent 4b0ce4617a
commit d0ded2296f
2 changed files with 12 additions and 13 deletions

View File

@@ -48,25 +48,24 @@ public:
return false;
}
const ISourceControlModule& SSCModule = ISourceControlModule::Get();
// We require source control the be enabled
if (!SSCModule.IsEnabled())
{
UE_LOG(LogVirtualization, Error, TEXT("Attempting to initialize FSourceControlBackend but source control is disabled!"));
return false;
}
ISourceControlProvider& SCCProvider = SSCModule.GetProvider();
ISourceControlModule& SSCModule = ISourceControlModule::Get();
// We require perforce as the source control provider as it is currently the only one that has the virtualization functionality implemented
const FName SourceControlName = SCCProvider.GetName();
if (SourceControlName != FName("Perforce"))
const FName SourceControlName = SSCModule.GetProvider().GetName();
if (SourceControlName.IsNone())
{
// No source control provider is set so we can try to set it to "Perforce"
// Note this call will fatal error if "Perforce" is not a valid option
SSCModule.SetProvider(FName("Perforce"));
}
else if (SourceControlName != TEXT("Perforce"))
{
UE_LOG(LogVirtualization, Error, TEXT("Attempting to initialize FSourceControlBackend but source control is '%s' and only Perforce is currently supported!"), *SourceControlName.ToString());
return false;
}
ISourceControlProvider& SCCProvider = SSCModule.GetProvider();
if (!SCCProvider.IsAvailable())
{
SCCProvider.Init();