⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 12.htm

📁 debian参考手册,pdf格式的版本。
💻 HTM
📖 第 1 页 / 共 2 页
字号:
</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>     &lt;Location /repos&gt;
       DAV svn
       SVNPath /var/local/repos
       AuthType Basic
       AuthName "Subversion repository"
       AuthUserFile /etc/subversion/passwd
       &lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;
         Require valid-user
       &lt;/LimitExcept&gt;
     &lt;/Location&gt;
</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 + -