Monday, June 30, 2008

Install Subversion server on windows computer

步骤1, 创建一个空目录, 比如d:/source
步骤2, 打开d:\source目录, 使用windows explorer的context menu中tortoisesvn/create a repository here菜单项, 在d:\source中创建必要的repository控制文件和数据库文件.
步骤3, 创建一个svn service服务, 并将服务的工作目录指向d:\source即可. 下面有详细的步骤.

We can register subversion service. the steps are easy. Windows system have a sc command tool to help you register.
If path of subversion contains space or other chars that must be escaped, then you must enclose the path to svnserve.exe with double-quotes, which themselves must be quoted using a backslash. Fortunately the syntax is similar to that on Unix platforms:


Create service methods:
1)On your computer if the path of svnserve.exe does not contain spaces
sc create subversion_local binpath= "c:\svn\bin\svnserve.exe --service -r d:\source" displayname= "Local Subversion Repository" depend= Tcpip
删除这个服务的命令是 sc delete subversion_local
2)On your computer if the path of svnserve.exe contains spaces
sc create subversion_local binpath= "\"c:\program files\subversion\bin\svnserve.exe\" --service -r d:\source" displayname= "Local Subversion Repository" depend= Tcpip

Access the subversion repository by tortoiseSVN, you need a repository url.
1)Browse the repository on local computer,the repository url is just like,
file:///d:/source/docs
2)Browse the repository on remote computer, 前提是computer22机器上的source/docs必须共享出来, 这样才能通过file协议来访问. 访问方式是:
file:///\computer22/source/docs
这是基于file协议的svn访问方式, 多人项目最好不用file协议(因为共享目录安全性较差, 无法做到精细化权限管理). 最好是用svn协议或https协议. 参见我的另一blog( svn authorization)
3)Browse the repository across internet, the repository url is just like,
https://xxxx.svn.sourceforge.net/svnroot/xxxx

more info : http://svn.collab.net/repos/svn/trunk/notes/windows-service.txt

No comments: