<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DDRR&#039;s blog &#187; svn</title>
	<atom:link href="http://blog.ddrr.org/post/tag/svn/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.ddrr.org</link>
	<description>又一个 WordPress 博客</description>
	<lastBuildDate>Fri, 13 Aug 2010 02:21:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Subversion安装记录</title>
		<link>http://blog.ddrr.org/post/40.html</link>
		<comments>http://blog.ddrr.org/post/40.html#comments</comments>
		<pubDate>Fri, 08 Sep 2006 04:01:50 +0000</pubDate>
		<dc:creator>shiliu</dc:creator>
				<category><![CDATA[经验心得]]></category>
		<category><![CDATA[smartsvn]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.ddrr.org/?p=40</guid>
		<description><![CDATA[程序版本： Subversion：1.3.2（官方下载） SmartSVN：2.0.6（官方下载）本地下载：[file]/blog/attachment/200609/SmartSVN%202.0.6.rar[/file] SVNService：将Subversion注册为系统服务的东东。本地下载：[file]http://www.nam... ]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: 宋体;"><i><b>程序版本：</b></i> Subversion：1.3.2（<a href="http://subversion.tigris.org/project_packages.html" target="_blank">官方下载</a>） SmartSVN：2.0.6（<a href="http://www.syntevo.com/smartsvn/download.jsp" target="_blank">官方下载</a>）本地下载：[file]/blog/attachment/200609/SmartSVN%202.0.6.rar[/file] SVNService：将Subversion注册为系统服务的东东。本地下载：[file]http://www.namipan.com/d/SmartSVN%202.0.6.rar/e45f97dcef14e35f8caac26f34c8aa893d0a279977462500[/file] TortoiseSVN：1.4.0 RC1（<a href="http://sourceforge.net/projects/tortoisesvn/" target="_blank">官方下载</a>） <b><i>安装环境：</i></b> Windows XP－SP2－en</span><span id="more-40"></span> <b><i>安装过程：</i></b> 1、安装Subversion。这个过程很简单，默认安装就可以了，没什么可说的。 2、创建Repository（可以理解为代码仓库，其实除了放代码，其他的也可以放的^_^）： 通过CMD进入命令行模式，输入下列命令，在d:&#92;SubversionWorkspace&#92;pub这个目录下建立Repository： <coolcode>svnadmin create &#8211;fs-type fsfs d:&#92;SubversionWorkspace&#92;pub</coolcode> 注：之所以选择fsfs格式，参考下面的文档中的相关资料 <span style="font-family: 宋体;"><coolcode>相关文档资料： $ svnadmin create &#8211;fs-type fsfs /path/to/repos $ svnadmin create &#8211;fs-type bdb /path/to/other/repos Warning Do not create a Berkeley DB repository on a network share&mdash;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&mdash;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.</coolcode></span> 3、添加用户并设置权限。没有做详细研究，请直接参考下面的资料： <span style="font-family: 宋体;"><coolcode>转自：http://www.dlog.cn/html/diary/showlog.vm?sid=2&amp;log_id=2009 独立运行的Subversion权限设置很简单，首先打开snvserve.conf，去掉下面一行的注释 authz-db = authz 然后打开同一目录下的authz这个文件，这个文件便是整个权限控制的核心，先来看一个例子： &#91;groups&#93; dev-group = liudong,xfliang design-group = newidea &#91;/&#93; @dev-group = rw @design-group = r * = &#91;/doc&#93; @design-group = rw &#91;/webapp&#93; @design-group = rw 接下来我给大家解释一下这个文件，相信就可以明白Subversion如何来做权限控制的了。 首先我定义了两个组，一个开发组(dev-group)，一个设计组(design-group)，接下来我让dev-group对整个目录有读写的权限，而design-group只有读权限。但是接下来的两个子目录design-group就有读写权限，也就是说设计组可以读取整个项目，但只能修改doc以及webapp这两个子目录。 *= 这行表示其他人不能读写。当然也可以直接指定某个用户，例如我想让liudong这个用户可以读写webapp目录，那设置如下： &#91;/webapp&#93; @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 &#91;groups&#93; ### section, or to anyone using the &#039;*&#039; wildcard. Each definition can ### grant read (&#039;r&#039;) access, read-write (&#039;rw&#039;) access, or no access ### (&#039;&#039;).</coolcode></span> 4、将Subversion注册为系统服务。将SVNService拷贝到Subversion的安装目录下的bin目录（我这里为：C:&#92;Program Files&#92;Subversion&#92;bin）。然后在CMD中转到刚刚那个目录，运行下列命令： <coolcode>SVNService -install -d -r d:&#92;SubversionWorkspace&#92;</coolcode> 注：以下是svnserve的命令选项 <span style="font-family: 宋体;"><coolcode>svnserve &#91;选项&#93; 有效选项： -d &#91;&#8211;daemon&#93; : 后台模式 &#8211;listen-port 参数 : 监听端口（后台模式） &#8211;listen-host 参数 : 监听主机名或IP地址（后台模式） &#8211;foreground : 在前台运行（调试时有用） -h &#91;&#8211;help&#93; : 显示这个帮助 &#8211;version : 显示版本信息 -i &#91;&#8211;inetd&#93; : inetd 模式 -r &#91;&#8211;root&#93; 参数 : 服务根目录 -R &#91;&#8211;read-only&#93; : force read only, overriding repository config file -t &#91;&#8211;tunnel&#93; : 隧道模式 &#8211;tunnel-user 参数 : 隧道用户名（模式是当前用户UID的名字） -X &#91;&#8211;listen-once&#93; : 监听一次（调试时有用）</coolcode></span> 5、用SmartSVN连接刚刚建好的服务器。根据个人喜好，也可以使用 TortoiseSVN，它更新较快，支持最新的Subversion 1.4.0。 ＝＝
<div class="quote">
<div class="quote-title"></div>
<div class="quote-content">Windows Service Support for svnserve ==================================== svnserve can now be run as a native Windows service. This means that the service can be started at system boot, or at any other time, without the need for any wrapper code to start the service. The service can be managed like any other Windows service, using command-line tools (&quot;net start&quot;, &quot;net stop&quot;, or sc.exe) or GUI tools (the Services administrative tool). Installation &#8212;&#8212;&#8212;&#8212; For now, no means is provided to install the service. Most Windows OSes derived from Windows NT (such as Windows XP, Windows 2000, Windows 2003 Server) provide a command-line tool for installing services, called SC.EXE for &quot;Service Control&quot;. To create a service for svnserve, use SC.EXE: sc create binpath= &quot;c:&#92;svn&#92;bin&#92;svnserve.exe &#8211;service &quot; displayname= &quot;Subversion Repository&quot; depend= Tcpip where is any service name you want, e.g. &quot;svnserve&quot;, and are the arguments to svnserve, such as &#8211;root, &#8211;listen-port, etc. (All of this should be specified on a single line, of course.) In order for svnserve to run as a Windows service, you MUST specify the &#8211;service argument, and you must NOT specify any other run mode argument, such as &#8211;daemon, &#8211;tunnel, &#8211;inetd, or any of their short forms. There is no short form for &#8211;service. If the path to svnserve.exe contains spaces or other characters 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: sc create binpath= &quot;&#92;&quot;c:&#92;program files&#92;subversion&#92;bin&#92;svnserve.exe&#92;&quot; &#8230;&quot; SC has many options; use &quot;sc /?&quot;. The most relevant are: sc create create a new service sc qc query config for a service sc query query status sc delete delete any service &#8212; BE CAREFUL! sc config &#8230; update service config; same args as sc create sc start start a service (does NOT wait for completion!) sc stop stop a service (does NOT wait for it to stop!) Note that the command-line syntax for SC is rather odd. Key/value pairs are specified as &quot;key= value&quot; (without the double-quotes). The &quot;key=&quot; part must not have any spaces, and<br />
the &quot;value&quot; part MUST be separated from the &quot;key=&quot; by a space. If you want to be able to see the command shell, add these arguments to the &quot;sc create&quot; command-line: type= own type= interact This sets the &quot;interactive&quot; bit on the service, which allows it to interact with the local console session. You can create as many services as you need; there is no restriction on the number of services, or their names. I use a prefix, like &quot;svn.foo&quot;, &quot;svn.bar&quot;, etc. Each service runs in a separate process. As usual, it is your responsbility as an administrator to make sure that no two service instances use the same repository root path, or the same combination of &#8211;listen-port and &#8211;listen-host. Uninstalling &#8212;&#8212;&#8212;&#8212; To uninstall a service, stop the service, then delete it, using &quot;sc delete &quot;. Be very careful with this command, since you can delete any system service, including essential Windows services, accidentally. Also, make sure that you stop the service before you delete it. If you delete the service before stopping it, the Service Control Manager will mark the service &quot;deleted&quot;, but will intentionally not stop the service. The service will be deleted when the system reboots, or when the service finally exits. After all, you only asked to delete the service, not to stop it. That&#39;s all there is to it. Automatically Starting Service on System Boot &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; By default, SC creates the service with the start mode set to &quot;demand&quot; (manual). If you want the service to start automatically when the system boots, add &quot;start= auto&quot; to the command line. You can change the start mode for an existing service using &quot;sc config start= auto&quot;, or also by using the Windows GUI interface for managing services. (Start, All Programs, Administrative Tools, Services, or just run &quot;services.msc&quot; from Start/Run or from a command-line.) Note: In order for svnserve to start correctly on system boot, you must properly declare its startup dependencies. The Service Control Manager will start services as early as it can, and if you do not properly declare its startup dependencies, it can potentially start before the TCP/IP stack has been started. This is why you must provide specify &#39;depend= Tcpip&#39; to SC.EXE when creating the service. Starting and Stopping the Service &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; You start and stop the service like any other Windows service. You can use the command-line &quot;net start &quot;, use the GUI Services interface. Debugging &#8212;&#8212;&#8212; Debugging a Windows service can be difficult, because the service runs in a very different context than a user who is logged in. By default, services run in a &quot;null&quot; desktop environment. They cannot interact with the user (desktop) in any way, and vice versa. Also, by default, services run as a special user, called LocalSystem. LocalSystem is not a &quot;user&quot; in the normal sense; it is an NT security ID (SID) that is sort of like root, but different. LocalSystem typically does NOT have access to any network shares, even if you use &quot;net use&quot; to connect to a remote file server. Again, this is because services run in a different login session. Depending on which OS you are running, you may have difficulty attaching a debugger to a running service process. Also, if you are having trouble *starting* a service, then you can&#39;t attach to the process early enough to debug it. So what&#39;s a developer to do? Well, there are several ways you can debug services. First, you&#39;ll want to enable &quot;interactive&quot; access for the service. This allows the service to interact with the local desktop &#8212; you&#39;ll be able to see the command shell that the service runs in, see console output, etc. To do this, you can either use the standard Windows Services tool (services.msc), or you can do it using sc.exe. * With the GUI tool, open the properties page for a service, and go to the &quot;Log On&quot; page. Select &quot;Local System account&quot;, and make sure the &quot;Allow service to interact with desktop&quot; box is checked. * With SC.EXE, configure the service using the command: sc config type= own type= interact Yes, you must specify type= twice, and with exactly the spacing shown. In both cases, you&#39;ll need to restart the service. When you do, if the service started successfully, you&#39;ll see the console window of the service. By default, it doesn&#39;t print anything out. Next, you&#39;ll want to attach a debugger, or configure the service to start under a debugger. Attaching a debugger should be straightforward &#8212; just find the process ID. But if you need to debug something in the service startup path, you&#39;ll need to have a debugger attached from the very beginning. There are two ways to do this. In the first method, you alter the command-line of the service (called the &quot;binary path&quot;). To do this, use SC.EXE to set the binary path to whatever debugger you are going to use. I use the most recent version of WinDbg, which is excellent, and is available at: http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx For example, this command would configure the service to start under a debugger: sc config binpath= &quot;d:&#92;dbg&#92;windbg.exe -g -G d:&#92;svn&#92;bin&#92;svnserve.exe &#8211;root d:&#92;path&#92;root &#8211;listen-port 9000&quot; depend= Tcpip The entire command must be on a single line, of course, and the binary path must be in double-quotes. Also, the spacing MUST be: binpath= &quot;&#8230;&quot; Substitute whatever debugger you want, with whatever command-line you want, in place of windbg.exe. Then start the service (sc start ), and the Service Control Manager should execute the command-line you provided as the binary path. Then your debugger should start, and should launch the svnserve process. Known Issues &#8212;&#8212;&#8212;&#8212; * No management tool (installer, etc.). For the first version, this is intentional; we just want to get the service functionality tested and committed before dealing with installation. * Right now, I don&#39;t know of a way to cleanly stop the svnserve process. Instead, the implementation closes the listen socket, which causes the main loop to exit. This isn&#39;t as bad as it sounds, and is a LOT better than other options (such as terminating a thread). To Do &#8212;&#8211; * The support for running svnserve as a Windows service is complete, but there is still more work to be done for installing and managing services. from:http://svn.collab.net/repos/svn/trunk/notes/windows-service.txt</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.ddrr.org/post/40.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>版本控制工具初探</title>
		<link>http://blog.ddrr.org/post/39.html</link>
		<comments>http://blog.ddrr.org/post/39.html#comments</comments>
		<pubDate>Thu, 07 Sep 2006 14:20:17 +0000</pubDate>
		<dc:creator>shiliu</dc:creator>
				<category><![CDATA[经验心得]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.ddrr.org/?p=39</guid>
		<description><![CDATA[&#160; &#160;好久以前就想弄一个版本控制的东东了，一直忙着没时间弄。趁着这两天师兄给我们放假，初略的研究了一下。想起来应该挺简单的，可是实际操作起来，还真出了不少麻烦^_^不过还... ]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: 宋体;"> &nbsp; &nbsp;好久以前就想弄一个版本控制的东东了，一直忙着没时间弄。趁着这两天师兄给我们放假，初略的研究了一下。想起来应该挺简单的，可是实际操作起来，还真出了不少麻烦^_^不过还是很有成就感的。想当年哪位同学班上做报告时就介绍了这个，可惜当时没什么感觉。哈哈，落后了啊<br/> &nbsp; &nbsp;经过一阵搜索，目标主要定位在了CVS，SVN和VSS（Visual SourceSafe）这三个中间。似乎国内大家基本都是在这三个中选择，不过后来发现一篇国外的文章（http://better-scm.berlios.de/comparison/comparison.html），才知道原来还有那么多的版本控制工具，可惜没有那个时间，也没那个精力一个一个地试。</span><span id="more-39"></span><br/><span style="font-family: 宋体;"> &nbsp; &nbsp;最开始对VSS挺感兴趣的，这个是ms的东西，和VC以及VS都结合得很好。不过考虑到还要使用eclipse开发，VSS可能不支持。另外，资料显示VSS并不太适合跨Internet的协作。所以，没有对它进行试用。<br/> &nbsp; &nbsp;由于eclipse集成了对CVS的支持，所以第一个试用的就是CVS了。windows平台下最好的组合就是CVSNT+WinCVS了，可惜我装了WinCVS之后总是配置不好，后来就改用了<a href="http://www.syntevo.com/smartcvs/index.jsp" target="_blank">SmartCVS</a>。这个一个java写的工具，界面比WinCVS好看多了，也没那么复杂。<br/> &nbsp; &nbsp;安装好之后就是权限设置，最开始想用CVSNT自身的权限控制结构（参考资料：http://blog.csdn.net/zblue78/archive/2006/03/18/608242.aspx），可惜尝试的结果不怎么尽人意，始终没能给每个用户分别设置权限，似乎都是和关联的系统账户一样的权限。后来改用第二种方法（参考资料：http://www.clinux.org/forum/showthread.php?threadid=4281），使用系统账户，基于NTFS分区上权限设置来控制用户的权限。这种方法比较简单，也挺成功的。<br/> &nbsp; &nbsp;原本以为大功告成，不用再试SVN了呢，突然又蹦出了一个中文文件名不能导入的错误。真是麻烦，而且似乎还没法解决。最开始以为是SmartCVS的问题，可是到SmartCVS的新闻组看了才知道，其他人也遇到了同样的问题，而更糟糕的是，似乎问题是出在CVSNT。后来又发现有人说2.5版CVSNT在格式上作了调整，所以出了问题。换最新的2.6，居然装不上，也不知道为什么。又换老版的2.0，装是装上了，可问题依然如故。<br/> &nbsp; &nbsp;真是没办法了，只好放弃CVS了，改试SVN了。资料显示SVN比CVS更强，对二进制文件的支持也更好，似乎对中文的支持还不错。说干就干，立马开工，把Subversion 1.3.2下了回来，又把比较流行的客户端TortoiseSVN下了回来（要注意和Subversion版本匹配，因为Subversion的数据格式有变）。可是不怎么喜欢TortoiseSVN的使用方式，决定换用SmartCVS的同胞兄弟SmartSVN。一切还算顺利，权限的设置也轻松完成了。具体的过程这里就现不写了，下次再写吧^_^</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ddrr.org/post/39.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
