editor.sourcecontrol
Source control integration -- query file status, check out, check in, revert, get history, diff, sync, and list changelists through the editor's configured source control provider.
← API Reference
editor.sourcecontrol.getStatus
Get the source control status of one or more files.
| Name | Type | Required | Description |
files | array<string> | Yes | Package paths (e.g. /Game/Maps/MyMap) or disk file paths |
Returns
| Field | Type | Description |
provider | string | Name of the active source control provider |
files | array<object> | Status for each file |
files[].filename | string | On-disk filename |
files[].display_name | string | Human-readable status name |
files[].is_source_controlled | boolean | Whether the file is under source control |
files[].is_checked_out | boolean | Checked out by current user |
files[].is_current | boolean | Up to date with depot |
files[].is_added | boolean | Marked for add |
files[].is_deleted | boolean | Marked for delete |
files[].is_modified | boolean | Locally modified |
files[].is_conflicted | boolean | In conflict state |
files[].is_ignored | boolean | Ignored by source control |
files[].can_check_in | boolean | Can be checked in |
files[].can_check_out | boolean | Can be checked out |
files[].can_edit | boolean | Can be edited |
files[].can_revert | boolean | Can be reverted |
files[].checked_out_by | string | (optional) User who has the file checked out |
Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "editor.sourcecontrol.getStatus",
"params": {
"files": ["/Game/Maps/MainLevel"]
}
}
editor.sourcecontrol.checkOut
Check out file(s) for editing from source control.
| Name | Type | Required | Description |
files | array<string> | Yes | Package paths or disk file paths to check out |
Returns
| Field | Type | Description |
success | boolean | Whether the checkout succeeded |
file_count | number | Number of files processed |
error | string | (optional) Error message if checkout failed |
Example Request
{
"jsonrpc": "2.0",
"id": 2,
"method": "editor.sourcecontrol.checkOut",
"params": {
"files": ["/Game/Maps/MainLevel"]
}
}
editor.sourcecontrol.checkIn
Check in (submit) file(s) to source control with a description.
| Name | Type | Required | Description |
files | array<string> | Yes | Package paths or disk file paths to check in |
description | string | Yes | Changelist/commit description |
keep_checked_out | boolean | No | Keep files checked out after submission (default: false) |
Returns
| Field | Type | Description |
success | boolean | Whether the check-in succeeded |
file_count | number | Number of files processed |
message | string | (optional) Success message with changelist/revision info |
error | string | (optional) Error message if check-in failed |
Example Request
{
"jsonrpc": "2.0",
"id": 3,
"method": "editor.sourcecontrol.checkIn",
"params": {
"files": ["/Game/Maps/MainLevel"],
"description": "Updated lighting in main level"
}
}
editor.sourcecontrol.revert
Revert file(s) to their source control depot version, discarding local changes.
| Name | Type | Required | Description |
files | array<string> | Yes | Package paths or disk file paths to revert |
soft_revert | boolean | No | If true, keep local changes but remove checkout status (default: false) |
Returns
| Field | Type | Description |
success | boolean | Whether the revert succeeded |
file_count | number | Number of files processed |
error | string | (optional) Error message if revert failed |
Example Request
{
"jsonrpc": "2.0",
"id": 4,
"method": "editor.sourcecontrol.revert",
"params": {
"files": ["/Game/Maps/MainLevel"]
}
}
editor.sourcecontrol.getHistory
Get the revision history for a file from source control.
| Name | Type | Required | Description |
file | string | Yes | Package path or disk file path |
max_revisions | number | No | Maximum number of revisions to return (default: 50) |
Returns
| Field | Type | Description |
filename | string | On-disk filename |
total_revisions | number | Total number of revisions available |
history | array<object> | Revision history entries |
history[].revision | string | Revision identifier string |
history[].revision_number | number | Numeric revision number |
history[].description | string | Changelist/commit description |
history[].user | string | User who submitted the revision |
history[].action | string | Action taken (edit, add, branch, integrate, etc.) |
history[].date | string | Date of the revision |
history[].changelist | number | Changelist/check-in identifier |
history[].file_size | number | File size at this revision (0 if deleted) |
Example Request
{
"jsonrpc": "2.0",
"id": 5,
"method": "editor.sourcecontrol.getHistory",
"params": {
"file": "/Game/Maps/MainLevel",
"max_revisions": 10
}
}
editor.sourcecontrol.diff
Get diff information between the local file and the depot/repository version. Returns paths to the local and depot versions for comparison.
| Name | Type | Required | Description |
file | string | Yes | Package path or disk file path |
Returns
| Field | Type | Description |
local_file | string | Path to local version |
depot_file | string | Path to temp file containing depot version |
depot_revision | string | Revision identifier of the depot version |
is_modified | boolean | Whether the local file differs from depot |
display_status | string | Human-readable status name |
Example Request
{
"jsonrpc": "2.0",
"id": 6,
"method": "editor.sourcecontrol.diff",
"params": {
"file": "/Game/Maps/MainLevel"
}
}
editor.sourcecontrol.sync
Sync file(s) to the latest version from the depot/repository (or a specific revision).
| Name | Type | Required | Description |
files | array<string> | Yes | Package paths or disk file paths to sync |
revision | string | No | Specific revision to sync to (default: head/latest) |
Returns
| Field | Type | Description |
success | boolean | Whether the sync succeeded |
file_count | number | Number of files processed |
error | string | (optional) Error message if sync failed |
Example Request
{
"jsonrpc": "2.0",
"id": 7,
"method": "editor.sourcecontrol.sync",
"params": {
"files": ["/Game/Maps/MainLevel"]
}
}
editor.sourcecontrol.getChangelists
List pending changelists from source control. Only available with providers that support changelists (e.g. Perforce).
No parameters.
Returns
| Field | Type | Description |
provider | string | Name of the active source control provider |
count | number | Number of changelists |
changelists | array<object> | Changelist entries |
changelists[].identifier | string | Changelist number/identifier |
changelists[].is_default | boolean | Whether this is the default changelist |
changelists[].can_delete | boolean | Whether this changelist can be deleted |
Example Request
{
"jsonrpc": "2.0",
"id": 8,
"method": "editor.sourcecontrol.getChangelists",
"params": {}
}
Example Response
{
"jsonrpc": "2.0",
"id": 8,
"result": {
"provider": "Perforce",
"count": 2,
"changelists": [
{
"identifier": "default",
"is_default": true,
"can_delete": false
},
{
"identifier": "54321",
"is_default": false,
"can_delete": true
}
]
}
}