?? 12.htm
字號:
</PRE>
<HR>
<A name=s-cvs-trouble></A>
<H3>12.1.3 CVS常見問題及解決方法</H3>
<HR>
<A name=s12.1.3.1></A>
<H4>12.1.3.1 容器中的文件權限</H4>
<P>CVS不會覆蓋當前容器中的文件,而是用另一個文件替換它。因此,<EM>對容器目錄的寫權限</EM>是很危險的權限。所以在新建容器時,請運行下面的命令,確保權限合適。
<PRE> # cd <VAR>/var/lib/cvs</VAR>
# chown -R root:src <VAR>repository</VAR>
# chmod -R ug+rwX <VAR>repository</VAR>
# chmod 2775 <VAR>repository</VAR> # if needed, this and subdirectory
</PRE>
<HR>
<A name=s12.1.3.2></A>
<H4>12.1.3.2 執行標記(execution bit)</H4>
<P>當文件被別人取走后會保留執行標記,任何時候你遇到外出文件存在執行權限問題,可用下面的命令在CVS容器中修改文件權限。 <PRE> # chmod ugo-x <VAR>filename</VAR>
</PRE>
<HR>
<A name=s-cvs-short></A>
<H3>12.1.4 CVS命令</H3>
<P>這兒是一些CVS命令的用法簡介。 <PRE> {add|ad|new} [-k kflag] [-m 'message'] files...
{admin|adm|rcs} [rcs-options] files...
{annotate|ann} [options] [files...]
{checkout|co|get} [options] modules...
{commit|ci|com} [-lnR] [-m 'log_message' | -f file] \
[-r revision] [files...]
{diff|di|dif} [-kl] [rcsdiff_options] [[-r rev1 | -D date1] \
[-r rev2 | -D date2]] [files...]
{export|ex|exp} [-flNn] -r rev|-D date [-d dir] [-k kflag] module...
{history|hi|his} [-report] [-flags] [-options args] [files...]
{import|im|imp} [-options] repository vendortag releasetag...
{login|logon|lgn}
{log|lo|rlog} [-l] rlog-options [files...]
{rdiff|patch|pa} [-flags] [-V vn] [-r t|-D d [-r t2|-D d2]] modules...
{release|re|rel} [-d] directories...
{remove|rm|delete} [-lR] [files...]
{rtag|rt|rfreeze} [-falnR] [-b] [-d] [-r tag | -D date] \
symbolic_tag modules...
{status|st|stat} [-lR] [-v] [files...]
{tag|ta|freeze} [-lR] [-F] [-b] [-d] [-r tag | -D date] [-f] \
symbolic_tag [files...]
{update|up|upd} [-AdflPpR] [-d] [-r tag|-D date] files...
</PRE>
<HR>
<A name=s-svn></A>
<H2>12.2 Subversion</H2>
<P>Subversion是下一代版本控制系統,它將替代CVS。當前開發者稱它還處于“alpha”階段,但對大多數用戶而言它已足夠穩定了。到本文檔寫作之時,Subversion僅在Debian
unstable版中可用。
<HR>
<A name=s-svn-inst></A>
<H3>12.2.1 安裝Subversion服務器</H3>
<P>The <CODE>subversion-server</CODE>
meta-package依賴一些關聯包(<CODE>libapache2-dav-svn</CODE>和<CODE>subversion-tools</CODE>)來配置服務器。
<HR>
<A name=s12.2.1.1></A>
<H4>12.2.1.1 創建容器</H4>
<P>當前,<CODE>subversion</CODE>軟件包無法創建容器,所以用戶需要手工創建它們。通常可在<CODE>/var/local/repos</CODE>下創建容器。
<P>創建目錄: <PRE> # mkdir -p /var/local/repos
</PRE>
<P>創建容器數據庫: <PRE> # svnadmin create /var/local/repos
</PRE>
<P>將容器的寫權限賦給www server: <PRE> # chown -R www-data:www-data /var/local/repos
</PRE>
<HR>
<A name=s12.2.1.2></A>
<H4>12.2.1.2 配置Apache2</H4>
<P>通過用戶認證授權訪問容器,添加(或去掉注釋符)下列內容到<CODE>/etc/apache2/mods-available/dav_svn.conf</CODE>:
<PRE> <Location /repos>
DAV svn
SVNPath /var/local/repos
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/subversion/passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
</PRE>
<P>接著,使用下面的命令創建用戶認證文件: <PRE> htpasswd2 -c /etc/subversion/passwd some-username
</PRE>
<P>重啟Apache2,就可以使用URLhttp://<VAR>hostname</VAR>/repos來訪問新的subversion容器了。
<HR>
<A name=s-svn-cvs></A>
<H3>12.2.2 將CVS容器遷移到Subversion</H3>
<HR>
<A name=s-svn-usage></A>
<H3>12.2.3 Subversion用法樣例</H3>
<P>下面的小節將教你如何在subversion下使用各種命令。
<HR>
<A name=s12.2.3.1></A>
<H4>12.2.3.1 創建新的Subversion檔案</H4>
<P>創建新的subversion檔案,輸入下面的命令: <PRE> $ cd ~/<VAR>your-project</VAR> # 進你的源碼目錄
$ svn import http://localhost/repos <VAR>your-project</VAR> \
<VAR>project-name</VAR> -m "initial project import"
</PRE>
<P>這將在你的subversion容器下創建一個名為<VAR>project-name</VAR>的目錄,用來存放你的項目文件。查看http://localhost/repos/它是否在那兒?
<HR>
<A name=s12.2.3.2></A>
<H4>12.2.3.2 使用subversion</H4>
<P>用subversion來管理<VAR>project-y</VAR>: <PRE> $ cd # 轉到工作域
$ svn co http://localhost/repos/<VAR>project-y</VAR> # 提取源碼
$ cd <VAR>project-y</VAR>
... 完成一些工作 ...
$ svn diff # 相當于diff -u repository/ local/
$ svn revert <VAR>modified_file</VAR> # 撤消對文件所做的修改
$ svn ci -m "<VAR>Describe changes</VAR>" # 將你做的修改保存到容器中
$ vi <VAR>newfile_added</VAR>
$ svn add <VAR>newfile_added</VAR>
$ svn add <VAR>new_dir</VAR> # 將所有的文件嵌套式地加到new_dir
$ svn add -N <VAR>new_dir2</VAR> # 非嵌套式地添加目錄
$ svn ci -m "Added <VAR>newfile_added</VAR>, <VAR>new_dir</VAR>, <VAR>new_dir2</VAR>"
$ svn up # 從容器中合并最新的版本
$ svn log # 顯示所有修改記錄
$ svn copy http://localhost/repos/<VAR>project-y</VAR> \
http://localhost/repos/<VAR>project-y-branch</VAR> \
-m "creating my branch of <VAR>project-y</VAR>" # branching <VAR>project-y</VAR>
$ svn copy http://localhost/repos/<VAR>project-y</VAR> \
http://localhost/repos/<VAR>proj-y_release1.0</VAR> \
-m "<VAR>project-y</VAR> 1.0 release" # added release tag
... note that branching and tagging are the same. The only difference
... is that branches get committed whereas tags do not.
... make changes to branch ...
$ # merge branched copy back to main copy
$ svn merge http://localhost/repos/<VAR>project-y</VAR> \
http://localhost/repos/<VAR>project-y-branch</VAR>
$ svn co -r 4 http://localhost/repos/<VAR>project-y</VAR> # get revision 4
</PRE>
<HR>
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-edit.zh-cn.html">上一頁</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/reference.zh-cn.html#contents">目錄</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-preface.zh-cn.html">1</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-system.zh-cn.html">2</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-install.zh-cn.html">3</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-tutorial.zh-cn.html">4</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-woody.zh-cn.html">5</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-package.zh-cn.html">6</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-kernel.zh-cn.html">7</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-tips.zh-cn.html">8</A> ] [
<A href="http://qref.sourceforge.net/Debian/reference/ch-tune.zh-cn.html">9</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-gateway.zh-cn.html">10</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-edit.zh-cn.html">11</A> ]
[ 12 ] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-program.zh-cn.html">13</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-gnupg.zh-cn.html">14</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-support.zh-cn.html">15</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ap-appendix.zh-cn.html">A</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-program.zh-cn.html">下一頁</A>
]
<HR>
<P>Debian 參考手冊
<ADDRESS>CVS, 星期三 四月 28 19:36:38 UTC 2004<BR><BR>Osamu Aoki <CODE><A
href="mailto:osamu@debian.org">osamu@debian.org</A></CODE><BR>Translator: Hao
"Lyoo" Liu <CODE><A
href="mailto:iamlyoo@163.net">iamlyoo@163.net</A></CODE><BR><A
href="http://qref.sourceforge.net/Debian/reference/ap-appendix.zh-cn.html#s-authors">作者,
第 A.1 節</A><BR><BR></ADDRESS>
<HR>
</BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -