You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb Sebastien.Lussier
#rnx
#preflight 611e457e2c1f1c0001292a29
### ISourceControlProvider / PerforceSourceControlProvider
- Add new method ::SwitchWorkspace allowing the caller to switch the current workspace.
- Currently only implemented for perforce.
- Calling this will cause the provider to close and then re-open it's connection and so will invalidate any existing established connection or cached states. Due to this the method will fail if there are outstanding commands being processed.
- It is intended that this is only used for short periods of time, in order to submit or access files from locations that the user chosen workspace might be able to access.
- The new workspace will not be saved to the source control settings. Although this could occur later if done.
### SourceControlOperations
- Add new operation **FCreateWorkspace**.
- Currently only implemented for perforce.
- The name and the root of the workspace (filepath on the client machine) must be provided in the constructor.
- Additional mappings can be provided by calling **AddNativeClientViewMapping** which expects the mapping to be in the native format of the target source control system. At some point in the future we may add a more generic, target agnostic, format.
- Add new operation **FDeleteWorkspace**.
- Currently only implemented for perforce.
- Deletes the workspace of the given name although the workspace must be in a state where it can be deleted (no files open for add/edit/delete etc) or the operation will fail.
### PerforceConnection
- Add a new method ::CreateWorkspace for creating workspaces
- Add a new extended client 'FP4CommandWithStdInputClientUser'
- We should really extend FP4ClientUser to be able to take overridden stdinput instead but that would mean adding yet another input parameter. I'd rather keep the code separate for now and then merge them together in a future refactor where the many input parameters of ::RunCommand is replaces with a struct with TOptional members.
- Added a ::GetUser method, which returns the user of the current connection without the caller needing to know if the connection is in unicode format or not.
[CL 17350788 by paul chipchase in ue5-main branch]
36 lines
1.3 KiB
C++
36 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "SourceControlOperations.h"
|
|
|
|
#include "Containers/StringView.h"
|
|
#include "ISourceControlModule.h"
|
|
#include "Misc/PathViews.h"
|
|
#include "Misc/Paths.h"
|
|
|
|
FDownloadFile::FDownloadFile(FStringView InTargetDirectory, EVerbosity InVerbosity)
|
|
: Verbosity(InVerbosity)
|
|
, TargetDirectory(InTargetDirectory)
|
|
{
|
|
FPaths::NormalizeDirectoryName(TargetDirectory);
|
|
|
|
// Due to the asynchronous nature of the source control api, it might be some time before
|
|
// the TargetDirectory is actually used. So we do a validation pass on it now to try and
|
|
// give errors close to the point that they were created. The caller is still free to try
|
|
// and use the FDownloadFile but with an invalid path it probably won't work.
|
|
FText Reason;
|
|
if (!FPaths::ValidatePath(TargetDirectory, &Reason))
|
|
{
|
|
UE_LOG(LogSourceControl, Error, TEXT("Path '%s' passed to FDownloadFile is invalid due to: %s"),
|
|
*TargetDirectory, *Reason.ToString());
|
|
}
|
|
}
|
|
|
|
FCreateWorkspace::FCreateWorkspace(FStringView InWorkspaceName, FStringView InWorkspaceRoot)
|
|
: WorkspaceName(InWorkspaceName)
|
|
{
|
|
TStringBuilder<512> AbsoluteWorkspaceName;
|
|
FPathViews::ToAbsolutePath(InWorkspaceRoot, AbsoluteWorkspaceName);
|
|
|
|
WorkspaceRoot = AbsoluteWorkspaceName.ToString();
|
|
}
|