TextDiffToolPath
TextDiffToolPath
#Overview
name: TextDiffToolPath
The value of this variable can be defined or overridden in .ini config files. 2
.ini config files referencing this setting variable.
It is referenced in 14
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of TextDiffToolPath is to specify the file path to the external tool used for diffing text files in the Unreal Engine editor. This setting is primarily used for comparing different versions of assets, source code, or other text-based content within the Unreal Engine development environment.
TextDiffToolPath is relied upon by various Unreal Engine subsystems and modules, including:
- Asset management and diffing tools
- Source control integration
- World Partition system
- Conversation Database editor
- Datasmith Importer
- General editor functionality
The value of this variable is set in the UEditorLoadingSavingSettings class, which is part of the editor’s configuration. By default, it is set to “P4Merge.exe”, but users can modify this in the editor settings.
This variable interacts with other parts of the asset diffing and comparison system, such as the CreateDiffProcess function in the AssetTools module.
Developers should be aware that:
- The specified diff tool must be installed and accessible on the user’s system.
- Different team members may have different diff tools installed, which could lead to inconsistencies in the diffing process.
Best practices when using this variable include:
- Ensuring that all team members use a consistent diff tool across the project.
- Verifying that the specified tool is compatible with the types of files being compared.
- Considering the use of relative paths or environment variables to make the setting more portable across different development environments.
- Documenting the preferred diff tool and its setup process for the project to maintain consistency.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:191, section: [/Script/UnrealEd.EditorLoadingSavingSettings]
- INI Section:
/Script/UnrealEd.EditorLoadingSavingSettings
- Raw value:
(FilePath="p4merge.exe")
- Is Array:
False
Location: <Workspace>/Engine/Config/Mac/MacEditorPerProjectUserSettings.ini:23, section: [/Script/UnrealEd.EditorLoadingSavingSettings]
- INI Section:
/Script/UnrealEd.EditorLoadingSavingSettings
- Raw value:
(FilePath="p4merge.app")
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Editor/ChangelistReview/Source/Private/SSourceControlReviewEntry.cpp:305
Scope (from outer to inner):
file
function void SSourceControlReviewEntry::TryBindTextDiff
lambda-function
Source code excerpt:
DiffMethod.BindLambda([this]
{
const FString& DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
const FAssetToolsModule& AssetToolsModule = FAssetToolsModule::GetModule();
FString OldFilePath = ChangelistFileData.PreviousFileTempPath;
FString NewFilePath = ChangelistFileData.ReviewFileTempPath;
// if this is an add or delete change, diff against an empty file
#Loc: <Workspace>/Engine/Plugins/Editor/EngineAssetDefinitions/Source/Private/AssetDefinition_Curve.cpp:71
Scope (from outer to inner):
file
function EAssetCommandResult UAssetDefinition_Curve::PerformAssetDiff
Source code excerpt:
if (OldResult && NewResult)
{
const FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
IAssetTools::Get().CreateDiffProcess(DiffCommand, AbsoluteOldTempFileName, AbsoluteNewTempFileName);
return EAssetCommandResult::Handled;
}
return Super::PerformAssetDiff(DiffArgs);
#Loc: <Workspace>/Engine/Plugins/Editor/EngineAssetDefinitions/Source/Private/Table/AssetDefinition_CurveTable.cpp:62
Scope (from outer to inner):
file
function EAssetCommandResult UAssetDefinition_CurveTable::PerformAssetDiff
Source code excerpt:
if (OldResult && NewResult)
{
const FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
FAssetToolsModule& AssetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>("AssetTools");
AssetToolsModule.Get().CreateDiffProcess(DiffCommand, AbsoluteOldTempFileName, AbsoluteNewTempFileName);
return EAssetCommandResult::Handled;
}
#Loc: <Workspace>/Engine/Plugins/Editor/EngineAssetDefinitions/Source/Private/Table/AssetDefinition_DataTable.cpp:88
Scope (from outer to inner):
file
function EAssetCommandResult UAssetDefinition_DataTable::PerformAssetDiff
Source code excerpt:
if (OldResult && NewResult)
{
const FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
FAssetToolsModule& AssetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>("AssetTools");
AssetToolsModule.Get().CreateDiffProcess(DiffCommand, AbsoluteOldTempFileName, AbsoluteNewTempFileName);
return EAssetCommandResult::Handled;
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithImporter/Source/DatasmithImporter/Private/DatasmithImporterModule.cpp:634
Scope (from outer to inner):
file
function void FDatasmithImporterModule::DiffAgainstTemplates
Source code excerpt:
FString OldTextFilename = AssetToolsModule.Get().DumpAssetToTempFile( OldTemplate );
FString NewTextFilename = AssetToolsModule.Get().DumpAssetToTempFile( NewTemplate );
FString DiffCommand = GetDefault< UEditorLoadingSavingSettings >()->TextDiffToolPath.FilePath;
AssetToolsModule.Get().CreateDiffProcess( DiffCommand, OldTextFilename, NewTextFilename );
}
}
void FDatasmithImporterModule::ResetFromTemplates( UObject* Outer )
#Loc: <Workspace>/Engine/Plugins/Experimental/CommonConversation/Source/CommonConversationEditor/Private/AssetTypeActions_ConversationDatabase.cpp:85
Scope (from outer to inner):
file
function void FAssetTypeActions_ConversationDatabase::OpenInDefaults
Source code excerpt:
// Get diff program to use
const FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
FAssetToolsModule& AssetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>("AssetTools");
AssetToolsModule.Get().CreateDiffProcess(DiffCommand, OldTextFilename, NewTextFilename);
}
#undef LOCTEXT_NAMESPACE
#Loc: <Workspace>/Engine/Source/Developer/AssetTools/Private/AssetTools.cpp:3325
Scope (from outer to inner):
file
function bool UAssetToolsImpl::CreateDiffProcess
Source code excerpt:
{
UEditorLoadingSavingSettings& Settings = *GetMutableDefault<UEditorLoadingSavingSettings>();
Settings.TextDiffToolPath.FilePath = OutFiles[0];
Settings.SaveConfig();
NewDiffCommand = OutFiles[0];
}
}
}
}
#Loc: <Workspace>/Engine/Source/Developer/AssetTools/Public/AssetTypeActions_Base.h:101
Scope (from outer to inner):
file
class class FAssetTypeActions_Base : public IAssetTypeActions
function virtual void PerformAssetDiff
Source code excerpt:
FString OldTextFilename = DumpAssetToTempFile(OldAsset);
FString NewTextFilename = DumpAssetToTempFile(NewAsset);
FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
FAssetToolsModule& AssetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>("AssetTools");
AssetToolsModule.Get().CreateDiffProcess(DiffCommand, OldTextFilename, NewTextFilename);
}
virtual class UThumbnailInfo* GetThumbnailInfo(UObject* Asset) const override
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorLoadingSavingSettings.h:218
Scope (from outer to inner):
file
class class UEditorLoadingSavingSettings : public UObject
Source code excerpt:
/** Specifies the file path to the tool to be used for diffing text files */
UPROPERTY(EditAnywhere, config, Category=SourceControl, meta=(DisplayName="Tool for diffing text"))
FFilePath TextDiffToolPath;
public:
// @todo thomass: proper settings support for source control module
UNREALED_API void SccHackInitialize( );
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/AssetDefinitionDefault.cpp:33
Scope (from outer to inner):
file
function EAssetCommandResult UAssetDefinitionDefault::PerformAssetDiff
Source code excerpt:
FString OldTextFilename = AssetTools.DumpAssetToTempFile(DiffArgs.OldAsset);
FString NewTextFilename = AssetTools.DumpAssetToTempFile(DiffArgs.NewAsset);
FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
AssetTools.CreateDiffProcess(DiffCommand, OldTextFilename, NewTextFilename);
return EAssetCommandResult::Handled;
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:254
Scope (from outer to inner):
file
function UEditorLoadingSavingSettings::UEditorLoadingSavingSettings
Source code excerpt:
, bDeleteSourceFilesWithAssets(false)
{
TextDiffToolPath.FilePath = TEXT("P4Merge.exe");
FAutoReimportDirectoryConfig Default;
Default.SourceDirectory = TEXT("/Game/");
AutoReimportDirectorySettings.Add(Default);
bPromptBeforeAutoImporting = true;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/WorldPartition/WorldPartitionResaveActorsBuilder.cpp:497
Scope (from outer to inner):
file
function bool UWorldPartitionResaveActorsBuilder::RunInternal
Source code excerpt:
if (OldResult && NewResult)
{
FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
FAssetToolsModule& AssetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>("AssetTools");
AssetToolsModule.Get().CreateDiffProcess(DiffCommand, TempFileOld, TempFileNew);
}
else
{
#Loc: <Workspace>/Engine/Source/Editor/WorldBrowser/Private/LevelCollectionModel.cpp:1350
Scope (from outer to inner):
file
function void FLevelCollectionModel::SCCDiffAgainstDepot
Source code excerpt:
FString OldTextFilename = AssetToolsModule.Get().DumpAssetToTempFile(OldPackage);
FString NewTextFilename = AssetToolsModule.Get().DumpAssetToTempFile(OriginalPackage);
FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
AssetToolsModule.Get().CreateDiffProcess(DiffCommand, OldTextFilename, NewTextFilename);
AssetToolsModule.Get().DiffAssets(OldPackage, OriginalPackage, OldRevision, NewRevision);
}
}
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Tests/WorldPartition/WorldPartitionStreamingGenerationTests.cpp:84
Scope (from outer to inner):
file
namespace WorldPartitionTests
function bool FWorldPartitionStreamingGenerationTest::RunTest
Source code excerpt:
if (!FParse::Param(FCommandLine::Get(), TEXT("unattended")))
{
FString DiffCommand = GetDefault<UEditorLoadingSavingSettings>()->TextDiffToolPath.FilePath;
FAssetToolsModule& AssetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>("AssetTools");
AssetToolsModule.Get().CreateDiffProcess(DiffCommand, ReferenceOutputLogPath, GeneratedOutputLogPath);
}
return false;
}
#endif