classref: Sync with current master branch (46a568e0a)

This commit is contained in:
Rémi Verschelde
2022-08-31 15:18:54 +02:00
parent b08b95d4f5
commit 465dd176b6
378 changed files with 17124 additions and 13692 deletions

View File

@@ -12,154 +12,377 @@ EditorVCSInterface
**Inherits:** :ref:`Object<class_Object>`
Version Control System (VCS) interface which reads and writes to the local VCS in use.
Version Control System (VCS) interface, which reads and writes to the local VCS in use.
Description
-----------
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 GDExtension 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.
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
-------
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`commit<class_EditorVCSInterface_method_commit>` **(** :ref:`String<class_String>` msg **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_file_diff<class_EditorVCSInterface_method_get_file_diff>` **(** :ref:`String<class_String>` file_path **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_modified_files_data<class_EditorVCSInterface_method_get_modified_files_data>` **(** **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_project_name<class_EditorVCSInterface_method_get_project_name>` **(** **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_vcs_name<class_EditorVCSInterface_method_get_vcs_name>` **(** **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`initialize<class_EditorVCSInterface_method_initialize>` **(** :ref:`String<class_String>` project_root_path **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_addon_ready<class_EditorVCSInterface_method_is_addon_ready>` **(** **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_vcs_initialized<class_EditorVCSInterface_method_is_vcs_initialized>` **(** **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`shut_down<class_EditorVCSInterface_method_shut_down>` **(** **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stage_file<class_EditorVCSInterface_method_stage_file>` **(** :ref:`String<class_String>` file_path **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`unstage_file<class_EditorVCSInterface_method_unstage_file>` **(** :ref:`String<class_String>` file_path **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`_checkout_branch<class_EditorVCSInterface_method__checkout_branch>` **(** :ref:`String<class_String>` branch_name **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_commit<class_EditorVCSInterface_method__commit>` **(** :ref:`String<class_String>` msg **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_create_branch<class_EditorVCSInterface_method__create_branch>` **(** :ref:`String<class_String>` branch_name **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_create_remote<class_EditorVCSInterface_method__create_remote>` **(** :ref:`String<class_String>` remote_name, :ref:`String<class_String>` remote_url **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_discard_file<class_EditorVCSInterface_method__discard_file>` **(** :ref:`String<class_String>` file_path **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_fetch<class_EditorVCSInterface_method__fetch>` **(** :ref:`String<class_String>` remote **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`_get_branch_list<class_EditorVCSInterface_method__get_branch_list>` **(** **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`_get_current_branch_name<class_EditorVCSInterface_method__get_current_branch_name>` **(** **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary[]<class_Dictionary>` | :ref:`_get_diff<class_EditorVCSInterface_method__get_diff>` **(** :ref:`String<class_String>` identifier, :ref:`int<class_int>` area **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`_get_line_diff<class_EditorVCSInterface_method__get_line_diff>` **(** :ref:`String<class_String>` file_path, :ref:`String<class_String>` text **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`_get_modified_files_data<class_EditorVCSInterface_method__get_modified_files_data>` **(** **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`_get_previous_commits<class_EditorVCSInterface_method__get_previous_commits>` **(** :ref:`int<class_int>` max_commits **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`_get_remotes<class_EditorVCSInterface_method__get_remotes>` **(** **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`_get_vcs_name<class_EditorVCSInterface_method__get_vcs_name>` **(** **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`_initialize<class_EditorVCSInterface_method__initialize>` **(** :ref:`String<class_String>` project_path **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_pull<class_EditorVCSInterface_method__pull>` **(** :ref:`String<class_String>` remote **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_push<class_EditorVCSInterface_method__push>` **(** :ref:`String<class_String>` remote, :ref:`bool<class_bool>` force **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_remove_branch<class_EditorVCSInterface_method__remove_branch>` **(** :ref:`String<class_String>` branch_name **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_remove_remote<class_EditorVCSInterface_method__remove_remote>` **(** :ref:`String<class_String>` remote_name **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_set_credentials<class_EditorVCSInterface_method__set_credentials>` **(** :ref:`String<class_String>` username, :ref:`String<class_String>` password, :ref:`String<class_String>` ssh_public_key_path, :ref:`String<class_String>` ssh_private_key_path, :ref:`String<class_String>` ssh_passphrase **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`_shut_down<class_EditorVCSInterface_method__shut_down>` **(** **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_stage_file<class_EditorVCSInterface_method__stage_file>` **(** :ref:`String<class_String>` file_path **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_unstage_file<class_EditorVCSInterface_method__unstage_file>` **(** :ref:`String<class_String>` file_path **)** |virtual| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`add_diff_hunks_into_diff_file<class_EditorVCSInterface_method_add_diff_hunks_into_diff_file>` **(** :ref:`Dictionary<class_Dictionary>` diff_file, :ref:`Array<class_Array>` diff_hunks **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`add_line_diffs_into_diff_hunk<class_EditorVCSInterface_method_add_line_diffs_into_diff_hunk>` **(** :ref:`Dictionary<class_Dictionary>` diff_hunk, :ref:`Array<class_Array>` line_diffs **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`create_commit<class_EditorVCSInterface_method_create_commit>` **(** :ref:`String<class_String>` msg, :ref:`String<class_String>` author, :ref:`String<class_String>` id, :ref:`int<class_int>` unix_timestamp, :ref:`int<class_int>` offset_minutes **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`create_diff_file<class_EditorVCSInterface_method_create_diff_file>` **(** :ref:`String<class_String>` new_file, :ref:`String<class_String>` old_file **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`create_diff_hunk<class_EditorVCSInterface_method_create_diff_hunk>` **(** :ref:`int<class_int>` old_start, :ref:`int<class_int>` new_start, :ref:`int<class_int>` old_lines, :ref:`int<class_int>` new_lines **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`create_diff_line<class_EditorVCSInterface_method_create_diff_line>` **(** :ref:`int<class_int>` new_line_no, :ref:`int<class_int>` old_line_no, :ref:`String<class_String>` content, :ref:`String<class_String>` status **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`create_status_file<class_EditorVCSInterface_method_create_status_file>` **(** :ref:`String<class_String>` file_path, :ref:`ChangeType<enum_EditorVCSInterface_ChangeType>` change_type, :ref:`TreeArea<enum_EditorVCSInterface_TreeArea>` area **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`popup_error<class_EditorVCSInterface_method_popup_error>` **(** :ref:`String<class_String>` msg **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_EditorVCSInterface_ChangeType:
.. _class_EditorVCSInterface_constant_CHANGE_TYPE_NEW:
.. _class_EditorVCSInterface_constant_CHANGE_TYPE_MODIFIED:
.. _class_EditorVCSInterface_constant_CHANGE_TYPE_RENAMED:
.. _class_EditorVCSInterface_constant_CHANGE_TYPE_DELETED:
.. _class_EditorVCSInterface_constant_CHANGE_TYPE_TYPECHANGE:
.. _class_EditorVCSInterface_constant_CHANGE_TYPE_UNMERGED:
enum **ChangeType**:
- **CHANGE_TYPE_NEW** = **0** --- A new file has been added.
- **CHANGE_TYPE_MODIFIED** = **1** --- An earlier added file has been modified.
- **CHANGE_TYPE_RENAMED** = **2** --- An earlier added file has been renamed.
- **CHANGE_TYPE_DELETED** = **3** --- An earlier added file has been deleted.
- **CHANGE_TYPE_TYPECHANGE** = **4** --- An earlier added file has been typechanged.
- **CHANGE_TYPE_UNMERGED** = **5** --- A file is left unmerged.
----
.. _enum_EditorVCSInterface_TreeArea:
.. _class_EditorVCSInterface_constant_TREE_AREA_COMMIT:
.. _class_EditorVCSInterface_constant_TREE_AREA_STAGED:
.. _class_EditorVCSInterface_constant_TREE_AREA_UNSTAGED:
enum **TreeArea**:
- **TREE_AREA_COMMIT** = **0** --- A commit is encountered from the commit area.
- **TREE_AREA_STAGED** = **1** --- A file is encountered from the staged area.
- **TREE_AREA_UNSTAGED** = **2** --- A file is encountered from the unstaged area.
Method Descriptions
-------------------
.. _class_EditorVCSInterface_method_commit:
.. _class_EditorVCSInterface_method__checkout_branch:
- void **commit** **(** :ref:`String<class_String>` msg **)**
- :ref:`bool<class_bool>` **_checkout_branch** **(** :ref:`String<class_String>` branch_name **)** |virtual|
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.
Checks out a ``branch_name`` in the VCS.
----
.. _class_EditorVCSInterface_method_get_file_diff:
.. _class_EditorVCSInterface_method__commit:
- :ref:`Array<class_Array>` **get_file_diff** **(** :ref:`String<class_String>` file_path **)**
- void **_commit** **(** :ref:`String<class_String>` msg **)** |virtual|
Returns an :ref:`Array<class_Array>` of :ref:`Dictionary<class_Dictionary>` objects containing the diff output from the VCS in use, if a VCS addon is initialized, else returns an empty :ref:`Array<class_Array>` object. The diff contents also consist of some contextual lines which provide context to the observed line change in the file.
Each :ref:`Dictionary<class_Dictionary>` object has the line diff contents under the keys:
- ``"content"`` to store a :ref:`String<class_String>` containing the line contents
- ``"status"`` to store a :ref:`String<class_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.
Commits the currently staged changes and applies the commit ``msg`` to the resulting commit.
----
.. _class_EditorVCSInterface_method_get_modified_files_data:
.. _class_EditorVCSInterface_method__create_branch:
- :ref:`Dictionary<class_Dictionary>` **get_modified_files_data** **(** **)**
- void **_create_branch** **(** :ref:`String<class_String>` branch_name **)** |virtual|
Returns a :ref:`Dictionary<class_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
Creates a new branch named ``branch_name`` in the VCS.
----
.. _class_EditorVCSInterface_method_get_project_name:
.. _class_EditorVCSInterface_method__create_remote:
- :ref:`String<class_String>` **get_project_name** **(** **)**
- void **_create_remote** **(** :ref:`String<class_String>` remote_name, :ref:`String<class_String>` remote_url **)** |virtual|
Returns the project name of the VCS working directory.
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.
----
.. _class_EditorVCSInterface_method_get_vcs_name:
.. _class_EditorVCSInterface_method__discard_file:
- :ref:`String<class_String>` **get_vcs_name** **(** **)**
- void **_discard_file** **(** :ref:`String<class_String>` file_path **)** |virtual|
Returns the name of the VCS if the VCS has been initialized, else return an empty string.
Discards the changes made in a file present at ``file_path``.
----
.. _class_EditorVCSInterface_method_initialize:
.. _class_EditorVCSInterface_method__fetch:
- :ref:`bool<class_bool>` **initialize** **(** :ref:`String<class_String>` project_root_path **)**
- void **_fetch** **(** :ref:`String<class_String>` remote **)** |virtual|
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``.
Fetches new changes from the remote, but doesn't write changes to the current working directory. Equivalent to ``git fetch``.
----
.. _class_EditorVCSInterface_method_is_addon_ready:
.. _class_EditorVCSInterface_method__get_branch_list:
- :ref:`bool<class_bool>` **is_addon_ready** **(** **)**
- :ref:`Array<class_Array>` **_get_branch_list** **(** **)** |virtual|
Returns ``true`` if the addon is ready to respond to function calls, else returns ``false``.
Gets an instance of an :ref:`Array<class_Array>` of :ref:`String<class_String>`\ s containing available branch names in the VCS.
----
.. _class_EditorVCSInterface_method_is_vcs_initialized:
.. _class_EditorVCSInterface_method__get_current_branch_name:
- :ref:`bool<class_bool>` **is_vcs_initialized** **(** **)**
- :ref:`String<class_String>` **_get_current_branch_name** **(** **)** |virtual|
Returns ``true`` if the VCS addon has been initialized, else returns ``false``.
Gets the current branch name defined in the VCS.
----
.. _class_EditorVCSInterface_method_shut_down:
.. _class_EditorVCSInterface_method__get_diff:
- :ref:`bool<class_bool>` **shut_down** **(** **)**
- :ref:`Dictionary[]<class_Dictionary>` **_get_diff** **(** :ref:`String<class_String>` identifier, :ref:`int<class_int>` area **)** |virtual|
Shuts down the VCS addon to allow cleanup code to run on call. Returns ``true`` is no failure occurs, else returns ``false``.
Returns an array of :ref:`Dictionary<class_Dictionary>` items (see :ref:`create_diff_file<class_EditorVCSInterface_method_create_diff_file>`, :ref:`create_diff_hunk<class_EditorVCSInterface_method_create_diff_hunk>`, :ref:`create_diff_line<class_EditorVCSInterface_method_create_diff_line>`, :ref:`add_line_diffs_into_diff_hunk<class_EditorVCSInterface_method_add_line_diffs_into_diff_hunk>` and :ref:`add_diff_hunks_into_diff_file<class_EditorVCSInterface_method_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.
----
.. _class_EditorVCSInterface_method_stage_file:
.. _class_EditorVCSInterface_method__get_line_diff:
- void **stage_file** **(** :ref:`String<class_String>` file_path **)**
- :ref:`Array<class_Array>` **_get_line_diff** **(** :ref:`String<class_String>` file_path, :ref:`String<class_String>` text **)** |virtual|
Stages the file which should be committed when :ref:`commit<class_EditorVCSInterface_method_commit>` is called. Argument should contain the absolute path.
Returns an :ref:`Array<class_Array>` of :ref:`Dictionary<class_Dictionary>` items (see :ref:`create_diff_hunk<class_EditorVCSInterface_method_create_diff_hunk>`), each containing a line diff between a file at ``file_path`` and the ``text`` which is passed in.
----
.. _class_EditorVCSInterface_method_unstage_file:
.. _class_EditorVCSInterface_method__get_modified_files_data:
- void **unstage_file** **(** :ref:`String<class_String>` file_path **)**
- :ref:`Array<class_Array>` **_get_modified_files_data** **(** **)** |virtual|
Unstages the file which was staged previously to be committed, so that it is no longer committed when :ref:`commit<class_EditorVCSInterface_method_commit>` is called. Argument should contain the absolute path.
Returns an :ref:`Array<class_Array>` of :ref:`Dictionary<class_Dictionary>` items (see :ref:`create_status_file<class_EditorVCSInterface_method_create_status_file>`), each containing the status data of every modified file in the project folder.
----
.. _class_EditorVCSInterface_method__get_previous_commits:
- :ref:`Array<class_Array>` **_get_previous_commits** **(** :ref:`int<class_int>` max_commits **)** |virtual|
Returns an :ref:`Array<class_Array>` of :ref:`Dictionary<class_Dictionary>` items (see :ref:`create_commit<class_EditorVCSInterface_method_create_commit>`), each containing the data for a past commit.
----
.. _class_EditorVCSInterface_method__get_remotes:
- :ref:`Array<class_Array>` **_get_remotes** **(** **)** |virtual|
Returns an :ref:`Array<class_Array>` of :ref:`String<class_String>`\ s, each containing the name of a remote configured in the VCS.
----
.. _class_EditorVCSInterface_method__get_vcs_name:
- :ref:`String<class_String>` **_get_vcs_name** **(** **)** |virtual|
Returns the name of the underlying VCS provider.
----
.. _class_EditorVCSInterface_method__initialize:
- :ref:`bool<class_bool>` **_initialize** **(** :ref:`String<class_String>` project_path **)** |virtual|
Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at ``project_path``.
----
.. _class_EditorVCSInterface_method__pull:
- void **_pull** **(** :ref:`String<class_String>` remote **)** |virtual|
Pulls changes from the remote. This can give rise to merge conflicts.
----
.. _class_EditorVCSInterface_method__push:
- void **_push** **(** :ref:`String<class_String>` remote, :ref:`bool<class_bool>` force **)** |virtual|
Pushes changes to the ``remote``. Optionally, if ``force`` is set to true, a force push will override the change history already present on the remote.
----
.. _class_EditorVCSInterface_method__remove_branch:
- void **_remove_branch** **(** :ref:`String<class_String>` branch_name **)** |virtual|
Remove a branch from the local VCS.
----
.. _class_EditorVCSInterface_method__remove_remote:
- void **_remove_remote** **(** :ref:`String<class_String>` remote_name **)** |virtual|
Remove a remote from the local VCS.
----
.. _class_EditorVCSInterface_method__set_credentials:
- void **_set_credentials** **(** :ref:`String<class_String>` username, :ref:`String<class_String>` password, :ref:`String<class_String>` ssh_public_key_path, :ref:`String<class_String>` ssh_private_key_path, :ref:`String<class_String>` ssh_passphrase **)** |virtual|
Set user credentials in the underlying VCS. ``username`` and ``password`` are used only during HTTPS authentication unless not already mentioned in the remote URL. ``ssh_public_key_path``, ``ssh_private_key_path``, and ``ssh_passphrase`` are only used during SSH authentication.
----
.. _class_EditorVCSInterface_method__shut_down:
- :ref:`bool<class_bool>` **_shut_down** **(** **)** |virtual|
Shuts down VCS plugin instance. Called when the user either closes the editor or shuts down the VCS plugin through the editor UI.
----
.. _class_EditorVCSInterface_method__stage_file:
- void **_stage_file** **(** :ref:`String<class_String>` file_path **)** |virtual|
Stages the file present at ``file_path`` to the staged area.
----
.. _class_EditorVCSInterface_method__unstage_file:
- void **_unstage_file** **(** :ref:`String<class_String>` file_path **)** |virtual|
Unstages the file present at ``file_path`` from the staged area to the unstaged area.
----
.. _class_EditorVCSInterface_method_add_diff_hunks_into_diff_file:
- :ref:`Dictionary<class_Dictionary>` **add_diff_hunks_into_diff_file** **(** :ref:`Dictionary<class_Dictionary>` diff_file, :ref:`Array<class_Array>` diff_hunks **)**
Helper function to add an array of ``diff_hunks`` into a ``diff_file``.
----
.. _class_EditorVCSInterface_method_add_line_diffs_into_diff_hunk:
- :ref:`Dictionary<class_Dictionary>` **add_line_diffs_into_diff_hunk** **(** :ref:`Dictionary<class_Dictionary>` diff_hunk, :ref:`Array<class_Array>` line_diffs **)**
Helper function to add an array of ``line_diffs`` into a ``diff_hunk``.
----
.. _class_EditorVCSInterface_method_create_commit:
- :ref:`Dictionary<class_Dictionary>` **create_commit** **(** :ref:`String<class_String>` msg, :ref:`String<class_String>` author, :ref:`String<class_String>` id, :ref:`int<class_int>` unix_timestamp, :ref:`int<class_int>` offset_minutes **)**
Helper function to create a commit :ref:`Dictionary<class_Dictionary>` item. ``msg`` is the commit message of the commit. ``author`` is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. ``id`` is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. ``unix_timestamp`` is the UTC Unix timestamp of when the commit was created. ``offset_minutes`` is the timezone offset in minutes, recorded from the system timezone where the commit was created.
----
.. _class_EditorVCSInterface_method_create_diff_file:
- :ref:`Dictionary<class_Dictionary>` **create_diff_file** **(** :ref:`String<class_String>` new_file, :ref:`String<class_String>` old_file **)**
Helper function to create a ``Dictionary`` for storing old and new diff file paths.
----
.. _class_EditorVCSInterface_method_create_diff_hunk:
- :ref:`Dictionary<class_Dictionary>` **create_diff_hunk** **(** :ref:`int<class_int>` old_start, :ref:`int<class_int>` new_start, :ref:`int<class_int>` old_lines, :ref:`int<class_int>` new_lines **)**
Helper function to create a ``Dictionary`` for storing diff hunk data. ``old_start`` is the starting line number in old file. ``new_start`` is the starting line number in new file. ``old_lines`` is the number of lines in the old file. ``new_lines`` is the number of lines in the new file.
----
.. _class_EditorVCSInterface_method_create_diff_line:
- :ref:`Dictionary<class_Dictionary>` **create_diff_line** **(** :ref:`int<class_int>` new_line_no, :ref:`int<class_int>` old_line_no, :ref:`String<class_String>` content, :ref:`String<class_String>` status **)**
Helper function to create a ``Dictionary`` for storing a line diff. ``new_line_no`` is the line number in the new file (can be ``-1`` if the line is deleted). ``old_line_no`` is the line number in the old file (can be ``-1`` if the line is added). ``content`` is the diff text. ``status`` is a single character string which stores the line origin.
----
.. _class_EditorVCSInterface_method_create_status_file:
- :ref:`Dictionary<class_Dictionary>` **create_status_file** **(** :ref:`String<class_String>` file_path, :ref:`ChangeType<enum_EditorVCSInterface_ChangeType>` change_type, :ref:`TreeArea<enum_EditorVCSInterface_TreeArea>` area **)**
Helper function to create a ``Dictionary`` used by editor to read the status of a file.
----
.. _class_EditorVCSInterface_method_popup_error:
- void **popup_error** **(** :ref:`String<class_String>` msg **)**
Pops up an error message in the edior which is shown as coming from the underlying VCS. Use this to show VCS specific error messages.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`