repo_control_screen
File containing functions used by the repository specific CUI screen.
This file is meant to handle the intermediate considerations between the CUI and the underlying git commands found in pyautogit.commands
Author: Jakub Wlodek
Created: 01-Oct-2019
Classes
Class | Doc |
---|---|
RepoControlManager(pyautogit.screen_manager.ScreenManager) | Class responsible for managing functions for the repository control screen. |
RepoControlManager(pyautogit.screen_manager.ScreenManager)
class RepoControlManager(pyautogit.screen_manager.ScreenManager)
Class responsible for managing functions for the repository control screen.
This class contains functions that are used by pyautogit for individual repository control. It provides the interface between the CUI widgets for the repository control screen and the pyautogit.commands module.
Attributes
Attribute | Type | Doc |
---|---|---|
menu_choices | list of str | Overriden list of menu choices accessible from the repository control menu |
Methods
Method | Doc |
---|---|
process_menu_selection | Override of base class, executes based on user menu selection |
initialize_screen_elements | Function that initializes the widgets for the repo control screen. Override of base class function |
clear_elements | Function that clears elements of repo control window |
set_initial_values | Function that initializes status bar and info text for repo control window |
refresh_status | Function that refreshes a git repository status |
get_repo_status_short | Gets shorthand repository status |
get_repo_remotes | Gets list of repository remotes |
show_branches | Function that swaps to showing branches |
get_repo_branches | Gets list of repository branches |
show_tags | Function that swaps to showing tags |
get_repo_tags | Gets list of repository tags |
show_remote_info | Gets info about remote |
show_commit_info | Gets info about a particular commit |
get_recent_commits | Gets list of recent commits to branch |
create_new_tag | Creates a new tag |
show_log | Displays the git log |
show_tree | Displays git log as a tree |
stash_all_changes | Stashes all repo changes |
unstash_all_changes | Pops the stash |
open_git_diff | Opens current git diff state |
open_git_diff_file | Gets the diff for a selected file |
open_editor | Opens an external editor if selected |
open_editor_file | Opens an external editor for a selected file |
add_all_changes | Adds all changes to staging |
add_revert_file | Adds/Reverts single file from staging |
ask_new_remote_name | Opens text box to enter new remote name |
ask_new_remote_url | Opens text box to ask new remote url |
add_remote | Adds remote to git repo |
delete_remote | Deletes selected remote from local repo |
rename_remote | Renames selected remote from local repo |
commit | Commits currently staged items |
pull_repo_branch | Pulls from remote |
push_repo_branch | Pushes to remote |
create_new_branch | Creates new branch for repository |
delete_branch | Deletes selected branch |
checkout_branch | Checks out specified branch |
merge_branches | Merges selected branch into the currently checked out branch |
revert_merge | Undos the merge that was just performed |
checkout_commit | Checks out specified commit |
show_help_overview | Function that displays help message for overview mode. |
show_help_add_files_menu | Function that displays help message for the add files menu. |
show_help_remotes_menu | Function that displays help message for the add files menu. |
show_help_branch_menu | Function that displays help message for the add files menu. |
show_help_commits_menu | Function that displays help message for the add files menu. |
init
def __init__(self, top_manager)
Constructor for the RepoControlManager class
process_menu_selection
def process_menu_selection(self, selection)
Override of base class, executes based on user menu selection
Parameters
Parameter | Type | Doc |
---|---|---|
selection | str | User selection from menu |
initialize_screen_elements
def initialize_screen_elements(self)
Function that initializes the widgets for the repo control screen. Override of base class function
Returns
Return Variable | Type | Doc |
---|---|---|
repo_control_widget_set | py_cui.widget_set.WidgetSet | Widget set object for repo control screen |
clear_elements
def clear_elements(self)
Function that clears elements of repo control window
set_initial_values
def set_initial_values(self)
Function that initializes status bar and info text for repo control window
refresh_status
def refresh_status(self)
Function that refreshes a git repository status
get_repo_status_short
def get_repo_status_short(self)
Gets shorthand repository status
get_repo_remotes
def get_repo_remotes(self)
Gets list of repository remotes
show_branches
def show_branches(self)
Function that swaps to showing branches
get_repo_branches
def get_repo_branches(self)
Gets list of repository branches
show_tags
def show_tags(self)
Function that swaps to showing tags
get_repo_tags
def get_repo_tags(self)
Gets list of repository tags
show_remote_info
def show_remote_info(self)
Gets info about remote
show_commit_info
def show_commit_info(self)
Gets info about a particular commit
get_recent_commits
def get_recent_commits(self)
Gets list of recent commits to branch
create_new_tag
def create_new_tag(self)
Creates a new tag
show_log
def show_log(self)
Displays the git log
show_tree
def show_tree(self)
Displays git log as a tree
stash_all_changes
def stash_all_changes(self)
Stashes all repo changes
unstash_all_changes
def unstash_all_changes(self)
Pops the stash
open_git_diff
def open_git_diff(self)
Opens current git diff state
open_git_diff_file
def open_git_diff_file(self)
Gets the diff for a selected file
open_editor
def open_editor(self, file=None)
Opens an external editor if selected
open_editor_file
def open_editor_file(self)
Opens an external editor for a selected file
add_all_changes
def add_all_changes(self)
Adds all changes to staging
add_revert_file
def add_revert_file(self)
Adds/Reverts single file from staging
ask_new_remote_name
def ask_new_remote_name(self)
Opens text box to enter new remote name
ask_new_remote_url
def ask_new_remote_url(self, remote_name)
Opens text box to ask new remote url
Parameters
Parameter | Type | Doc |
---|---|---|
remote_name | str | Remote name entered in previous textbox |
add_remote
def add_remote(self, remote_url)
Adds remote to git repo
Parameters
Parameter | Type | Doc |
---|---|---|
remote_url | str | URL entered by user |
delete_remote
def delete_remote(self)
Deletes selected remote from local repo
rename_remote
def rename_remote(self)
Renames selected remote from local repo
commit
def commit(self)
Commits currently staged items
pull_repo_branch
def pull_repo_branch(self)
Pulls from remote
push_repo_branch
def push_repo_branch(self)
Pushes to remote
create_new_branch
def create_new_branch(self)
Creates new branch for repository
delete_branch
def delete_branch(self)
Deletes selected branch
checkout_branch
def checkout_branch(self)
Checks out specified branch
merge_branches
def merge_branches(self)
Merges selected branch into the currently checked out branch
revert_merge
def revert_merge(self)
Undos the merge that was just performed
checkout_commit
def checkout_commit(self)
Checks out specified commit
show_help_overview
def show_help_overview(self)
Function that displays help message for overview mode.
show_help_add_files_menu
def show_help_add_files_menu(self)
Function that displays help message for the add files menu.
show_help_remotes_menu
def show_help_remotes_menu(self)
Function that displays help message for the add files menu.
show_help_branch_menu
def show_help_branch_menu(self)
Function that displays help message for the add files menu.
show_help_commits_menu
def show_help_commits_menu(self)
Function that displays help message for the add files menu.