Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
ChangeType
EditorVCSInterface.swift:13enum ChangeType
Cases
case new
A new file has been added.
case modified
An earlier added file has been modified.
case renamed
An earlier added file has been renamed.
case deleted
An earlier added file has been deleted.
case typechange
An earlier added file has been typechanged.
case unmerged
A file is left unmerged.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (33) members.
Types
Type members
Instance members
func addDiffHunksIntoDiffFile(GDictionary, diffHunks: VariantCollection<GDictionary>
) -> GDictionary Helper function to add an array of
diffHunks
into adiffFile
.func addLineDiffsIntoDiffHunk(GDictionary, lineDiffs: VariantCollection<GDictionary>
) -> GDictionary Helper function to add an array of
lineDiffs
into adiffHunk
.func createDiffFile(newFile: String, oldFile: String
) -> GDictionary Helper function to create a
GDictionary
for storing old and new diff file paths.func createDiffHunk(oldStart: Int32, newStart: Int32, oldLines: Int32, newLines: Int32
) -> GDictionary Helper function to create a
GDictionary
for storing diff hunk data.oldStart
is the starting line number in old file.newStart
is the starting line number in new file.oldLines
is the number of lines in the old file.newLines
is the number of lines in the new file.func createDiffLine(newLineNo: Int32, oldLineNo: Int32, content: String, status: String
) -> GDictionary Helper function to create a
GDictionary
for storing a line diff.newLineNo
is the line number in the new file (can be-1
if the line is deleted).oldLineNo
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.func createStatusFile(filePath: String, changeType: EditorVCSInterface.ChangeType, area: EditorVCSInterface.TreeArea
) -> GDictionary Helper function to create a
GDictionary
used by editor to read the status of a file.func popupError(msg: String
) Pops up an error message in the editor which is shown as coming from the underlying VCS. Use this to show VCS specific error messages.
Show implementation details (23)
Hide implementation details
func _checkoutBranch(branchName: String
) -> Bool Checks out a
branchName
in the VCS.func _commit(msg: String
) Commits the currently staged changes and applies the commit
msg
to the resulting commit.func _createBranch(branchName: String
) Creates a new branch named
branchName
in the VCS.func _createRemote(remoteName: String, remoteUrl: String
) Creates a new remote destination with name
remoteName
and points it toremoteUrl
. This can be an HTTPS remote or an SSH remote.func _discardFile(filePath: String
) Discards the changes made in a file present at
filePath
.func _fetch(remote: String
) Fetches new changes from the
remote
, but doesn’t write changes to the current working directory. Equivalent togit fetch
.func _getBranchList(
) -> VariantCollection<String> Gets an instance of an
GArray
ofString
s containing available branch names in the VCS.func _getCurrentBranchName(
) -> String Gets the current branch name defined in the VCS.
func _getDiff(identifier: String, area: Int32
) -> VariantCollection<GDictionary> Returns an array of
GDictionary
items (seecreateDiffFile(newFile:oldFile:)
,createDiffHunk(oldStart:newStart:oldLines:newLines:)
,createDiffLine(newLineNo:oldLineNo:content:status:)
,addLineDiffsIntoDiffHunk(_:lineDiffs:)
andaddDiffHunksIntoDiffFile(_:diffHunks:)
), each containing information about a diff. Ifidentifier
is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff.func _getLineDiff(filePath: String, text: String
) -> VariantCollection<GDictionary> Returns an
GArray
ofGDictionary
items (seecreateDiffHunk(oldStart:newStart:oldLines:newLines:)
), each containing a line diff between a file atfilePath
and thetext
which is passed in.func _getModifiedFilesData(
) -> VariantCollection<GDictionary> Returns an
GArray
ofGDictionary
items (seecreateStatusFile(filePath:changeType:area:)
), each containing the status data of every modified file in the project folder.func _getPreviousCommits(maxCommits: Int32
) -> VariantCollection<GDictionary> Returns an
GArray
ofGDictionary
items (seecreateCommit(msg:author:id:unixTimestamp:offsetMinutes:)
), each containing the data for a past commit.func _getRemotes(
) -> VariantCollection<String> Returns an
GArray
ofString
s, each containing the name of a remote configured in the VCS.func _getVcsName(
) -> String Returns the name of the underlying VCS provider.
func _initialize(projectPath: String
) -> Bool Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at
projectPath
.func _pull(remote: String
) Pulls changes from the remote. This can give rise to merge conflicts.
func _push(remote: String, force: Bool
) Pushes changes to the
remote
. Ifforce
istrue
, a force push will override the change history already present on the remote.func _removeBranch(branchName: String
) Remove a branch from the local VCS.
func _removeRemote(remoteName: String
) Remove a remote from the local VCS.
func _setCredentials(username: String, password: String, sshPublicKeyPath: String, sshPrivateKeyPath: String, sshPassphrase: String
) Set user credentials in the underlying VCS.
username
andpassword
are used only during HTTPS authentication unless not already mentioned in the remote URL.sshPublicKeyPath
,sshPrivateKeyPath
, andsshPassphrase
are only used during SSH authentication.func _shutDown(
) -> Bool Shuts down VCS plugin instance. Called when the user either closes the editor or shuts down the VCS plugin through the editor UI.
func _stageFile(filePath: String
) Stages the file present at
filePath
to the staged area.func _unstageFile(filePath: String
) Unstages the file present at
filePath
from the staged area to the unstaged area.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.