Subversion安装记录

程序版本:
   Subversion:1.3.2(官方下载
   SmartSVN:2.0.6(官方下载)本地下载:

安装过程:
 1、安装Subversion。这个过程很简单,默认安装就可以了,没什么可说的。
 2、创建Repository(可以理解为代码仓库,其实除了放代码,其他的也可以放的^_^):
   通过CMD进入命令行模式,输入下列命令,在d:/SubversionWorkspace/pub这个目录下建立Repository:

svnadmin create --fs-type fsfs d:/SubversionWorkspace/pub

注:之所以选择fsfs格式,参考下面的文档中的相关资料
相关文档资料:
$ svnadmin create --fs-type fsfs /path/to/repos
$ svnadmin create --fs-type bdb /path/to/other/repos

Warning
Do not create a Berkeley DB repository on a network share—it cannot exist on a remote filesystem such as NFS, AFS, or Windows SMB. Berkeley DB requires that the underlying filesystem implement strict POSIX locking semantics, and more importantly, the ability to map files directly into process memory. Almost no network filesystems provide these features. If you attempt to use Berkeley DB on a network share, the results are unpredictable—you may see mysterious errors right away, or it may be months before you discover that your repository database is subtly corrupted.

If you need multiple computers to access the repository, you create an FSFS repository on the network share, not a Berkeley DB repository. Or better yet, set up a real server process (such as Apache or svnserve), store the repository on a local filesystem which the server can access, and make the repository available over a network. Chapter 6, Server Configuration covers this process in detail.

 3、添加用户并设置权限。没有做详细研究,请直接参考下面的资料:
转自:http://www.dlog.cn/html/di...

独立运行的Subversion权限设置很简单,首先打开snvserve.conf,去掉下面一行的注释

authz-db = authz

然后打开同一目录下的authz这个文件,这个文件便是整个权限控制的核心,先来看一个例子:

[groups]
dev-group = liudong,xfliang
design-group = newidea

[/]
@dev-group = rw
@design-group = r
* =

[/doc]
@design-group = rw

[/webapp]
@design-group = rw

接下来我给大家解释一下这个文件,相信就可以明白Subversion如何来做权限控制的了。

首先我定义了两个组,一个开发组(dev-group),一个设计组(design-group),接下来我让dev-group对整个目录有读写的权限,而design-group只有读权限。但是接下来的两个子目录design-group就有读写权限,也就是说设计组可以读取整个项目,但只能修改doc以及webapp这两个子目录。

*= 这行表示其他人不能读写。当然也可以直接指定某个用户,例如我想让liudong这个用户可以读写webapp目录,那设置如下:

[/webapp]
@design-group = rw
liudong = rw

另外有一点注意的是,修改这个文件不需要重新启动svn服务,这点太棒了。

下面是详细的说明Subversion自带的authz样例中的注释

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to a
### single user, to a group of users defined in a special [groups]
### section, or to anyone using the '*' wildcard.  Each definition can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

 4、将Subversion注册为系统。将SVNServise拷贝到Subversion的安装目录下的bin目录(我这里为:C:/Program Files/Subversion/bin)。然后在CMD中转到刚刚那个目录,运行下列命令:
svnserve -d -r d:/SubversionWorkspace/

注:以下是svnserve的命令选项
svnserve [选项]
有效选项:
 -d [--daemon]            : 后台模式
 --listen-port 参数     : 监听端口(后台模式)
 --listen-host 参数     : 监听主机名或IP地址(后台模式)
 --foreground             : 在前台运行(调试时有用)
 -h [--help]              : 显示这个帮助
 --version                : 显示版本信息
 -i [--inetd]             : inetd 模式
 -r [--root] 参数       : 服务根目录
 -R [--read-only]         : force read only, overriding repository config file
 -t [--tunnel]            : 隧道模式
 --tunnel-user 参数     : 隧道用户名(模式是当前用户UID的名字)
 -X [--listen-once]       : 监听一次(调试时有用)

 5、用SmartSVN连接刚刚建好的服务器  
下载文件 (已下载 22 次)

   SVNServise:将Subversion注册为系统服务的东东。本地下载:
下载文件 (已下载 19 次)

   TortoiseSVN:1.4.0 RC1(官方下载
安装环境:
   Windows XP-SP2-en
发布了3 篇原创文章 · 获赞 0 · 访问量 2万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章