用户操作
[即时聊天] [发私信] [加为好友]
夏纯中ID:danny_xcz
856436次访问,排名41好友2人,关注者79
danny_xcz的文章
原创 296 篇
翻译 3 篇
转载 25 篇
评论 636 篇
纯月的公告
最近评论
henhaohll:有些意思啊!呵呵 ..
sap99:www.sap99.com/,SAP99资料多多

SAP免费资料下载
http://www.sap99.com

有很多的学习资料,推荐一下,
snowring:你好,能留下联系方式吗?
我也在研究MULE,QQ:7766284
谢谢了。
make6b:不懂L
http://www.pvpsale.com
changyanping:您好,我最近也在研究mule,希望能和你交流交流,我的QQ:121201384
文章分类
收藏
    相册
    Blog用途
    我的相册
    Java Desktop
    Open Source
    友情链接
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 SVN安装和使用(新一代的CVS)收藏

    新一篇: 使用htmlparser获取sohu的天气预报 | 旧一篇: Session跟踪

    SVN安装和使用

    SVN的安装

    访问SVN网站下载你所需版本的安装包。以Linux为例,安装过程为依次执行以下步骤:
    rpm -ivh apr-0.9.5-0.2.i386.rpm
    rpm -ivh apr-util-0.9.5-0.1.i386.rpm
    rpm -ivh neon-0.24.7-1.i386.rpm
    
    rpm -ivh subversion-1.1.1-1.rh80.i386.rpm
    

     

    SVN安装包的基本命令

    svn The command-line client program.
    svnversion A program for reporting the state (in terms of revisions of the items present) of a working copy.
    svnlook A tool for inspecting a Subversion repository.
    svnadmin A tool for creating, tweaking or repairing a Subversion repository.
    svndumpfilter A program for filtering Subversion repository dumpfile format streams.
    mod_dav_svn A plug-in module for the Apache HTTP Server, used to make your repository available to others over a network.
    svnserve A custom standalone server program, runnable as a daemon process or invokable by SSH; another way to make your repository available to others over a network.

     

    配置本地访问的SVN

    执行svn --version,你将看到如下画面
    [root@localhost local]# svn --version
    * ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
    * ra_local : Module for accessing a repository on local disk.
    * ra_svn : Module for accessing a repository using the svn network protocol.
    
    如果你有ra_local这个模块,那么客户端就可以用file:// URLs的地址来访问。

    执行一下命令

    $ svnadmin create /root/svnrepo
    $ ls /root/svnrepo
    conf/ dav/ db/ format hooks/ locks/ README.txt
    

    接下来,我们建立一个本地工作目录/root/svnlocal,进入执行

    //建立项目
    [root@localhost svnlocal]# mkdir project 
    [root@localhost svnlocal]# mkdir project/trunk
    [root@localhost svnlocal]# mkdir project/branches
    [root@localhost svnlocal]# mkdir project/tags
    //建立一个模块exo
    [root@localhost svnlocal]# mkdir project/exo
    [root@localhost svnlocal]# vi project/exo/exo.conf
    
    [root@localhost svnlocal]# svn import . file:///root/svnrepo -m 'initial'
    
    [root@localhost svnlocal]# rm -rf project
    
    [root@localhost svnlocal]# svn checkout file://localhost/root/svnrepo/project //check整个项目
    
    [root@localhost svnlocal]# svn checkout file://localhost/root/svnrepo/project exo //check 其中一个模块
    
    如果成功可以看到文件已经被check出来。地址可以使用file://localhost/root/svnrepo 或者使用file:///root/svnrepo

    其他的命令有

    • Enter your working copy and edit a file's contents.
    • Run svn diff to see unified diff output of your changes.
    • Run svn commit to commit the new version of your file to the repository.
    • Run svn update to bring your working copy “up-to-date” with the repository.

     

    SVN的访问地址

    Schema Access Method
    file:/// direct repository access (on local disk)
    http:// access via WebDAV protocol to Subversion-aware Apache server
    https:// same as http://, but with SSL encryption.
    svn:// access via custom protocol to an svnserve server
    svn+ssh:// same as svn://, but through an SSH tunnel.

     

    启动SVN的svnserve,这样你就可以通过svn://url的方式来访问。

    查看启动参数
    [root@localhost svnlocal]# svnserve --help
    Usage: svnserve [options]
    
    Valid options:
      -d [--daemon]            : daemon mode
      --listen-port arg        : listen port (for daemon mode)
      --listen-host arg        : listen hostname or IP address (for daemon mode)
      --foreground             : run in foreground (useful for debugging)
      -h [--help]              : display this help
      --version                : display version
      -i [--inetd]             : inetd mode
      -r [--root] arg          : root of directory to serve
      -R [--read-only]         : deprecated; use repository config file
      -t [--tunnel]            : tunnel mode
      --tunnel-user arg        : tunnel username (default is current uid's name)
      -T [--threads]           : use threads instead of fork
      -X [--listen-once]       : listen once (useful for debugging)
    
    

    我们执行svnserve -d -r /root/svnrepo

    然后在刚才的svnlocal目录下,执行

    [root@localhost svnlocal]# svn checkout svn://localhost/project exo
    
    就可以通过网络协议check出指定的repo或者其中的模块

    注意:如果我们启动时候,只是用svnserve -d而没有制定repo路径的话,那么你在checkout的时候就必须使用是svn checkout svn://localhost/root/svnrepo/project exo 来指明全路径。

    接下来,我们随便修改一个文件,然后执行

    [root@localhost exo-build]# svn commit -m "test"
    
    你会发现提示说:“提交失败,svn: Connection is read-only” 这说明svn://访问方式没有用户权限控制,只能最基本的匿名下载使用。

     

    权限配置

    先介绍svnserve使用的基于文件的权限控制

    进入/root/svnrepo/conf/ 打开svnserve.conf,修改一下两行

    [general]
    anon-access = none
    auth-access = write
     
    password-db = passwd
    
    
    注意:所有的行都必须顶格,否则报错。

    在相同目录下建立一个passwd文件,使用vi passwd命令。在里面输入

    [users]
    danny = danny
    bobo = bobo
    
    重新启动svnserve,svnserve -d -r /root/svnrepo/ 。

    好,接下来,我们执行

    [root@localhost svnlocal]# svn checkout svn://localhost/project exo
    
    根据提示依次输入"root"的密码(任意),用户登陆名名(danny_xcz)和密码(pass)。就可以正常chekout需要的目录了。登陆一次以后再执行svn update等命令时无需再次输入认证密码。

    发表于 @ 2004年12月02日 20:43:00|评论(loading...)|收藏

    新一篇: 使用htmlparser获取sohu的天气预报 | 旧一篇: Session跟踪

    评论:没有评论。

    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © 纯月