您的位置:軟件測試 > 開源軟件測試 > 開源配置管理工具 > cvs
CVS-RCS
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時(shí)間:[ 2013/1/25 16:19:35 ] 推薦標(biāo)簽:

3.2 從 RCS 轉(zhuǎn)換到 CVS 系統(tǒng)

要轉(zhuǎn)換已經(jīng)存在的 RCS 檔案到 CVS ,請使用下面的 script 。并確定你從你的
Linux CD-ROM 安裝了 korn shell 套件 pdksh*.rpm。

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

_________________________________________________________________

#!/bin/ksh

#############################################################
# Program to Migrate the existing source code in RCS to CVS
#
# Needs the korn shell RPM package pdksh*.rpm from Linux
# contrib cdrom
#############################################################

#
# rcs2cvs - convert source tree from RCS to CVS
#

# project to convert
PROJECT='project'

# current RCS root
RCSROOT="$HOME/rcs"

if cd "$RCSROOT/$PROJECT"
then
cd "$RCSROOT"
else
echo >&2 "`basename "$0"`: can't change to RCS directory '$RCSROOT/$PRO
JECT'."
exit 1
fi

# current CVS root
CVSROOT="$HOME/cvs"

# create new CVS directory for project 'project'
if mkdir "$CVSROOT/$PROJECT"
then
:
else
echo >&2 "`basename "$0"`: can't create CVS directory '$CVSROOT/$PROJEC
T'."
exit 2
fi

# create CVS project tree from RCS tree
find "$PROJECT" -type d -name RCS -print |
while read RCS
do
CVS="`dirname "$RCS"`"
(if cd "$RCS"
then
# if find . -type f -name '*,v' -print | cpio -pdmv "$CVSROOT/$CV
S"
if find . -type f -print | cpio -pdmv "$CVSROOT/$CVS"
then
:
else
echo >&2 "`basename "$0"`: can't convert RCS subdirecto
ry '$RCSROOT/$RCS' to CVS subdirectory '$CVSROOT/$CVS'."
fi
else
echo >&2 "`basename "$0"`: can't change to RCS subdirectory '$R
CSROOT/$RCS'."
fi)
done
_________________________________________________________________

現(xiàn)在 RCS 已經(jīng)被改成 CVS 系統(tǒng)下的 'project'. 你可以開始用CVS命令來存取
'project' 這個(gè)模組了.
4. Shell Scripts

下面的 scripts 是基本 CVS 命令的集合,而且是 Korn shell 的 scripts 。你
可以把他轉(zhuǎn)成 perl 或者 bash。你可以自己修改成你想要的樣子。 這些只是運(yùn)
用基本 CVS 命令但有些特殊的花樣加在里面。例如, sedit 這個(gè) script 提供
了檔案鎖住的功能使得其他人知道有某人正在修改這個(gè)檔案, 當(dāng)然你也可以直接
使用 CVS 命令而不用這些 scripts ,這些 scripts 只是在展示 CVS 是多麼的
有彈性。

把這些 scripts 復(fù)制到 /usr/local/bin 下,并且此目錄應(yīng)該在你的 PATH 環(huán)境
變數(shù)中。
1. sget [-r revision_number] 要從 CVS 獲得一個(gè)唯
讀檔案或整個(gè)唯讀目錄, 請按 [9]sget
2. sedit [-r revision_number] 要修改一個(gè)一個(gè)程式碼時(shí),這個(gè)
scripts 會做檔案鎖住的動作,因此沒有別人可以登出這個(gè)檔案了。當(dāng)然你
可以改變這個(gè) script 成你想要的功能 - 例如不鎖住,只出現(xiàn)警告訊息,或
者相反的,非常嚴(yán)謹(jǐn)?shù)逆i檔案。 請按 [10]sedit
3. scommit [-r revision_number] 要交出某個(gè)你修改的檔案或整
個(gè)目錄。 把你的改變交給 CVS。 請按 [11]scommit
4. supdate 要藉由從 CVS 得到新的檔案來update 一
個(gè)檔案或整個(gè)目錄。 請按 [12]supdate
5. sunlock [-r revision_number] 要把因?yàn)橛?sedit 後的檔案鎖
關(guān)掉。這會釋放檔案鎖(Release File Lock)。 請按 [13]sunlock
6. slist 要看目前正被你修改的檔案列表。 做 'ls -l | grep | ...' 命令,
請按 [14]slist
7. sinfo 要得到一個(gè)檔案的改版資訊。 請按
[15]sinfo
8. slog 要得到一個(gè) CVS 檔案改版的歷史紀(jì)錄, 請按 [16]slog
9. sdif
sdif -r rev1 -r rev2 要得到你的檔案與 CVS 柜子里的檔案不
同的地方在哪里。 請按 [17]sdif
注意: sdif 只有一個(gè) 'f' ,因?yàn)檫@里已經(jīng)有一個(gè) unix 命令叫 'sdiff'。
10. sadd 要新增一個(gè)檔案到 CVS 柜子里。 請按 [18]sadd
11. sdelete 要從 CVS 柜子里清掉一個(gè)檔案。 請按 [19]sdelete
12. sfreeze 要凍結(jié)原始碼 (freeze
codes) ,這是將要發(fā)行 (release) 整個(gè)原始碼目錄樹。 請按
[20]sfreeze
13. saddtree 要新增一個(gè)目錄樹到 CVS 。
請按 [21]saddtree
例如 :
_____________________________________________________________

cd $HOME;
sfreeze REVISION_1_0 srctree
_____________________________________________________________

這將會凍結(jié)原始碼,并貼上一個(gè)標(biāo)簽 REVISION_1_0 ,如此一來你可以稍
後用版本名字登出整個(gè)目錄樹。

******************************************************

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