您的位置:軟件測試 > 開源軟件測試 > 開源配置管理工具 > cvs
CVSRCSHOWTO原始程式碼版本控制系統(tǒng)
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2013/2/21 14:22:42 ] 推薦標(biāo)簽:

4.7 sinfo

注意 : Korn shell /bin/ksh 在你從Linux CD-ROM 安裝 pdksh*.rpm 時會產(chǎn)生

請把他存成一般文字檔并改變存取權(quán)限 chmod a+rx
--------------------------------------------------------------------------------

#!/bin/ksh

# CVS program sinfo
# Program to get the status of files in working directory

cmdname=`basename $0`

if [ $# -lt 1 ]; then
        print " Usage: $cmdname [file/directory name] "
        print "For example - "
        print " $cmdname foo.cpp"
        print " $cmdname some_directory "
        print " "
        exit
fi

hme=` echo $HOME | cut -f1 -d' '  `
if [ "$hme" = "" ]; then
        print " Error: $HOME is not set!! "
        exit
fi

tmpfile=$hme/cvs_sinfo.tmp
rm -f $tmpfile
cur_dir=`pwd`
#echo $cur_dir

len=${#hme}
len=$(($len + 2))
#echo $len

subdir=` echo $cur_dir | cut -b $len-2000 `
#echo $subdir

if [ "$subdir" = "" ]; then
        fdname=$1
else
        fdname=$subdir"/"$1
fi

# Create subshell
if [ -f $1 ]; then
        (
        cd $hme
        clear
        cvs status $fdname
        )
elif [ -d $1 ]; then
        (
        cd $hme
        clear
        echo "  " >> $tmpfile
        echo "  ****************************************" >> $tmpfile
        echo "        Overall Status of Directory" >> $tmpfile
        echo "  ****************************************" >> $tmpfile
        cvs release $fdname 1>>$tmpfile 2>>$tmpfile << EOF
Y
EOF
        echo "    ------------------------------- " >> $tmpfile

        aa=`cat $tmpfile | grep ^"M " | awk '{print $2}' `
        for ii in $aa
        do
                jj="(cd $hme; cvs status $subdir/$ii );"
                echo $jj | /bin/sh 
                        | grep -v Sticky | awk '{if (NF != 0) print $0}'
                        1>>$tmpfile 2>>$tmpfile
        done

        cat $tmpfile | grep -v ^? | grep -v "Are you sure you want to release"
        | less
        rm -f $tmpfile
        )
else
        print " Argument $1 if not a file or directory"
        exit
fi
--------------------------------------------------------------------------------

4.8 slog

注意 : Korn shell /bin/ksh 在你從Linux CD-ROM 安裝 pdksh*.rpm 時會產(chǎn)生

請把他存成一般文字檔并改變存取權(quán)限 chmod a+rx
--------------------------------------------------------------------------------

#!/bin/ksh

# CVS program slog
# Program to list history of the file in CVS

cmdname=`basename $0`

if [ $# -lt 1 ]; then
        print " Usage: $cmdname  "
        exit
fi

# Check if file does not exist....
if [ ! -f $1 ]; then
        print " Error: $1 is NOT a file. Aborting $cmdname ......"
        exit
fi

cvs log $1 | /usr/local/bin/less

print " Done $cmdname. $cmdname successful"
#print " Tip (Usage): $cmdname "
--------------------------------------------------------------------------------

4.9 sdif

注意 : Korn shell /bin/ksh 在你從Linux CD-ROM 安裝 pdksh*.rpm 時會產(chǎn)生

請把他存成一般文字檔并改變存取權(quán)限 chmod a+rx
--------------------------------------------------------------------------------

#!/bin/ksh

# CVS program sdif
# Program to see difference of the working file with CVS copy

cmdname=`basename $0`

Usage()
{
        print " Usage: $cmdname  "
        print "$cmdname -r -r  "
        exit
}
FLAG1=""
FLAG2=""
OARG1=""
OARG2=""
# Command getopt will not supported in next major release.
# Use getopts instead.
while getopts r:r: ii
do
        case $ii in
        r)
                if [ "$FLAG1" = "" ]; then
                        FLAG1=$ii;
                        OARG1="$OPTARG"
                else
                        FLAG2=$ii;
                        OARG2="$OPTARG"
                fi
                ;;
        ?) Usage; exit 2;;
        esac
done
shift ` expr $OPTIND - 1 `

if [ "$FLAG2" = "" ]; then
        FLAG2=r
        OARG2=HEAD
fi

if [ "$FLAG1" = "" ]; then
        cvs diff -r HEAD $1 | less
else
        cvs diff -$FLAG1 $OARG1 -$FLAG2 $OARG2 $1 | less
fi
--------------------------------------------------------------------------------

4.10 sadd

注意 : Korn shell /bin/ksh 在你從Linux CD-ROM 安裝 pdksh*.rpm 時會產(chǎn)生

請把他存成一般文字檔并改變存取權(quán)限 chmod a+rx
--------------------------------------------------------------------------------

#!/bin/ksh

# test
# CVS program sadd
# Program to add the file to CVS

cmdname=`basename $0`
if [ $# -lt 1 ]; then
        print " Usage: $cmdname  "
        exit
fi

# Check if file exists ....
if [ -f $1 ]; then
        cvs add $1
        exit
fi

if [ ! -d $1 ]; then
&n
--------------------------------------------------------------------------------

5. CVS 的其他文件

在 unix 提示符號下,請打 -

cvs --help
cvs --help-options
cvs --help-commands
cvs -H checkout
cvs -H commit
man cvs
man tkcvs
網(wǎng)站 http://www.cyclic.com
網(wǎng)站 http://www.loria.fr/~molli/cvs-index.html
(譯注:或者在 unix 提示符號下打 info cvs 也可得到一樣的訊息)
(譯注:這篇也不錯簡單明了) http://www.csc.calpoly.edu/~dbutler/tutorials/winter96/cvs/
tkcvs http://www.tkcvs.org是 CVS 的 Tcl/Tk GUI 介面。這里也有線上求助。

cd $HOME/src/foo.cpp
tkcvs
在 foo.cpp 上點一下
在 'spectacle Icon' 旁邊的 'Revision Log Icon' 點一下。
這將會顯示一個 Tree 組織的圖在視窗里。然後在文字 '1.3' 上用滑鼠的右鍵點一下還有 '1.1' 滑鼠的左鍵點一下,然後再點一下 "Diff" 。這樣將會顯示兩個視窗出來!!
在 "Next" 上點一下將會顯示更多版本'1.3' 與 '1.1' 的 diffs。 請按 "Center" 將文字對齊置中。 (譯注:這邊原文好像有脫誤)
這里也有 Windows 95 用的 CVS 喔,叫 WinCVS。 http://www.wincvs.org WinCVS 可以用在 Samba 系統(tǒng)上喔 - http://www.samba.org

基本重要的命令 -

cvs checkout 
cvs update 
cvs add 
cvs remove 
cvs commit 
cvs status 
cvs log 
cvs diff -r1.4 -r1.5  這行指令將會輸出檔案 filename 1.4 版和 1.5 版的差異在哪里。

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

6. Emacs 編輯器

Emacs 是非常強(qiáng)大的編輯器而且還支援了 CVS/RCS - 尤其是對於改版後的合并和比較。 Emacs的主要網(wǎng)站在 http://www.emacs.org.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

7. 問題反應(yīng)系統(tǒng) (Problem Reporting System)

伴隨著 CVS 的使用,你可能會想要用計劃追蹤系統(tǒng)(Project Tracking system)或問題反應(yīng)系統(tǒng)(Problem Reporting System)。每一個軟體計劃需要問題反應(yīng)系統(tǒng)來作 bugs 的回報與追蹤,并且把相關(guān)負(fù)責(zé)部分,分配給不同的程式設(shè)計師。

想知道計劃追蹤系統(tǒng)(Project Tracking system)請看這個網(wǎng)站http://www.stonekeep.com。

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

8. 這份文件的其他檔案格式

這份文件用了將近 10 個不同的檔案格式來發(fā)行 - DVI, Postscript, Latex, LyX, GNU-info, HTML, RTF(Rich Text Format), Plain-text, Unix man pages and SGML。
你可以在下面的 Web 獲得單一的 HTML, DVI, Postscript or SGML 型式的 tar.gz 檔案, ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/或者 ftp://metalab.unc.edu/pub/Linux/docs/HOWTO/other-formats/
Plain text 格式的在: ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO,或者 ftp://metalab.unc.edu/pub/Linux/docs/HOWTO
翻譯成其他語言像是法文,德文,西班牙文,中文,日文等等可在下面網(wǎng)址找得到。 ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO 或者 ftp://metalab.unc.edu/pub/Linux/docs/HOWTO 對於任何想翻譯這份文件到其他語言是都?xì)g迎的。
這份文件是用一種叫 "SGML" 的工具寫成的。你可以從下列網(wǎng)址得到 - http://www.xs4all.nl/~cg/sgmltools/ 編譯原始碼後,你會得到下列命令,像是
sgml2html cvs-rcs-howto.sgml (產(chǎn)生 html 檔案)
sgml2rtf cvs-rcs-howto.sgml (產(chǎn)生 RTF 檔案)
sgml2latex cvs-rcs-howto.sgml (產(chǎn)生 latex 檔案)
這份文件是位於 -

http://sunsite.unc.edu/LDP/HOWTO/CVS-RCS-HOWTO.html
你也可以在下面映射網(wǎng)站找到這份文件 -

http://www.caldera.com/LDP/HOWTO/CVS-RCS-HOWTO.html
http://www.WGS.com/LDP/HOWTO/CVS-RCS-HOWTO.html
http://www.cc.gatech.edu/linux/LDP/HOWTO/CVS-RCS-HOWTO.html
http://www.redhat.com/linux-info/ldp/HOWTO/CVS-RCS-HOWTO.html
其他比較靠近你的映射網(wǎng)站 http://sunsite.unc.edu/LDP/hmirrors.html 選擇其中一個網(wǎng)站并到這個目錄 /LDP/HOWTO/CVS-RCS-HOWTO.html
想看 dvi 格式的文件,請用 xdvi 。若原本沒安裝,可在 Redhat Linux 下的 tetex-xdvi*.rpm 套件中找得到。要不然可以經(jīng)由桌面上的ControlPanel | Applications | Publishing | TeX menu buttons找到他。

想看 dvi 格式的文件,請下命令 -
                xdvi -geometry 80x90 howto.dvi,
并且用滑鼠調(diào)整視窗大小。請看 xdvi 的線上求助 man xdvi。
使用方向鍵, Page Up, Page Down 來檢視文件。你也可以用 'f', 'd', 'u', 'c', 'l', 'r', 'p', 'n'來移動。
要關(guān)掉專家模式 menu 請按 x 。

你可以用軟體 'gv' (ghostview) 或 'ghostscript' 來讀 postscript 檔案。
在 Redhat Linux 下,ghostscript 在 ghostscript*.rpm 套件里, gv 在 gv*.rpm 套件里,如果你已經(jīng)裝了這個應(yīng)用程式,可以透過 ControlPanel | Applications | Graphics menu 里找到, gv 是比 ghostscript 更友善使用。Ghostscript 和 gv 也可以在其他作業(yè)平臺如 OS/2, windows 95 和 NT 下使用。

要讀 postscript 文件,請下這個命令 -
       gv howto.ps

 用 ghostscript 請打 -
       ghostscript howto.ps

你可以用 Netscape Navigator, Microsoft Internet explorer, Redhat Baron Web browser 或其他瀏覽器來讀 HTML 格式的文件。

你可以用一個 latex 的 "X-Windows" 介面軟體叫做 LyX 的,來讀 latex 或 LyX 的輸出。
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

9. 版權(quán)

這份文件版權(quán)為 GNU GPL,但是請在所有的復(fù)制中保留原作者的名字與電子郵件地址。

上一頁1234下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd