<?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>WebOnRails &#187; SVN</title>
	<atom:link href="http://webonrails.com/category/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://webonrails.com</link>
	<description>Its all about Ruby On Rails</description>
	<lastBuildDate>Mon, 05 Jul 2010 16:37:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Ruby 1.9.1: Hash</title>
		<link>http://webonrails.com/2009/02/06/ruby-191-hash/</link>
		<comments>http://webonrails.com/2009/02/06/ruby-191-hash/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 15:13:15 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[rails_plugin]]></category>
		<category><![CDATA[ruby 1.9.1]]></category>

		<guid isPermaLink="false">http://webonrails.com/?p=217</guid>
		<description><![CDATA[In ruby 1.9.1 has many changes for Hash some useful changes are below: RUBY_VERSION => 1.8.6 RUBY_VERSION => 1.9.1 &#62;&#62; {'name', &#34;Akhil&#34;} =&#62; syntax error, unexpected ',', expecting tASSOC &#62;&#62; {name: &#34;Akhil&#34;} =&#62; {:name=&#62;&#34;Akhil&#34;} Now Hash preserves order: RUBY_VERSION => 1.8.6 &#62;&#62; hash = {:a=&#62; 'A', :b=&#62;'B', :c=&#62;'C', :d=&#62;'D'} =&#62; {:b=&#62;&#34;B&#34;, :c=&#62;&#34;C&#34;, :d=&#62;&#34;D&#34;, :a=&#62;&#34;A&#34;} &#62;&#62;]]></description>
			<content:encoded><![CDATA[<p>In ruby 1.9.1 has many changes for Hash some useful changes are below:</p>
<p>RUBY_VERSION => 1.8.6</p>
<p>RUBY_VERSION => 1.9.1</p>
<pre class="brush: ruby;">
&gt;&gt; {'name', &quot;Akhil&quot;}
=&gt; syntax error, unexpected ',', expecting tASSOC

&gt;&gt; {name: &quot;Akhil&quot;}
=&gt; {:name=&gt;&quot;Akhil&quot;}
</pre>
<p><strong>Now Hash preserves order:</strong></p>
<p>RUBY_VERSION => 1.8.6</p>
<pre class="brush: ruby;">
&gt;&gt; hash = {:a=&gt; 'A', :b=&gt;'B', :c=&gt;'C', :d=&gt;'D'}
=&gt; {:b=&gt;&quot;B&quot;, :c=&gt;&quot;C&quot;, :d=&gt;&quot;D&quot;, :a=&gt;&quot;A&quot;}
&gt;&gt; hash.to_a
=&gt; [[:b, &quot;B&quot;], [:c, &quot;C&quot;], [:d, &quot;D&quot;], [:a, &quot;A&quot;]]
&gt;&gt; hash.keys
=&gt; [:b, :c, :d, :a]
&gt;&gt; hash.values
=&gt; [&quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;A&quot;]
</pre>
<p>RUBY_VERSION => 1.9.1</p>
<pre class="brush: ruby;">
&gt;&gt; hash = {:a=&gt; 'A', :b=&gt;'B', :c=&gt;'C', :d=&gt;'D'}
=&gt; {:a=&gt;&quot;A&quot;, :b=&gt;&quot;B&quot;, :c=&gt;&quot;C&quot;, :d=&gt;&quot;D&quot;}
&gt;&gt; hash.to_a
=&gt; [[:a, &quot;A&quot;], [:b, &quot;B&quot;], [:c, &quot;C&quot;], [:d, &quot;D&quot;]]
&gt;&gt; hash.keys
=&gt; [:a, :b, :c, :d]
&gt;&gt; hash.values
=&gt; [&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;]
</pre>
<p><strong>Better to_s method(similar to hash.inspect). </strong></p>
<p>RUBY_VERSION => 1.8.6</p>
<pre class="brush: ruby;">
&gt;&gt; hash = {:a=&gt; 1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
=&gt; {:b=&gt;2, :c=&gt;3, :d=&gt;4, :a=&gt;1}
&gt;&gt; hash.to_s
=&gt; &quot;b2c3d4a1&quot;
</pre>
<p>RUBY_VERSION => 1.9.1</p>
<pre class="brush: ruby;">
&gt;&gt; hash = {:a=&gt; 1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
=&gt; {:a=&gt;1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
&gt;&gt; hash.to_s
=&gt; &quot;{:a=&gt;1, :b=&gt;2, :c=&gt;3, :d=&gt;4}&quot;
</pre>
<p><strong>hash.each and hash.each_pair </strong></p>
<p>RUBY_VERSION => 1.8.6</p>
<pre class="brush: ruby;">
&gt;&gt; hash = {:a=&gt; 1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
=&gt; {:b=&gt;2, :c=&gt;3, :d=&gt;4, :a=&gt;1}
&gt;&gt; hash.each{|x| p x}
[:b, 2]
[:c, 3]
[:d, 4]
[:a, 1]
=&gt; {:b=&gt;2, :c=&gt;3, :d=&gt;4, :a=&gt;1}
&gt;&gt; hash.each_pair{|x| p x}
(irb):48: warning: multiple values for a block parameter (2 for 1)
        from (irb):48
[:b, 2]
(irb):48: warning: multiple values for a block parameter (2 for 1)
        from (irb):48
[:c, 3]
(irb):48: warning: multiple values for a block parameter (2 for 1)
        from (irb):48
[:d, 4]
(irb):48: warning: multiple values for a block parameter (2 for 1)
        from (irb):48
[:a, 1]
=&gt; {:b=&gt;2, :c=&gt;3, :d=&gt;4, :a=&gt;1}
</pre>
<p>RUBY_VERSION => 1.9.1</p>
<pre class="brush: ruby;">
&gt;&gt; hash = {:a=&gt; 1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
=&gt; {:a=&gt;1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
&gt;&gt; hash.each{|x| p x}
[:a, 1]
[:b, 2]
[:c, 3]
[:d, 4]
=&gt; {:a=&gt;1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
&gt;&gt; hash.each_pair{|x| p x}
[:a, 1]
[:b, 2]
[:c, 3]
[:d, 4]
=&gt; {:a=&gt;1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
</pre>
<p><strong>hash.select now returns hash instead of array</strong></p>
<p>RUBY_VERSION => 1.8.6</p>
<pre class="brush: ruby;">
&gt;&gt; hash = {:a=&gt; 1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
=&gt; {:b=&gt;2, :c=&gt;3, :d=&gt;4, :a=&gt;1}
&gt;&gt; hash.select{|k,v| k == :c }
=&gt; [[:c, 3]]
</pre>
<p>RUBY_VERSION => 1.9.1</p>
<pre class="brush: ruby;">
&gt;&gt; hash = {:a=&gt; 1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
=&gt; {:a=&gt;1, :b=&gt;2, :c=&gt;3, :d=&gt;4}
&gt;&gt;  hash.select{|k,v| k == :c }
=&gt; {:c=&gt;3}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://webonrails.com/2009/02/06/ruby-191-hash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Script for SVN commit notification with log message, list of updated files and readable colored SVN Diff</title>
		<link>http://webonrails.com/2008/01/14/ruby-script-for-svn-commit-notification-with-log-message-list-of-updated-files-and-readable-colored-svn-diff/</link>
		<comments>http://webonrails.com/2008/01/14/ruby-script-for-svn-commit-notification-with-log-message-list-of-updated-files-and-readable-colored-svn-diff/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 14:17:16 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[post-commit]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby-script]]></category>

		<guid isPermaLink="false">http://webonrails.com/2008/01/14/ruby-script-for-svn-commit-notification-with-log-message-list-of-updated-files-and-readable-colored-svn-diff/</guid>
		<description><![CDATA[Some days ago I wrote a post about &#8220;SVN commit notification&#8221; which uses a perl script for sending commit notification with svn diff by mail. In this mail you can find svn diff from the last committed revision. I used to love this mail, soon I realized that it is a bit ugly and difficult]]></description>
			<content:encoded><![CDATA[<p>Some days ago I wrote a post about &#8220;<a href="http://webonrails.com/2007/07/12/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/">SVN commit notification</a>&#8221; which uses a perl script for sending commit notification with svn diff by mail. In this mail you can find svn diff from the last committed revision. I used to love this mail, soon I realized that it is a bit ugly and difficult to read. Also there were some important information missing.  Like the name of user committing the code, the log message etc&#8230;</p>
<p>And then I started writing my own ruby script for same purpose but with some addition and modification. <a class="downloadlink" href="http://webonrails.com/wp-content/plugins/download-monitor/download.php?id=5" title="Version 1.0 downloaded 783 times" >Commit Notification Script</a> is that script, you can download and configure it with your SVN post commit hook as follows.</p>
<p>Add following line at the bottom of your post-commit file:</p>
<pre class="brush: ruby;">
/usr/bin/ruby /var/www/repositories/project/hooks/commit-email.rb &quot;$1&quot;  &quot;$2&quot;
</pre>
<p>* Please remember to change the path of you commit-email ruby script.</p>
<p>Now open commit-email ruby file and modify the following section according to your requirement:</p>
<pre class="brush: ruby;">
# You can edit below

# Subject prefix
sub = &quot;[test_project@vinsol]&quot;  # A project 'test_project' is maitained at vinsol

#list of users who will recieve commit notification
recipients = [&quot;bansalakhil30.10@gmail.com&quot;, &quot;akhil@vinsol.com&quot;]

# email which will appear in from email field
from_user = &quot;svn-notify@somedomain.com&quot;

# your smtp settings here
ActionMailer::Base.smtp_settings = { :address =&gt; 'localhost', :port =&gt; 25, :domain =&gt; 'domain.com'}

# Do not edit below this line
</pre>
<p>You are done with that, now onwards whenever someone commits the code, you&#8217;ll get the commit notification mail like:</p>
<p><a class="imagelink" href="http://webonrails.com/wp-content/uploads/2008/09/emailscreenshot.png" title="Commit Email Preview"><img id="image128" src="http://webonrails.com/wp-content/uploads/2008/09/emailscreenshot.png" alt="Commit Email Preview"  width=55%/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://webonrails.com/2008/01/14/ruby-script-for-svn-commit-notification-with-log-message-list-of-updated-files-and-readable-colored-svn-diff/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Get svn commit notification right into your inbox by using svn hook post-commit</title>
		<link>http://webonrails.com/2007/07/12/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/</link>
		<comments>http://webonrails.com/2007/07/12/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/#comments</comments>
		<pubDate>Wed, 11 Jul 2007 19:42:21 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[post-commit]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/07/12/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/</guid>
		<description><![CDATA[If you wish you can get notification right into your inbox when a team member commits the code. This mail will contain list of files added/deleted along with the svn diff of files that are modified. This needs some extra efforts to setup, but once it is setup it is very helpful. This can be]]></description>
			<content:encoded><![CDATA[<p>If you wish you can get notification right into your inbox when a team member commits the code. This mail will contain list of files added/deleted along with the svn diff of files that are modified. This needs some extra efforts to setup, but once it is setup it is very helpful.</p>
<p>This can be done by using svn hooks. Yes, svn has inbuilt hook functionality like pre-commit, post-commit, post-lock, post-unlock, pre-lock, pre-unlock, start-commit. We&#8217;ll use post-commit hook to get notifications.</p>
<p>First of all get a perl script from here <a href="http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in"><strong>http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in</strong></a> and copy it to hooks directory inside your repository directory, lets say /var/www/repos/repository_name/hooks.<br />
Make sure to rename it as commit-email.pl, ofcourse you need perl installed on your server. Now cd to hooks directory inside you repository directory. <strong>Rename post-commit.tmpl to post-commit, and chmod 755 to post-commit and commit-email.pl</strong> . Now open post-commit in you favorite editor, and put &#8220;<strong>/usr/bin/perl /var/www/repos/commit-email.pl &#8211;from svn-notify@example.com  -s &#8216;SVN commit notification&#8217;  &#8216;$REPOS&#8217; &#8216;$REV&#8217; user_whom_to_notify@example.com, another_user_to_notify@example.com</strong>&#8221; at the bottom of that file. Now open commit-email.pl and make changes in configuration section according to your requirement and server, specially svnlook path.</p>
<p>Congrats!, You are done <img src='http://webonrails.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .</p>
<p>Now your server will send email notification to user_whom_to_notify@example.com, another_user_to_notify@example.com whenever someone commits.</p>
<p><em><strong><br />
**For security reasons, the Subversion repository executes hook scripts with an empty environment that is, no environment variables are set at all, not even $PATH or %PATH%. Because of this, a lot of administrators are baffled when their hook script runs fine by hand,but doesn&#8217;t work when run by Subversion. Be sure to explicitly set environment variables in your hook and/or use absolute paths to programs.</strong></em></p>
<p>It worked for me, Please let me know if it works for you too.</p>
]]></content:encoded>
			<wfw:commentRss>http://webonrails.com/2007/07/12/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Is SVN really atomic?</title>
		<link>http://webonrails.com/2007/07/09/is-svn-really-atomic/</link>
		<comments>http://webonrails.com/2007/07/09/is-svn-really-atomic/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 14:12:36 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[SVN]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/07/09/is-svn-really-atomic/</guid>
		<description><![CDATA[I am just wondering if svn is really atomic. Actually some days ago I freezed rails and tried to commit but due to some network problem the commit process failed. And then I found some of those files under version control, which should not be there if snv is atomic. I tried many times to]]></description>
			<content:encoded><![CDATA[<p>I am just wondering if svn is really atomic. Actually some days ago I freezed rails and tried to commit but due to some network problem the commit process failed. And then I found some of those files under version control, which should not be there if snv is atomic. I tried many times to commit after svn delete those files, but stuck with the same problem. May be I misunderstood some thing about svn. Did somebody also faced same problem?</p>
]]></content:encoded>
			<wfw:commentRss>http://webonrails.com/2007/07/09/is-svn-really-atomic/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Ruby script for creating new rails project and initial SVN import (with ignoring/removing log/other files)</title>
		<link>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/</link>
		<comments>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 13:38:17 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[ROR]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rubyonrails]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby-script]]></category>
		<category><![CDATA[scm]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/</guid>
		<description><![CDATA[Some days go I wrote a bash script for creating new rails project and initial SVN import (with ignoring/removing log/other files). And I received many comments if I could write a ruby script for this stuff. Hence here is the . Copy this script to any of your directory as &#8220;create_rails_with_subversion.rb&#8221; and execute by issuing]]></description>
			<content:encoded><![CDATA[<p>Some days go I wrote a <a target="_blank" title="bash script for creating new rails project and initial SVN import (with ignoring/removing log/other files)" href="http://webonrails.com/2007/01/10/bash-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/">bash script for creating new rails project and initial SVN import (with ignoring/removing log/other files)</a>. And I received many comments if I could write a ruby script for this stuff. Hence here is the <a class="downloadlink" href="http://webonrails.com/wp-content/plugins/download-monitor/download.php?id=1" title="Version 1.0 downloaded 1954 times" >ruby script for creating new rails project and initial SVN import (with ignoring/removing log/other files)</a>. Copy this script to any of your directory as &#8220;create_rails_with_subversion.rb&#8221; and execute by issuing &#8220;ruby create_rails_with_subversion.rb &#8221;<br />
You may need command line <a title="subversion" target="_blank" href="http://subversion.tigris.org/">subversion</a> for windows.</p>
<p>I have tested it at my windows and linux machine, if it not work for you please let me know.</p>
<p>Also I love to have your comments&#8230;. <img src='http://webonrails.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Bash script for creating new rails project and initial SVN import (with ignoring/removing log/other files)</title>
		<link>http://webonrails.com/2007/01/10/bash-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/</link>
		<comments>http://webonrails.com/2007/01/10/bash-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 13:43:48 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[ROR]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rubyonrails]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/01/10/bash-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/</guid>
		<description><![CDATA[Many times we need to create a new rails project and import it to SVN repository. Each time we have to repeat same commands for creating new rails project, Initial import to SVN, Ignoring *.log files, move database.yml to database.example, ignoring tmp/sessions etc.. etc.. So I have written a bash script that do all this]]></description>
			<content:encoded><![CDATA[<p>Many times we need to create a new rails project and import it to SVN repository. Each time we have to repeat same commands for creating new rails project, Initial import to SVN, Ignoring *.log files, move database.yml to database.example, ignoring tmp/sessions etc.. etc..</p>
<p>So I have written a bash script that do all this stuff, all you need to do is copy this <a class="downloadlink" href="http://webonrails.com/wp-content/plugins/download-monitor/download.php?id=2" title="Version 1.0 downloaded 3138 times" >Bash script (for creating new rails project and initial SVN import with ignoring/removing log/other files)</a>  to any of your directory with name &#8220;create_rails_with_subversion&#8221; and execute this script by issuing ./create_rails_with_subversion &#038; follow screen instructions.</p>
<p>This will:</p>
<ul>
<li>create a new rails project</li>
<li>initial import to SVN</li>
<li>remove and ignore all log files from svn</li>
<li>remove and ignore sessions, cache sockets files from tmp dir</li>
<li>move database.yml to database.example</li>
<li>ignore database.yml</li>
</ul>
<p>I also love to have your feedbacks&#8230;</p>
<p><strong>UPDATE:</strong> I have modified this script, now it doesn&#8217;t remove tmp dir, it just ignore content in tmp/sessions, tmp/sockets and tmp/caches <img src='http://webonrails.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>UPDATE2:</strong> Script again modified , now it also freeze rails (you have to specify version).</p>
]]></content:encoded>
			<wfw:commentRss>http://webonrails.com/2007/01/10/bash-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Installing subversion from pre-compiled packages or source code</title>
		<link>http://webonrails.com/2006/11/07/installing-subversion-from-pre-compiled-packages-or-source-code/</link>
		<comments>http://webonrails.com/2006/11/07/installing-subversion-from-pre-compiled-packages-or-source-code/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 21:11:49 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[SVN]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://webonrails.com/2006/11/07/installing-subversion-from-pre-compiled-packages-or-source-code/</guid>
		<description><![CDATA[What is subversion(svn): Subversion is an open source version control system used for keep track of change to source code. Subversion manages files and directories over time an increments revision made to the file system. A tree of file is placed into a central repository. The repository is much like an ordinary file server, except]]></description>
			<content:encoded><![CDATA[<p><strong>What is subversion(svn):</strong></p>
<p>Subversion is an open source version control system used for keep track of change to source code. Subversion manages files and directories over time an increments revision made to the file system.  A tree of file is placed into a central repository. The repository is much like an ordinary file server, except that it remembers every change ever made to your files and directories. This allows you to recover older version of your date or examine the history of how your data changed.</p>
<p>Subversion can access its repository across networks, which allows it to be used by people on different computers. At some level, the ability for various people to modify and manage the same set of data from their respective locations fosters collaboration.</p>
<p><strong>Installation:</strong></p>
<p>There are two types of installation:</p>
<ol>
<li>Installation from pre-compiled packages</li>
<li>Installation from source code</li>
</ol>
<p><strong>Installation from packages:</strong></p>
<p>For RedHat Linux(or other Linux distributions which supports RPM) download subversion RPM package and install. See  manual of rpm utility for installation.</p>
<p>For Debian Linux issue <code> apt-get install subversion</code> and by confirming the installation you are done. I also recommend to install subversion-tools by issuing <code> apt-get install subversion-tools</code>.</p>
<p><strong>Installation from source:<br />
</strong></p>
<p>Installation from source code is slightly tricky. First of all download latest version of subversion code from <a href="http://subversion.tigris.org">http://subversion.tigris.org</a>.</p>
<p>Now extract source to your preferred directory (lets assume <code>/home/testuser/svncode/</code>),  and  issue the following command in sequence after switching to svncode directory:</p>
<pre>
<ul>
<li>./configure</li>
<li>make</li>
<li>make install</li>
</ul>
</pre>
<p><code>./configure</code> will create <code>Makefile</code><br />
<code>make</code> makes Subversion form the just-created <code>Makefile</code><br />
<code>make install</code> install Subversion if <code>make </code>is successfullyAnd you are done&#8230;.</p>
<p>Issue <code>svnadmin create /home/testuser/repository</code> to create a new repository, this should create a directory structure like:</p>
<pre><code>drwxrwxrwx   7 root root 4096 2006-11-07 17:18 .
drwxrwxrwx  14 root root 4096 2006-11-07 17:18 ..
drwxrwxrwx   2 root root 4096 2006-11-07 17:18 con
drwxrwxrwx   2 root root 4096 2006-11-07 17:18 dav
drwxrwxrwx   2 root root 4096 2006-11-07 17:18 db
-rwxrwxrwx   1 root root    2 2006-11-07 17:18 format
drwxrwxrwx   2 root root 4096 2006-11-07 17:18 hooks
drwxrwxrwx   2 root root 4096 2006-11-07 17:18 locks
-rwxrwxrwx   1 root root  379 2006-11-07 17:18 README.txt</code></pre>
<p>Now we need to allow remote access to it so that users can import their files. By editing <code>conf/svnserve.conf</code> we can set user accounts, permissions.</p>
<p>Initially svnserve.conf looks like:</p>
<pre><code>### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit <a title="http://subversion.tigris.org/" rel="nofollow" href="http://subversion.tigris.org/">http://subversion.tigris.org/</a> for more information.
### [general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
### anon-access = write
### auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the conf directory.
### The format of the password database is similar to this file.
### It contains one section labelled [users]. The name and
### password for each user follow, one account per line. The
### format is
### USERNAME = PASSWORD
### Please note that both the user name and password are case
### sensitive. There is no default for the password file.
### password-db = passwd
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
### realm = My First Repository</code></pre>
<p>Uncomment line containing <code>[general]</code>, <code>anon-access</code>, <code>auth-access</code> and <code>password-db </code>with suitable permissions. Also add file named passwd parallel to svnserve.conf containing</p>
<pre><code>[users]SVNUSERNAME = SVNUSERPASSOWRD</code></pre>
<p>You can add as many users you want. Now you are done with user accounts and permissions.</p>
<p>Next you have to start the svnserver by issuing <code>svnserve -d -r /home/testuser/repository</code>.</p>
<p>Now you are ready with your subversion server, you can access your repository from <code>svn://yourdomain.com/repository/</code></p>
<p>On some systems (like Debian GNU/Linux) this requires to write an init script so that the server starts up every time the system is rebooted. This could be done by creating a file called <code>svnserve</code> in the <code>/etc/init.d</code> directory, and then editing it to look like the following example file:</p>
<pre lang="bash">#! /bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/svnserve NAME=svnserve DESC="SVN Repository Server Daemon"
test -x $DAEMON || exit 0
OPTIONS="-d -r /cvs/src"
# Get lsb functions
#. /lib/lsb/init-functions
. /etc/default/rcS start() {        echo "Starting $DESC... "
#       echo "Starting $DESC: "
if ! start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $OPTIONS
&gt;/dev/null 2&gt;&#038;1; then
status=$?
echo $status
return $status
fi        log_end_msg 0
return 0
}
case "$1" in
start)
start
;;
stop)
echo "Stopping $DESC: "
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
echo $?
;;
restart|force-reload)
$0 stop
sleep 1
start
#echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" &gt;&#038;2
exit 1
;;
esac exit 0</pre>
<p>This script also allows to manually start and stop the svnserver service whenever needed. Note: be sure and change the <code>OPTIONS</code> line to reflect the location of your repository; in our previous example this location was <code>/home/testuser/repository</code>. Once this file is created and edited to look like the previous example, you need to <code>chmod</code> the script to be executable by issuing <code>chmod +x /etc/init.d/svnserve</code> and also set it to startup at boot time by issuing <code>update-rc.d svnserve defaults<br />
</code></p>
<p>Now simply start/stop the service by issuing:</p>
<p><code>/etc/init.d/svnserve start/stop</code></p>
<p>Please refer <a href="http://svnbook.red-bean.com/">Subversion book</a> for more help and usage.</p>
]]></content:encoded>
			<wfw:commentRss>http://webonrails.com/2006/11/07/installing-subversion-from-pre-compiled-packages-or-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
