bool FGatherTextSCC::CleanUp(FString& OutError) { if( CheckedOutFiles.Num() == 0 ) { return true; } bool bCleanupSuccess = true; FString AccumulatedErrorsStr; const int32 FileCount = CheckedOutFiles.Num(); int32 FileIdx = 0; for( int32 i = 0; i < FileCount; ++i ) { FString ErrorStr; bool bReverted = RevertFile( CheckedOutFiles[FileIdx], ErrorStr ); bCleanupSuccess &= bReverted; if( !bReverted ) { if( !AccumulatedErrorsStr.IsEmpty() ) { AccumulatedErrorsStr += TEXT(", "); } AccumulatedErrorsStr += FString::Printf( TEXT("%s : %s"), *CheckedOutFiles[FileIdx], *ErrorStr ); ++FileIdx; } } if( !bCleanupSuccess ) { OutError = FString::Printf( TEXT("Could not complete Source Control cleanup. %s"), *AccumulatedErrorsStr ); } return bCleanupSuccess; }
bool FGatherTextSCC::CleanUp(FText& OutError) { if( CheckedOutFiles.Num() == 0 ) { return true; } bool bCleanupSuccess = true; FString AccumulatedErrorsStr; const int32 FileCount = CheckedOutFiles.Num(); int32 FileIdx = 0; for( int32 i = 0; i < FileCount; ++i ) { FText ErrorText; bool bReverted = RevertFile(CheckedOutFiles[FileIdx], ErrorText); bCleanupSuccess &= bReverted; if( !bReverted ) { if( !AccumulatedErrorsStr.IsEmpty() ) { AccumulatedErrorsStr += TEXT(", "); } AccumulatedErrorsStr += FString::Printf(TEXT("%s : %s"), *CheckedOutFiles[FileIdx], *ErrorText.ToString()); ++FileIdx; } } if( !bCleanupSuccess ) { OutError = FText::Format(NSLOCTEXT("GatherTextCmdlet", "CouldNotCompleteSourceControlCleanup", "Could not complete Source Control cleanup. {FailureReason}"), FText::FromString(AccumulatedErrorsStr)); } return bCleanupSuccess; }