EditorVCSInterface

Version Control System (VCS) interface which reads and writes to the local VCS in use.

Used by the editor to display VCS extracted information in the editor. The implementation of this API is included in VCS addons, which are essentially GDNative plugins that need to be put into the project folder. These VCS addons are scripts which are attached (on demand) to the object instance of EditorVCSInterface. All the functions listed below, instead of performing the task themselves, they call the internally defined functions in the VCS addons to provide a plug-n-play experience.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_commit
void _commit(String msg)
_getFileDiff
Array _getFileDiff(String file_path)
_getModifiedFilesData
Dictionary _getModifiedFilesData()
_getProjectName
String _getProjectName()
_getVcsName
String _getVcsName()
_initialize
bool _initialize(String project_root_path)
_isVcsInitialized
bool _isVcsInitialized()
_shutDown
bool _shutDown()
_stageFile
void _stageFile(String file_path)
_unstageFile
void _unstageFile(String file_path)
commit
void commit(String msg)

Creates a version commit if the addon is initialized, else returns without doing anything. Uses the files which have been staged previously, with the commit message set to a value as provided as in the argument.

getFileDiff
Array getFileDiff(String file_path)

Returns an Array of Dictionary objects containing the diff output from the VCS in use, if a VCS addon is initialized, else returns an empty Array object. The diff contents also consist of some contextual lines which provide context to the observed line change in the file. Each Dictionary object has the line diff contents under the keys: - "content" to store a String containing the line contents - "status" to store a String which contains "+" in case the content is a line addition but it stores a "-" in case of deletion and an empty string in the case the line content is neither an addition nor a deletion. - "new_line_number" to store an integer containing the new line number of the line content. - "line_count" to store an integer containing the number of lines in the line content. - "old_line_number" to store an integer containing the old line number of the line content. - "offset" to store the offset of the line change since the first contextual line content.

getModifiedFilesData
Dictionary getModifiedFilesData()

Returns a Dictionary containing the path of the detected file change mapped to an integer signifying what kind of change the corresponding file has experienced. The following integer values are being used to signify that the detected file is: - 0: New to the VCS working directory - 1: Modified - 2: Renamed - 3: Deleted - 4: Typechanged

getProjectName
String getProjectName()

Returns the project name of the VCS working directory.

getVcsName
String getVcsName()

Returns the name of the VCS if the VCS has been initialized, else return an empty string.

initialize
bool initialize(String project_root_path)

Initializes the VCS addon if not already. Uses the argument value as the path to the working directory of the project. Creates the initial commit if required. Returns true if no failure occurs, else returns false.

isAddonReady
bool isAddonReady()

Returns true if the addon is ready to respond to function calls, else returns false.

isVcsInitialized
bool isVcsInitialized()

Returns true if the VCS addon has been initialized, else returns false.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(EditorVCSInterface other)
opEquals
bool opEquals(typeof(null) n)
shutDown
bool shutDown()

Shuts down the VCS addon to allow cleanup code to run on call. Returns true is no failure occurs, else returns false.

stageFile
void stageFile(String file_path)

Stages the file which should be committed when EditorVCSInterface.commit is called. Argument should contain the absolute path.

toHash
size_t toHash()
unstageFile
void unstageFile(String file_path)

Unstages the file which was staged previously to be committed, so that it is no longer committed when EditorVCSInterface.commit is called. Argument should contain the absolute path.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
EditorVCSInterface _new()

Construct a new instance of EditorVCSInterface. Note: use memnew!EditorVCSInterface instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta