r.Editor.SkipSourceControlCheckForEditablePackages

r.Editor.SkipSourceControlCheckForEditablePackages

#Overview

name: r.Editor.SkipSourceControlCheckForEditablePackages

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Editor.SkipSourceControlCheckForEditablePackages is to control whether the Unreal Editor should skip the revision control status check for editable packages. This setting is primarily used in the source control and package management systems of Unreal Engine.

This setting variable is relied upon by the Unreal Editor subsystem, specifically within the file handling and source control integration modules. Based on the callsites, it’s used in the FileHelpers.cpp file, which is part of the UnrealEd module.

The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with an initial value of 0 (disabled by default). Users can change this value at runtime through console commands or configuration files.

The associated variable CVarSkipSourceControlCheckForEditablePackages directly interacts with r.Editor.SkipSourceControlCheckForEditablePackages. They share the same value and purpose.

Developers must be aware that enabling this variable (setting it to 1) will cause the editor to skip the revision control status check for editable packages. This can potentially lead to conflicts or unexpected behavior if multiple users are working on the same project and relying on source control for coordination.

Best practices when using this variable include:

  1. Only enable it when absolutely necessary, such as for performance reasons in large projects or when working offline.
  2. Ensure all team members are aware when this setting is enabled to prevent potential conflicts.
  3. Re-enable the source control checks as soon as possible to maintain proper version control practices.
  4. Use it in conjunction with other source control practices to ensure data integrity.

Regarding the associated variable CVarSkipSourceControlCheckForEditablePackages:

The purpose of CVarSkipSourceControlCheckForEditablePackages is identical to r.Editor.SkipSourceControlCheckForEditablePackages. It’s the actual console variable implementation that controls the behavior.

This variable is used in the UnrealEd module, specifically in the FEditorFileUtils class, which handles file operations in the editor.

The value is set when the console variable is created, with a default value of 0 (disabled). It can be changed at runtime using console commands.

It directly interacts with r.Editor.SkipSourceControlCheckForEditablePackages, as they represent the same setting.

Developers should be aware that this variable is accessed using the GetValueOnAnyThread() method, which means its value can be read from any thread. This is important for understanding potential race conditions or thread safety issues.

Best practices for using this variable include:

  1. Use the CVarSkipSourceControlCheckForEditablePackages.GetValueOnAnyThread() method to read its value in code.
  2. Consider the performance implications of frequently checking this value in performance-critical code paths.
  3. Document any code that relies on this variable to skip source control checks, to ensure maintainability and clarity for other developers.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/FileHelpers.cpp:105

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarSkipSourceControlCheckForEditablePackages(
	TEXT("r.Editor.SkipSourceControlCheckForEditablePackages"),
	0,
    TEXT("Whether to skip the revision control status check for editable packages, 0: Disable (Default), 1: Enable"));

#define LOCTEXT_NAMESPACE "FileHelpers"

FEditorFileUtils::FOnPrepareWorldsForExplicitSave FEditorFileUtils::OnPrepareWorldsForExplicitSave;

#Associated Variable and Callsites

This variable is associated with another variable named CVarSkipSourceControlCheckForEditablePackages. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/FileHelpers.cpp:104

Scope: file

Source code excerpt:

}

static TAutoConsoleVariable<int32> CVarSkipSourceControlCheckForEditablePackages(
	TEXT("r.Editor.SkipSourceControlCheckForEditablePackages"),
	0,
    TEXT("Whether to skip the revision control status check for editable packages, 0: Disable (Default), 1: Enable"));

#define LOCTEXT_NAMESPACE "FileHelpers"

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/FileHelpers.cpp:1639

Scope (from outer to inner):

file
function     bool FEditorFileUtils::AddCheckoutPackageItems

Source code excerpt:

	{
		TArray<UPackage*> SourceControlCheckPackages;
		if (CVarSkipSourceControlCheckForEditablePackages.GetValueOnAnyThread())
		{
			for (auto Package : PackagesToCheckOut)
			{
				if (!Package)
				{
					continue;