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, hg, and fossil 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.fossil_dirty_working_directory()[source]

Returns whether the fossil checkout is dirty. If this could not be determined (timeout, file not found, etc.) then this returns None.

xonsh.prompt.vc.get_fossil_branch()[source]

Attempts to find the current fossil branch. If this could not be determined (timeout, not in a fossil checkout, etc.) then this returns None.

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.

xonsh.prompt.vc.git_dirty_working_directory()[source]

Returns whether or not the git directory is dirty. If this could not be determined (timeout, file not found, etc.) then this returns None.

xonsh.prompt.vc.hg_dirty_working_directory()[source]

Computes whether or not the mercurial working directory is dirty or not. If this cannot be determined, None is returned.