SourceControl.Revert.EnableFromSubmitWidget

SourceControl.Revert.EnableFromSubmitWidget

#Overview

name: SourceControl.Revert.EnableFromSubmitWidget

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of SourceControl.Revert.EnableFromSubmitWidget is to control whether a source control ‘Revert’ operation can be triggered from the SubmitWidget in Unreal Engine’s editor interface.

This setting variable is primarily used by the Source Control system within Unreal Engine. It is specifically referenced in the SourceControlWindows module, which is responsible for the UI components related to source control operations in the editor.

The value of this variable is set through a console variable (CVar) system. It is defined in the SourceControlCVars namespace with a default value of false.

The associated variable CVarSourceControlEnableRevertFromSubmitWidget directly interacts with SourceControl.Revert.EnableFromSubmitWidget. They share the same value and purpose.

Developers must be aware that this variable controls a specific UI functionality. When set to true, it allows users to perform revert operations directly from the submit widget in the editor. This can be powerful but potentially dangerous if used incorrectly.

Best practices when using this variable include:

  1. Carefully consider the implications of enabling this feature, as it could lead to accidental loss of work if users are not careful.
  2. Ensure that your team is trained on the proper use of the revert functionality if it’s enabled.
  3. Consider enabling this only in specific development environments where the additional flexibility is needed, rather than in production or shared environments.

Regarding the associated variable CVarSourceControlEnableRevertFromSubmitWidget:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlCVars.cpp:11

Scope (from outer to inner):

file
namespace    SourceControlCVars

Source code excerpt:


	TAutoConsoleVariable<bool> CVarSourceControlEnableRevertFromSubmitWidget(
		TEXT("SourceControl.Revert.EnableFromSubmitWidget"),
		false,
		TEXT("Allows a SourceControl 'Revert' operation to be triggered from the SubmitWidget."),
		ECVF_Default);

	TAutoConsoleVariable<bool> CVarSourceControlEnableRevertUnsaved(
		TEXT("SourceControl.RevertUnsaved.Enable"),

#Loc: <Workspace>/Engine/Source/Editor/SourceControlWindows/Private/SSourceControlSubmit.cpp:537

Scope (from outer to inner):

file
function     bool SSourceControlSubmitWidget::AllowRevert

Source code excerpt:

bool SSourceControlSubmitWidget::AllowRevert() const
{
	if (IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("SourceControl.Revert.EnableFromSubmitWidget")))
	{
		return CVar->GetBool();
	}
	else
	{
		return false;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlCVars.cpp:10

Scope (from outer to inner):

file
namespace    SourceControlCVars

Source code excerpt:

		ECVF_Default);

	TAutoConsoleVariable<bool> CVarSourceControlEnableRevertFromSubmitWidget(
		TEXT("SourceControl.Revert.EnableFromSubmitWidget"),
		false,
		TEXT("Allows a SourceControl 'Revert' operation to be triggered from the SubmitWidget."),
		ECVF_Default);

	TAutoConsoleVariable<bool> CVarSourceControlEnableRevertUnsaved(

#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlCVars.h:8

Scope (from outer to inner):

file
namespace    SourceControlCVars

Source code excerpt:

{
	extern TAutoConsoleVariable<bool> CVarSourceControlEnableRevertFromSceneOutliner;
	extern TAutoConsoleVariable<bool> CVarSourceControlEnableRevertFromSubmitWidget;
	extern TAutoConsoleVariable<bool> CVarSourceControlEnableRevertUnsaved;
	extern TAutoConsoleVariable<bool> CVarSourceControlEnableLoginDialogModal;
}