# First, the context in which we are working:
# :vcs_info:<vcs-string>
# ...where <vcs-string> is one of:
-# - git, git-svn, hg, darcs, bzr, mtn, svn or svk
+# - git, git-svn, hg, darcs, bzr, mtn, svn, cvs or svk
#
# You can of course use ':vcs_info:*' to match all VCSs at once.
#
printf '%s' ${msg}
}
# }}}
+VCS_INFO_cvs_get_data () { # {{{
+ local msg cvsbranch cvsbase basename
+
+ cvsbase="."
+ while [[ -d "${cvsbase}/../CVS" ]]; do
+ cvsbase="${cvsbase}/.."
+ done
+ cvsbase=$(VCS_INFO_realpath ${cvsbase})
+ cvsbranch=$(< ./CVS/Repository)
+ basename=${cvsbase:t}
+ cvsbranch=${cvsbranch##${basename}/}
+ [[ -z ${cvsbranch} ]] && cvsbranch=${basename}
+
+ msg=$(VCS_INFO_format)
+ zformat -f msg "${msg}" "a:" "b:${cvsbranch}" "s:${vcs}" "r:${basename}" "R:${cvsbase}"
+ printf '%s' ${msg}
+}
+# }}}
# VCS_INFO_*_detect () {{{
VCS_INFO_detect_by_dir() {
return $?
}
+VCS_INFO_cvs_detect() {
+ check_com -c svn || return 1
+ [[ -d "CVS" ]] && return 0
+ return 1
+}
+
VCS_INFO_darcs_detect() {
check_com -c darcs || return 1
vcs_comm[detect_need_file]=format
zstyle -T ":vcs_info:${vcs}" "enable" || return 0
zstyle -a ":vcs_info:${vcs}" "disable" disabled
- VCSs=(git hg bzr darcs mtn svn svk)
+ VCSs=(git hg bzr darcs mtn svn cvs svk)
(( found = 0 ))
for vcs in ${VCSs} ; do