summaryrefslogtreecommitdiff
path: root/zshfunc/vcs-info/VCS_INFO_cvs_get_data
blob: b8b9ad33eceeab9ec28425d6b5ca61cc45d0f8f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
VCS_INFO_cvs_get_data () { # {{{
    local 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}
    VCS_INFO_formats '' "${cvsbranch}" "${cvsbase}"
    return 0
}