- PR_EXIT="%{$fg_bold[red]%}%(?..[%?] )%{$reset_color%}"
-
- # autofs always complains not being able to mount .hg/ and the like
- if echo "$autofs_mp" | /bin/grep -qe "^$PWD\s"; then
- vcs_info_msg_0_="[autofs]"
- else
- vcs_info
- fi
-
- PR_SCREEN=""
- if [[ -n "${WINDOW}" ]]; then
- PR_SCREEN=" S:${WINDOW}"
- fi
-
- PR_JOBS=""
- if [[ $(jobs | wc -l) -gt 0 ]]; then
- PR_JOBS=" J:%j"
- fi
+ PR_EXIT="%{$fg_bold[red]%}%(?..[%?] )%{$reset_color%}"
+
+ # Check whether current directory is a subdirectory of an autofs mountpoint
+ local parent="0"
+ vcs_info_msg_0_=""
+ for mp in ${autofs_mp}; do
+ # A parent directory is an autofs mount point
+ if echo "$PWD" | /bin/grep -q $mp; then
+ parent="1"
+ # Even equal!
+ if echo "$mp" | /bin/grep -q $PWD; then
+ vcs_info_msg_0_=" [autofs]"
+ fi
+ break;
+ fi
+ done
+
+ if [ -z "$vcs_info_msg_0_" ]; then
+ if [ "$parent" = "1" ]; then
+ # svn and hg cause complaints of autofs that .svn and .hg is no mount point
+ zstyle ':vcs_info:*' enable git cvs
+ else
+ zstyle ':vcs_info:*' enable git cvs svn hg
+ fi
+ vcs_info
+ fi
+
+ PR_SCREEN=""
+ if [[ -n "${WINDOW}" ]]; then
+ PR_SCREEN=" S:${WINDOW}"
+ fi
+
+ PR_JOBS=""
+ if [[ $(jobs | wc -l) -gt 0 ]]; then
+ PR_JOBS=" J:%j"
+ fi