Skip to content

Commit

Permalink
Remove empty lines and add spaces around equal sign to conform with c…
Browse files Browse the repository at this point in the history
…pplint
  • Loading branch information
SRombautsU committed Sep 25, 2023
1 parent 2e9b830 commit 78ba0f2
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ class FPlasticSourceControlMenu
void DisplayFailureNotification(const FName& InOperationName);

private:

/** Tracks if the menu extension has been registered with the editor or not */
bool bHasRegistered = false;

#if ENGINE_MAJOR_VERSION == 4
FDelegateHandle ViewMenuExtenderHandle;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ bool FPlasticRevertWorker::Execute(FPlasticSourceControlCommand& InCommand)
SourceControlLog.Error(FailureText);
SourceControlLog.Notify();
});

return false;
}

Expand Down Expand Up @@ -2119,15 +2119,14 @@ bool FPlasticDeleteShelveWorker::Execute(FPlasticSourceControlCommand& InCommand
if (!InCommand.Files.Contains(ShelveState->GetFilename()))
{
FString File = ShelveState->GetFilename();

// Check that all this files are is still in the corresponding changelist, else we won't be able to create the new shelve!
if (ChangelistState->Files.ContainsByPredicate([&File](FSourceControlStateRef& State) { return File == State->GetFilename(); }))
{
FilesToShelve.Add(MoveTemp(File));
}
else
{

FPaths::MakePathRelativeTo(File, *FPaths::ProjectDir());
UE_LOG(LogSourceControl, Error, TEXT("The file /%s is not in the changelist anymore, so the shelve cannot be updated. Unshelve the corresponding change and retry."), *File);
InCommand.bCommandSuccessful = false;
Expand All @@ -2141,7 +2140,7 @@ bool FPlasticDeleteShelveWorker::Execute(FPlasticSourceControlCommand& InCommand
ChangelistToUpdate = InCommand.Changelist;
FilesToRemove = InCommand.Files;
}

if (InCommand.bCommandSuccessful && FilesToShelve.Num() > 0)
{
// Create a new shelve with the other files
Expand Down Expand Up @@ -2252,11 +2251,11 @@ bool FPlasticGetChangelistDetailsWorker::Execute(FPlasticSourceControlCommand& I
{
// String representation of the current file index
FString RecordFileIndexStr = LexToString(RecordFileIndex);
// The p4 records is the map a file key starts with "depotFile" and is followed by file index
// The p4 records is the map a file key starts with "depotFile" and is followed by file index
FString RecordFileMapKey = ReviewHelpers::FileDepotKey + RecordFileIndexStr;
// The p4 records is the map a revision key starts with "rev" and is followed by file index
// The p4 records is the map a revision key starts with "rev" and is followed by file index
FString RecordRevisionMapKey = ReviewHelpers::FileRevisionKey + RecordFileIndexStr;
// The p4 records is the map a revision key starts with "action" and is followed by file index
// The p4 records is the map a revision key starts with "action" and is followed by file index
FString RecordActionMapKey = ReviewHelpers::FileActionKey + RecordFileIndexStr;

UE_LOG(LogSourceControl, Log, TEXT("GetChangelistDetails: %s baserevid:%d %s"), *Revision.Filename, Revision.RevisionId, *Revision.Action);
Expand Down Expand Up @@ -2304,11 +2303,9 @@ bool FPlasticGetFileWorker::Execute(FPlasticSourceControlCommand& InCommand)
SourceControlRevision->RevisionId = FCString::Atoi(*Operation->GetRevisionNumber());
UE_LOG(LogSourceControl, Log, TEXT("GetFile(revid:%d)"), SourceControlRevision->RevisionId);
}

FString OutFilename;

FString OutFilename;
InCommand.bCommandSuccessful = SourceControlRevision->Get(OutFilename, InCommand.Concurrency);

if (InCommand.bCommandSuccessful)
{
Operation->SetOutPackageFilename(OutFilename);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ class UPlasticSourceControlProjectSettings : public UDeveloperSettings
bool bPromptForCheckoutOnChange = true;

/** If a non-null value is set, limit the maximum number of revisions requested to Unity Version Control to display in the "History" window. */
UPROPERTY(config, EditAnywhere, Category = "Unity Version Control", meta=(ClampMin=0))
UPROPERTY(config, EditAnywhere, Category = "Unity Version Control", meta = (ClampMin = 0))
int32 LimitNumberOfRevisionsInHistory = 50;
};
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ TMap<ISourceControlProvider::EStatus, FString> FPlasticSourceControlProvider::Ge
Result.Add(EStatus::Enabled, IsEnabled() ? TEXT("Yes") : TEXT("No") );
Result.Add(EStatus::Connected, (IsEnabled() && IsAvailable()) ? TEXT("Yes") : TEXT("No") );
Result.Add(EStatus::User, UserName);

Result.Add(EStatus::ScmVersion, PlasticScmVersion.String);
Result.Add(EStatus::PluginVersion, PluginVersion);
Result.Add(EStatus::WorkspacePath, PathToWorkspaceRoot);
Expand Down Expand Up @@ -519,7 +519,7 @@ bool FPlasticSourceControlProvider::UsesFileRevisions() const
{
// This API introduced in UE5.1 is still broken as of UE5.3
// (preventing the user to use the source control context menu for checkin if returning false)
// return IsPartialWorkspace();
// return IsPartialWorkspace();
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class FPlasticSourceControlProvider : public ISourceControlProvider
#elif ENGINE_MAJOR_VERSION == 5
virtual ECommandResult::Type Execute(const FSourceControlOperationRef& InOperation, FSourceControlChangelistPtr InChangelist, const TArray<FString>& InFiles, EConcurrency::Type InConcurrency = EConcurrency::Synchronous, const FSourceControlOperationComplete& InOperationCompleteDelegate = FSourceControlOperationComplete() ) override;
#endif
virtual bool CanExecuteOperation( const FSourceControlOperationRef& InOperation ) const; /* override NOTE: added in UE5.3 */
virtual bool CanExecuteOperation(const FSourceControlOperationRef& InOperation) const; /* override NOTE: added in UE5.3 */
virtual bool CanCancelOperation(const FSourceControlOperationRef& InOperation) const override;
virtual void CancelOperation(const FSourceControlOperationRef& InOperation) override;
virtual bool UsesLocalReadOnlyState() const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static bool _StartBackgroundPlasticShell(const FString& InPathToPlasticBinary, c

#if PLATFORM_WINDOWS
ShellProcessHandle = FPlatformProcess::CreateProc(*InPathToPlasticBinary, *FullCommand, bLaunchDetached, bLaunchHidden, bLaunchReallyHidden, nullptr, 0, *InWorkingDirectory, ShellOutputPipeWrite, ShellInputPipeRead);
#else // PLATFORM_MAC or PLATFORM_LINUX
#else // PLATFORM_MAC or PLATFORM_LINUX
// Update working directory
char OriginalWorkingDirectory[PATH_MAX];
getcwd(OriginalWorkingDirectory, PATH_MAX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ bool FPlasticSourceControlState::IsSourceControlled() const
// NOTE: the Editor Collections rely on the default 'Unknown' state (until the actual file status is obtained) to be considered "in source control"
const bool bIsSourceControlled = WorkspaceState != EWorkspaceState::Private
&& WorkspaceState != EWorkspaceState::Ignored;
// WorkspaceState != EWorkspaceState::Unknown
// WorkspaceState != EWorkspaceState::Unknown

if (!bIsSourceControlled && !IsUnknown()) UE_LOG(LogSourceControl, Verbose, TEXT("%s NOT SourceControlled"), *LocalFilename);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ static EWorkspaceState StateFromStatus(const FString& InFileStatus, const bool b
{
State = EWorkspaceState::CheckedOutChanged; // Older version; need to assume it is changed to retain behavior
}

}
else if (InFileStatus == "CO+CH") // Checked-Out and changed from the new --iscochanged
{
Expand Down Expand Up @@ -444,7 +443,7 @@ static void ParseFileStatusResult(TArray<FString>&& InFiles, const TArray<FStrin
const FString& WorkspaceRoot = Provider.GetPathToWorkspaceRoot();
const bool bUsesCheckedOutChanged = Provider.GetPlasticScmVersion() >= PlasticSourceControlVersions::StatusIsCheckedOutChanged;

// Parse the list of status results in a map indexed by absolute filename
// Parse the list of status results in a map indexed by absolute filename
TMap<FString, FPlasticSourceControlState> FileToStateMap;
FileToStateMap.Reserve(InResults.Num());
for (const FString& InResult : InResults)
Expand Down Expand Up @@ -1331,7 +1330,7 @@ static bool ParseHistoryResults(const bool bInUpdateHistory, const FXmlFile& InX
const FString Filename = ItemNameNode->GetContent();
FPlasticSourceControlState* InOutStatePtr = InOutStates.FindByPredicate(
[&Filename](const FPlasticSourceControlState& State) { return State.LocalFilename == Filename; }
); // NOLINT(whitespace/parens) "Closing ) should be moved to the previous line" doesn't work well for lambda functions
);
if (InOutStatePtr == nullptr)
{
continue;
Expand Down Expand Up @@ -1921,7 +1920,7 @@ bool ParseShelveDiffResults(const FString InWorkspaceRoot, TArray<FString>&& InR
for (FString& Result : InResults)
{
EWorkspaceState ShelveState = ParseShelveFileStatus(Result[0]);

// Remove outer double quotes
Result.MidInline(3, Result.Len() - 4, false);

Expand All @@ -1937,7 +1936,7 @@ bool ParseShelveDiffResults(const FString InWorkspaceRoot, TArray<FString>&& InR
Result.RightChopInline(RenameIndex + 1);
}
}

if (ShelveState != EWorkspaceState::Unknown && !Result.IsEmpty())
{
FString AbsoluteFilename = FPaths::ConvertRelativePathToFull(InWorkspaceRoot, MoveTemp(Result));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace PlasticSourceControlVersions
// 11.0.16.7665 add support for undocheckout --keepchanges. It allows undo checkout and preserve all local changes.
// https://plasticscm.com/download/releasenotes/11.0.16.7665 (2022/12/01)
static const FSoftwareVersion UndoCheckoutKeepChanges(TEXT("11.0.16.7665"));

// 11.0.16.7709 add support for status --iscochanged. It uses "CO+CH" vs "CO" to distinguish CheckedOut with/without changes.
// https://plasticscm.com/download/releasenotes/11.0.16.7709 (2023/01/12)
static const FSoftwareVersion StatusIsCheckedOutChanged(TEXT("11.0.16.7709"));
Expand Down

0 comments on commit 78ba0f2

Please sign in to comment.