cola.models.main – Main application model

Provides access to git data.

This module provides the central cola model.

class cola.models.main.MainModel(cwd=None)

Provides a friendly wrapper for doing common git operations.

all_branches()
apply_diff(filename)
apply_diff_font_size(default)
apply_diff_to_worktree(filename)
cherry_pick_list(revs, **kwargs)
Cherry-picks each revision into the current branch. Returns a list of command output strings (1 per cherry pick)
cola_config(key)
commit_with_msg(msg, amend=False)
Creates a git commit.
config_dict(local=True)
parses the lines from git config –list into a dictionary
config_params()
config_set(key=None, value=None, local=True)
create_branch(name, base, track=False)

Create a branch named ‘name’ from revision ‘base’

Pass track=True to create a local tracking branch.

delete_branch(branch)
describe(revid, descr)
editor()
enable_staging()
Whether staging should be allowed.
everything()
Returns a sorted list of all files, including untracked files.
gen_remote_helper(gitaction, push=False)
Generates a closure that calls git fetch, push or pull
generate_remote_helpers()
Generates helper methods for fetch, push and pull
getcwd()
If we’ve chosen a directory then use it, otherwise os.getcwd().
global_config(key, default=None)
gui_config(key)
history_browser()
is_commit_published()
local_config(key, default=None)
pad(pstr, num=22)
parse_stash_list(revids=False)
Parses “git stash list” and returns a list of stashes.
prev_commitmsg()
Queries git for the latest commit message.
read_font_sizes()
Read font sizes from the configuration.
read_only()
remember_gui_settings()
remote_args(remote, local_branch='', remote_branch='', ffwd=True, tags=False, rebase=False, push=False)
remote_url(name)
reset(*items)
revision_sha1(idx)
save_config_param(param)
set_diff_font(fontstr)
Set the diff font string.
set_remote(remote)
stage_all()
stage_modified()
stage_paths(paths)
Stages add/removals to git.
stage_untracked()
tmp_dir()
tmp_file_pattern()
tmp_filename(prefix='')
undoable()
Whether we can checkout files from the $head.
unstage_all()
update_status()
use_worktree(worktree)
cola.models.main.model()
Returns the main model singleton

Previous topic

cola.models.browser – RepoBrowser model

Next topic

cola.models.gitrepo – Git repo model

This Page