Version control branch info prompt formatter (xonsh.prompt.vc
)¶
Prompt formatter for simple version control branches
-
xonsh.prompt.vc.
branch_bg_color
()[source]¶ Return red if the current branch is dirty, yellow if the dirtiness can not be determined, and green if it clean. These are background colors.
-
xonsh.prompt.vc.
branch_color
()[source]¶ Return red if the current branch is dirty, yellow if the dirtiness can not be determined, and green if it clean. These are bold, intense colors for the foreground.
-
xonsh.prompt.vc.
current_branch
()[source]¶ Gets the branch for a current working directory. Returns an empty string if the cwd is not a repository. This currently only works for git and hg and should be extended in the future. If a timeout occurred, the string ‘<branch-timeout>’ is returned.
-
xonsh.prompt.vc.
dirty_working_directory
()[source]¶ Returns a boolean as to whether there are uncommitted files in version control repository we are inside. If this cannot be determined, returns None. Currently supports git and hg.
-
xonsh.prompt.vc.
get_git_branch
()[source]¶ Attempts to find the current git branch. If this could not be determined (timeout, not in a git repo, etc.) then this returns None.
-
xonsh.prompt.vc.
get_hg_branch
(root=None)[source]¶ Try to get the mercurial branch of the current directory, return None if not in a repo or subprocess.TimeoutExpired if timed out.