Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
EditorVCSInterface¶
Inherits: Object
Version Control System (VCS) interface, which reads and writes to the local VCS in use.
描述¶
Defines the API that the editor uses to extract information from the underlying VCS. The implementation of this API is included in VCS plugins, which are GDExtension plugins that inherit EditorVCSInterface and are attached (on demand) to the singleton instance of EditorVCSInterface. Instead of performing the task themselves, all the virtual functions listed below are calling the internally overridden functions in the VCS plugins to provide a plug-n-play experience. A custom VCS plugin is supposed to inherit from EditorVCSInterface and override each of these virtual functions.
教程¶
Methods¶
_checkout_branch ( String branch_name ) virtual |
|
void |
|
void |
_create_branch ( String branch_name ) virtual |
void |
_create_remote ( String remote_name, String remote_url ) virtual |
void |
_discard_file ( String file_path ) virtual |
void |
|
_get_branch_list ( ) virtual |
|
_get_current_branch_name ( ) virtual |
|
_get_line_diff ( String file_path, String text ) virtual |
|
_get_modified_files_data ( ) virtual |
|
_get_previous_commits ( int max_commits ) virtual |
|
_get_remotes ( ) virtual |
|
_get_vcs_name ( ) virtual |
|
_initialize ( String project_path ) virtual |
|
void |
|
void |
|
void |
_remove_branch ( String branch_name ) virtual |
void |
_remove_remote ( String remote_name ) virtual |
void |
_set_credentials ( String username, String password, String ssh_public_key_path, String ssh_private_key_path, String ssh_passphrase ) virtual |
_shut_down ( ) virtual |
|
void |
_stage_file ( String file_path ) virtual |
void |
_unstage_file ( String file_path ) virtual |
add_diff_hunks_into_diff_file ( Dictionary diff_file, Dictionary[] diff_hunks ) |
|
add_line_diffs_into_diff_hunk ( Dictionary diff_hunk, Dictionary[] line_diffs ) |
|
create_commit ( String msg, String author, String id, int unix_timestamp, int offset_minutes ) |
|
create_diff_file ( String new_file, String old_file ) |
|
create_diff_hunk ( int old_start, int new_start, int old_lines, int new_lines ) |
|
create_diff_line ( int new_line_no, int old_line_no, String content, String status ) |
|
create_status_file ( String file_path, ChangeType change_type, TreeArea area ) |
|
void |
popup_error ( String msg ) |
Enumerations¶
enum ChangeType:
ChangeType CHANGE_TYPE_NEW = 0
A new file has been added.
ChangeType CHANGE_TYPE_MODIFIED = 1
An earlier added file has been modified.
ChangeType CHANGE_TYPE_RENAMED = 2
An earlier added file has been renamed.
ChangeType CHANGE_TYPE_DELETED = 3
An earlier added file has been deleted.
ChangeType CHANGE_TYPE_TYPECHANGE = 4
An earlier added file has been typechanged.
ChangeType CHANGE_TYPE_UNMERGED = 5
A file is left unmerged.
enum TreeArea:
TreeArea TREE_AREA_COMMIT = 0
A commit is encountered from the commit area.
TreeArea TREE_AREA_STAGED = 1
A file is encountered from the staged area.
TreeArea TREE_AREA_UNSTAGED = 2
A file is encountered from the unstaged area.
Method Descriptions¶
bool _checkout_branch ( String branch_name ) virtual
Checks out a branch_name
in the VCS.
void _commit ( String msg ) virtual
Commits the currently staged changes and applies the commit msg
to the resulting commit.
void _create_branch ( String branch_name ) virtual
Creates a new branch named branch_name
in the VCS.
void _create_remote ( String remote_name, String remote_url ) virtual
Creates a new remote destination with name remote_name
and points it to remote_url
. This can be an HTTPS remote or an SSH remote.
void _discard_file ( String file_path ) virtual
Discards the changes made in a file present at file_path
.
void _fetch ( String remote ) virtual
Fetches new changes from the remote
, but doesn't write changes to the current working directory. Equivalent to git fetch
.
String[] _get_branch_list ( ) virtual
Gets an instance of an Array of Strings containing available branch names in the VCS.
String _get_current_branch_name ( ) virtual
Gets the current branch name defined in the VCS.
Dictionary[] _get_diff ( String identifier, int area ) virtual
Returns an array of Dictionary items (see create_diff_file, create_diff_hunk, create_diff_line, add_line_diffs_into_diff_hunk and add_diff_hunks_into_diff_file), each containing information about a diff. If identifier
is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff.
Dictionary[] _get_line_diff ( String file_path,