How do I identify what branches exist in CVS?

前端 未结 6 701
一个人的身影
一个人的身影 2021-02-04 00:12

I have a legacy CVS repository which shall be migrated to Perforce.

For each module, I need to identify what branches exist in that module.

I just want a list of

6条回答
  •  情书的邮戳
    2021-02-04 00:53

    I have a small collection of "handy" korn shell functions one of which fetches tags for a given file. I've made a quick attempt to adapt it to do what you want. It simply does some seding/greping of the (r)log output and lists versions which have ".0." in them (which indicates that it's a branch tag):

    get_branch_tags()
    {
        typeset FILE_PATH=$1
    
        TEMP_TAGS_INFO=/tmp/cvsinfo$$
    
        /usr/local/bin/cvs rlog $FILE_PATH 1>${TEMP_TAGS_INFO} 2>/dev/null
    
        TEMPTAGS=`sed -n '/symbolic names:/,/keyword substitution:/p' ${TEMP_TAGS_INFO} | grep "\.0\." | cut -d: -f1 | awk '{print $1}'`
        TAGS=`echo $TEMPTAGS | tr ' ' '/'`
        echo ${TAGS:-NONE}
        rm -Rf $TEMP_TAGS_INFO 2>/dev/null 1>&2
    }
    

提交回复
热议问题