Skip to content

Commit

Permalink
[BUGFIX] newer versions of subversion clients support changelists and…
Browse files Browse the repository at this point in the history
… print the status information prepended with a "---Changelist" header -> skipping this line
  • Loading branch information
EvilBMP committed Aug 24, 2018
1 parent 3211258 commit 285f1ff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bash-prompt-vcs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,8 @@ bpvcs_bash_prompt() {
branch="${value}"
fi
# svn info returns 0 even if not a sandbox so parse error messages
done < <(svn info 2>&1)
done < <(LC_ALL=C svn info 2>&1)

local line
while IFS= read -r line ; do
line="${line/warning: /}" # normalize error output - remove "warning: " if existing
# Not a svn sandbox.
Expand All @@ -219,17 +218,22 @@ bpvcs_bash_prompt() {
return 0
fi

# ignore svn changelist output
if [[ "${line:0:14}" = "--- Changelist" ]]; then
continue
fi

case "${line:0:1}" in
A|M|R|D) ((changed++)) ;;
\?|!) ((untracked++)) ;;
" ") if [[ "${line:1:1}" = "M" ]]; then ((changed++)); fi ;;
# The following are all valid but ignored.
# Parse them to be able to detect bad output in the *) case.
C|I|X|~) ;;
""|C|I|X|~) ;;
*) error="unexpected svn status output"; return 0 ;;
esac
# svn status returns 0 even if not a sandbox so parse error messages
done < <(svn status --ignore-externals 2>&1)
done < <(LC_ALL=C svn status --ignore-externals 2>&1)

vcs="svn"
return 0
Expand Down

0 comments on commit 285f1ff

Please sign in to comment.