diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-10 10:59:03 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-10 10:59:03 +1200 |
commit | e688ca5f1cb126f3da3f601e169abfbbda6a8fdf (patch) | |
tree | 0e2f56833eb1a2455fa0c4a26ed21a572270c077 | |
parent | Improve commenting/exit handling in binscripts (diff) | |
download | dotfiles-e688ca5f1cb126f3da3f601e169abfbbda6a8fdf.tar.gz dotfiles-e688ca5f1cb126f3da3f601e169abfbbda6a8fdf.zip |
Remove Mercurial support from Bash prompt
Since Vim and Fanboy's list both moved to Git, I have no reason to use
it anymore. Also added a note explaining why I've left the SVN stuff in
there (I don't like SVN, but I do need to use it for work)
-rw-r--r-- | README.markdown | 4 | ||||
-rw-r--r-- | bash/bashrc.d/prompt.bash | 37 |
2 files changed, 2 insertions, 39 deletions
diff --git a/README.markdown b/README.markdown index 0c7035a8..9cf87d56 100644 --- a/README.markdown +++ b/README.markdown @@ -146,8 +146,8 @@ A terminal session with my prompt looks something like this: It expands based on context to include these elements in this order: * Whether in a Git repository if applicable, and punctuation to show whether - there are local modifications at a glance; Subversion and Mercurial support - can also be enabled + there are local modifications at a glance; Subversion support can also be + enabled (I need it at work) * The number of running background jobs, if non-zero * The exit status of the last command, if non-zero diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index bef80733..ba678909 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -148,43 +148,6 @@ prompt() { (IFS= ; printf '(git:%s%s)' "${branch:-unknown}" "${state[*]}") ;; - # Mercurial prompt function - hg) - # Bail if we have no hg(1) - if ! hash hg 2>/dev/null ; then - return 1 - fi - - # Exit if not inside a Mercurial tree - local branch - if ! branch=$(hg branch 2>/dev/null) ; then - return 1 - fi - - # Safely read status with -0 - local line - local -i modified untracked - while IFS= read -rd '' line ; do - if [[ $line == '?'* ]] ; then - untracked=1 - else - modified=1 - fi - done < <(hg status -0 2>/dev/null) - - # Build state array from status output flags - local -a state - if ((modified)) ; then - state[${#state[@]}]='!' - fi - if ((untracked)) ; then - state[${#state[@]}]='?' - fi - - # Print the status in brackets with an hg: prefix - (IFS= ; printf '(hg:%s%s)' "${branch:-unknown}" "${state[*]}") - ;; - # Subversion prompt function svn) # Bail if we have no svn(1) |