From e688ca5f1cb126f3da3f601e169abfbbda6a8fdf Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 10 Aug 2016 10:59:03 +1200 Subject: 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) --- bash/bashrc.d/prompt.bash | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'bash/bashrc.d/prompt.bash') 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) -- cgit v1.2.3