Foundry.Vcs

g Foundry.Contextual Foundry.Contextual Foundry.Vcs Foundry.Vcs Foundry.Contextual->Foundry.Vcs GObject.GInterface GObject.GInterface Json.Serializable Json.Serializable GObject.GInterface->Json.Serializable GObject.Object GObject.Object GObject.Object->Foundry.Contextual Json.Serializable->Foundry.Contextual

Subclasses:

Foundry.GitVcs, Foundry.NoVcs

Methods

Inherited:

Foundry.Contextual (4), GObject.Object (37), Json.Serializable (8)

Structs:

GObject.ObjectClass (5)

blame (file, bytes)

describe_line_changes (file, contents)

diff (tree_a, tree_b)

dup_branch_name ()

dup_id ()

dup_name ()

emit_tip_changed ()

fetch (remote, operation)

find_commit (id)

find_file (file)

find_remote (name)

find_tree (id)

get_active ()

get_priority ()

is_file_ignored (file)

is_ignored (relative_path)

list_branches ()

list_commits_with_file (file)

list_files ()

list_remotes ()

list_tags ()

load_tip ()

query_file_status (file)

Virtual Methods

Inherited:

GObject.Object (7), Json.Serializable (5)

do_blame (file, bytes)

do_describe_line_changes (file, contents)

do_diff (tree_a, tree_b)

do_dup_branch_name ()

do_dup_id ()

do_dup_name ()

do_fetch (remote, operation)

do_find_commit (id)

do_find_file (file)

do_find_remote (name)

do_find_tree (id)

do_get_priority ()

do_is_file_ignored (file)

do_is_ignored (relative_path)

do_list_branches ()

do_list_commits_with_file (file)

do_list_files ()

do_list_remotes ()

do_list_tags ()

do_load_tip ()

do_query_file_status (file)

Properties

Inherited:

Foundry.Contextual (1)

Name

Type

Flags

Short Description

active

bool

r

branch-name

str

r

id

str

r

name

str

r

priority

int

r

provider

Foundry.VcsProvider

r

Signals

Inherited:

GObject.Object (1)

Name

Short Description

tip-changed

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Foundry.Contextual

r

Class Details

class Foundry.Vcs(**kwargs)
Bases:

Foundry.Contextual

Abstract:

Yes

Structure:

Foundry.VcsClass

Abstract base class for plugins to implement support for a VCS.

blame(file, bytes)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsBlame] or rejects with error

Return type:

Dex.Future

describe_line_changes(file, contents)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsLineChanges] or rejects with error.

Return type:

Dex.Future

diff(tree_a, tree_b)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsDiff] or rejects with error.

Return type:

Dex.Future

Diffs two [class`Foundry`.VcsTree] resulting in a [class`Foundry`.VcsDiff]

dup_branch_name()
Returns:

a string containing the branch name

Return type:

str

Gets the name of the branch such as “main”.

dup_id()
Returns:

a string containing the identifier

Return type:

str

Gets the identifier for the VCS such as “git” or “none”.

dup_name()
Returns:

a string containing the name

Return type:

str

Gets the name of the vcs in title format such as “Git”

emit_tip_changed()

Emits the “tip-changed” signal. This method is intended for use by subclasses to notify when the tip (most recent commit) has changed.

New in version 1.1.

fetch(remote, operation)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future

find_commit(id)
Parameters:

id (str) – the identifier of the commit

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsCommit].

Return type:

Dex.Future

Finds a commit by identifier

find_file(file)
Parameters:

file (Gio.File) – the file to locate

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsFile] or rejects with error

Return type:

Dex.Future

find_remote(name)
Parameters:

name (str) – the name of the remote

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsRemote].

Return type:

Dex.Future

find_tree(id)
Parameters:

id (str) – the identifier of the tree

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsTree].

Return type:

Dex.Future

Finds a [class`Foundry`.VcsTree] by tree identifier

get_active()
Return type:

bool

get_priority()
Return type:

int

is_file_ignored(file)
Parameters:

file (Gio.File) –

Return type:

bool

is_ignored(relative_path)
Parameters:

relative_path (str) –

Return type:

bool

list_branches()
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.VcsBranch].

Return type:

Dex.Future

list_commits_with_file(file)
Parameters:

file (Foundry.VcsFile) – a [class`Foundry`.VcsFile]

Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.VcsCommit]

Return type:

Dex.Future

list_files()
Returns:

a [class`Dex`.Future] that resolves to [iface`Gio`.ListModel] of [class`Foundry`.VcsFile].

Return type:

Dex.Future

List all files in the repository.

It is not required that implementations return files that are not indexed in their caches from this method.

list_remotes()
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.VcsRemote].

Return type:

Dex.Future

list_tags()
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.VcsTag].

Return type:

Dex.Future

load_tip()
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsCommit] or rejects with error.

Return type:

Dex.Future

Loads the tip (most recent commit) from the repository.

New in version 1.1.

query_file_status(file)
Parameters:

file (Gio.File) –

Returns:

a [class`Dex`.Future] that resolves to a [flags`Foundry`.VcsFileStatus] or rejects with error.

Return type:

Dex.Future

Queries the state of file in the repository.

do_blame(file, bytes) virtual
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsBlame] or rejects with error

Return type:

Dex.Future

do_describe_line_changes(file, contents) virtual
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsLineChanges] or rejects with error.

Return type:

Dex.Future

do_diff(tree_a, tree_b) virtual
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsDiff] or rejects with error.

Return type:

Dex.Future

Diffs two [class`Foundry`.VcsTree] resulting in a [class`Foundry`.VcsDiff]

do_dup_branch_name() virtual
Returns:

a string containing the branch name

Return type:

str

Gets the name of the branch such as “main”.

do_dup_id() virtual
Returns:

a string containing the identifier

Return type:

str

Gets the identifier for the VCS such as “git” or “none”.

do_dup_name() virtual
Returns:

a string containing the name

Return type:

str

Gets the name of the vcs in title format such as “Git”

do_fetch(remote, operation) virtual
Parameters:
Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future

do_find_commit(id) virtual
Parameters:

id (str) – the identifier of the commit

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsCommit].

Return type:

Dex.Future

Finds a commit by identifier

do_find_file(file) virtual
Parameters:

file (Gio.File) – the file to locate

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsFile] or rejects with error

Return type:

Dex.Future

do_find_remote(name) virtual
Parameters:

name (str) – the name of the remote

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsRemote].

Return type:

Dex.Future

do_find_tree(id) virtual
Parameters:

id (str) – the identifier of the tree

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsTree].

Return type:

Dex.Future

Finds a [class`Foundry`.VcsTree] by tree identifier

do_get_priority() virtual
Return type:

int

do_is_file_ignored(file) virtual
Parameters:

file (Gio.File) –

Return type:

bool

do_is_ignored(relative_path) virtual
Parameters:

relative_path (str) –

Return type:

bool

do_list_branches() virtual
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.VcsBranch].

Return type:

Dex.Future

do_list_commits_with_file(file) virtual
Parameters:

file (Foundry.VcsFile) – a [class`Foundry`.VcsFile]

Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.VcsCommit]

Return type:

Dex.Future

do_list_files() virtual
Returns:

a [class`Dex`.Future] that resolves to [iface`Gio`.ListModel] of [class`Foundry`.VcsFile].

Return type:

Dex.Future

List all files in the repository.

It is not required that implementations return files that are not indexed in their caches from this method.

do_list_remotes() virtual
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.VcsRemote].

Return type:

Dex.Future

do_list_tags() virtual
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.VcsTag].

Return type:

Dex.Future

do_load_tip() virtual
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.VcsCommit] or rejects with error.

Return type:

Dex.Future

Loads the tip (most recent commit) from the repository.

New in version 1.1.

do_query_file_status(file) virtual
Parameters:

file (Gio.File) –

Returns:

a [class`Dex`.Future] that resolves to a [flags`Foundry`.VcsFileStatus] or rejects with error.

Return type:

Dex.Future

Queries the state of file in the repository.

Signal Details

Foundry.Vcs.signals.tip_changed(vcs)
Signal Name:

tip-changed

Flags:

RUN_LAST

Parameters:

vcs (Foundry.Vcs) – The object which received the signal

Property Details

Foundry.Vcs.props.active
Name:

active

Type:

bool

Default Value:

False

Flags:

READABLE

Foundry.Vcs.props.branch_name
Name:

branch-name

Type:

str

Default Value:

None

Flags:

READABLE

Foundry.Vcs.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE

Foundry.Vcs.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE

Foundry.Vcs.props.priority
Name:

priority

Type:

int

Default Value:

0

Flags:

READABLE

Foundry.Vcs.props.provider
Name:

provider

Type:

Foundry.VcsProvider

Default Value:

None

Flags:

READABLE