<?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>Zulius &#187; subversion</title>
	<atom:link href="http://www.zulius.com/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zulius.com</link>
	<description>Advanced Application Development</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:09:39 +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>Turn off TortoiseSVN sounds</title>
		<link>http://www.zulius.com/how-to/turn-off-tortoisesvn-sounds/</link>
		<comments>http://www.zulius.com/how-to/turn-off-tortoisesvn-sounds/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 19:00:14 +0000</pubDate>
		<dc:creator>Tim White</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[tortoisesvn]]></category>

		<guid isPermaLink="false">http://www.zulius.com/?p=393</guid>
		<description><![CDATA[TortoiseSVN is an excellent Subersion client for Windows. By default, TortoiseSVN makes noise when it encounters a warning or an error. This almost made me crap a brick when TortoiseSVN failed on a commit and I forgot I had my speakers cranked to eleven. TortoiseSVN does not have an internal setting to disable sounds, so [...]]]></description>
			<content:encoded><![CDATA[<p><div class="wp-caption alignleft" style="width: 160px"><img alt="Noise on a commit failure" src="/img/blog/tortoiseSvnSound/error.jpg" title="Noise on a commit failure" width="150" height="110" /><p class="wp-caption-text">Noise on a commit failure</p></div>
<p><a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a> is an excellent <a href="http://subversion.tigris.org/">Subersion</a> client for Windows.  By default, TortoiseSVN makes noise when it encounters a warning or an error.  This almost made me crap a brick when TortoiseSVN failed on a commit and I forgot I had my speakers cranked to eleven.</p>
<p>TortoiseSVN does not have an internal setting to disable sounds, so we'll have to manually disable it's noise in the Windows control panel:</p>
<ol>
<li>Right click anywhere, select TortoiseSVN > Settings > General Menu > Click "Configure" button next to System Sounds.  Or go to Start > Control Panel > Sounds and Audio Devices > Sounds Tab.
<p style="padding: 15px 0 0 0"><img class="alignnone" src="/img/blog/tortoiseSvnSound/tortoisesvn-settings.jpg" alt="TortoiseSVN settings" /></p>
</li>
<li>Look in the “Program Events” box for TortoiseSVN:
<p style="padding: 15px 0 0 0"><img class="alignnone" src="/img/blog/tortoiseSvnSound/sounds.jpg" alt="Sounds and Audio Device Properties" /></p>
</li>
<li>Click on each of TortoiseSVN's events, and select "(None)" from the <strong>Sounds</strong> dropdown.</li>
<li>Click OK.</li>
</ol>
<img src="http://www.zulius.com/blog/?ak_action=api_record_view&id=393&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.zulius.com/how-to/turn-off-tortoisesvn-sounds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skip .svn directories when using grep</title>
		<link>http://www.zulius.com/how-to/grep-skip-svn-directories/</link>
		<comments>http://www.zulius.com/how-to/grep-skip-svn-directories/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 20:56:08 +0000</pubDate>
		<dc:creator>Tim White</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.zulius.com/?p=383</guid>
		<description><![CDATA[What You'll Need: grep 2.5.3+ I can't count how many times a day I use grep. It is an indispensable tool for searching the contents of configuration files, data files, and source code. One of the annoying side effects of grep is when searching a Subversion working copy recursively, all the hidden .svn directories also [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 158px"><img alt="grep returns .svn metadata" src="/img/blog/title-image-grepSkipSvn.jpg" title="grep returns .svn metadata" width="148" height="110" /><p class="wp-caption-text">grep returns .svn metadata files</p></div>
<p><strong>What You'll Need:</strong><br /> <a href="http://www.gnu.org/software/grep/">grep 2.5.3+</a>
</p>
<p>I can't count how many times a day I use grep.  It is an indispensable tool for searching the contents of configuration files, data files, and source code.</p>
<p>One of the annoying side effects of grep is when searching a Subversion working copy recursively, all the hidden .svn directories also get searched.  This can yield a lot of false positive matches since these directories contain <a href="http://svn.collab.net/repos/svn/trunk/doc/user/svn-best-practices.html">"pristine copies of all version-controlled files"</a>.</p>
<p>If you've got grep 2.5.3 or higher, it's easy to ignore .svn directories with the "--exclude-dir" option:</p>
<pre class="brush: plain;">$ grep -r --exclude-dir='.svn' 'my search string' /some/directory</pre>
<p>But that's a lot to type in each time you want to search your source code.  To save keystrokes, try setting up an alias in your home directory's .bashrc file that utilizes the --exclude-dir option (for Mac, use your home directory's .profile file.).  I call mine <strong>devgrep</strong>:</p>
<pre class="brush: plain;">alias devgrep=&quot;grep --exclude-dir='.svn'&quot;</pre>
<p>After adding the alias, don't forget to source your .bashrc:</p>
<pre class="brush: plain;">$ source ~/.bashrc</pre>
<p>Now whenever you need to search a Subversion working copy recursively, use the new alias to skip .svn directories:</p>
<pre class="brush: plain;">$ devgrep -rin 'doctype' /var/www/html/templates
./foo.tpl:1:&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
./bar.tpl:1:&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
./baz.phtml:1:&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Frameset//EN&quot; &quot;http://www.w3.org/TR/html4/frameset.dtd&quot;&gt;</pre>
<p>You can also exclude file types when grep'ing.  If you're a vim user, it can be helpful to skip .swp files in your alias:</p>
<pre class="brush: plain;">alias devgrep=&quot;grep --exclude-dir='.svn' --exclude='*.swp'&quot;</pre>
<p>Yet another workaround would be to use <a href="http://betterthangrep.com/">ack</a> - a Perl based, juiced up version of grep with a lot more features.</p>
<img src="http://www.zulius.com/blog/?ak_action=api_record_view&id=383&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.zulius.com/how-to/grep-skip-svn-directories/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>svnbak.pl: perl Subversion repository backup script</title>
		<link>http://www.zulius.com/freebies/perl-script-backup-subversion-repositories/</link>
		<comments>http://www.zulius.com/freebies/perl-script-backup-subversion-repositories/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 05:49:34 +0000</pubDate>
		<dc:creator>Tim White</dc:creator>
				<category><![CDATA[freebies]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.zulius.com/blog/?p=167</guid>
		<description><![CDATA[jQuery(document).ready(function(){jQuery("a[rel='colorbox']").colorbox();}); What is it? A Perl cron script that creates and rotates backups of one or more Subversion repositories. What does it do? Verifies repositories (svnadmin verify) Hot copies -or- dumps repositories (uses svnadmin hotcopy -or- svnadmin dump) Archives all repositories to a single tar file Gzips tar file Backup rotation Other Features Email notifications [...]]]></description>
			<content:encoded><![CDATA[<div style="margin: 0 auto; text-align: center"><a title="Download" href="http://www.zulius.com/scripts/svnbak.pl-0.0.8.tar.gz" target="_blank"><img src="/img/button-dl-orange.png" alt="" /></a></div>
<div style="float: right; padding: 0 5px; margin: 25px 0 0 0;">
<div class="wp-caption alignright" style="width: 160px"><a href="/img/blog/svnbak.pl/fullsize-ss.png" rel="colorbox"><img title="svnbak.pl executing" src="/img/blog/svnbak.pl/svnbak-titleImage.jpg" alt="svnbak.pl executing" width="150" height="110" /></a><p class="wp-caption-text">svnbak.pl executing</p></div><br />
<script type="text/javascript">jQuery(document).ready(function(){jQuery("a[rel='colorbox']").colorbox();});</script>
</div>
<div style="float: none"></div>
<h2>What is it?</h2>
<p>
A Perl cron script that creates and rotates backups of one or more Subversion repositories.
</p>
<h2>What does it do?</h2>
<ol>
<li>Verifies repositories (<a title="svnadmin verify" href="http://svnbook.red-bean.com/en/1.1/re41.html">svnadmin verify</a>)</li>
<li>Hot copies -or- dumps repositories (uses <a title="svnadmin hotcopy" href="http://svnbook.red-bean.com/en/1.0/re33.html">svnadmin hotcopy</a> -or- <a title="svnadmin dump" href="http://svnbook.red-bean.com/en/1.1/re31.html">svnadmin dump</a>)</li>
<li>Archives all repositories to a single tar file</li>
<li>Gzips tar file</li>
<li>Backup rotation</li>
</ol>
<h2>Other Features</h2>
<ul>
<li>Email notifications</li>
<li>Nice output</li>
<li>Free</li>
</ul>
<h2>Requirements</h2>
<p style="padding-left: 30px;">Operating System: *nix<br />
<a title="Perl" href="http://www.perl.org" target="_blank">Perl</a> (5.8.5 or higher)<br />
<a title="Subversion" href="http://subversion.tigris.org/">Subversion</a><br />
<a title="tar" href="http://www.gnu.org/software/tar/" target="_blank">tar</a><br />
<a title="gzip" href="http://www.gzip.org/" target="_blank">gzip</a>
</p>
<p style="padding-left: 30px;"><a title="Proc::Reliable" href="http://search.cpan.org/~dgold/Proc-Reliable-1.16/Reliable.pm" target="_blank">Proc::Reliable</a><br />
<a title="MIME::Lite" href="http://search.cpan.org/~rjbs/MIME-Lite-3.023/lib/MIME/Lite.pm" target="_blank">MIME::Lite</a><br />
<a title="Math::Round" href="http://search.cpan.org/~grommel/Math-Round-0.05/" target="_blank">Math::Round</a></p>
<h2>Configure</h2>
<div class="wp-caption aligncenter" style="width: 589px"><img style="border: 3px solid #000000;" title="Configuration Section" src="/img/blog/svnbak.pl/ss2.png" alt="svnbak.pl: Configuration Section" width="579" height="207" /><p class="wp-caption-text">svnbak.pl Configuration Section</p></div>
<p>At the top of svnbak.pl is a "Configuration Section" that you must add specific information to in order for the script to work.</p>
<ul>
<li><strong>reposDir</strong>: full path to your Subversion repository, or the parent directory of all your repositories.</li>
<li><strong>destDir</strong>: full path to the directory where the backups should be saved.  To save backups to a network file system, first mount the file system, then specify the mounted path.</li>
<li><strong>maxBaks</strong>: maximum number of backups to retain.  Once this limit is reached, the script will automatically remove the oldest backup based on it's last modified time.</li>
<li><strong>svnBakMethod:</strong> type of Subversion backup to create ('<a title="svnadmin hotcopy" href="http://svnbook.red-bean.com/en/1.0/re33.html">hotcopy</a>' or '<a title="svnadmin dump" href="http://svnbook.red-bean.com/en/1.1/re31.html">dump</a>').</li>
<li><strong>tarballName</strong>: the name of the backup file.  Each backup file will be appended with a 14 digit time stamp to preserve <span>singularity.</span></li>
<li><span><strong>tmpDir</strong>: full path to a <strong>new </strong>temporary directory to store files before tarballing.  This directory should not be an existing directory - it will be deleted!</span></li>
<li><strong>emailPref</strong>: when the admin should receive emails ('always', 'errors', 'none').</li>
<li><strong>displayTime</strong>: display execution time in seconds, per task.</li>
</ul>
<p style="text-align: center;">
<div style="margin: 0 auto; text-align: center"><a title="Download" href="http://www.zulius.com/scripts/svnbak.pl-0.0.8.tar.gz" target="_blank"><img src="/img/button-dl-orange.png" alt="" /></a></div>
<h2>Change Log</h2>
<p><strong>0.0.8 - 20111130</strong></p>
<ul>
<li>Repos are now tar'd and gzip'd locally in /tmp, and then transferred to the final destination dir.</li>
</ul>
<p><strong>0.0.7 - 20100209</strong></p>
<ul>
<li>fixed failure of external commands running longer than 60 seconds</li>
</ul>
<p><strong>0.0.6 - 20091116</strong></p>
<ul>
<li>fixed fatal error when backing up a single repository</li>
<li>destination directory is created if it does not already exist</li>
<li>changed elapsed time format: 'seconds' -> 's'</li>
</ul>
<p><strong>0.0.5 - 20090326</strong></p>
<ul>
<li>added backup option of dumping repositories via svnadmin dump</li>
<li>increased error checking</li>
<li>fixed: some repositories skipped when there was a large number of repositories</li>
</ul>
<p><strong>0.0.1 - 20090108</strong></p>
<ul>
<li>initial release<strong><br />
</strong></li>
</ul>
<img src="http://www.zulius.com/blog/?ak_action=api_record_view&id=167&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.zulius.com/freebies/perl-script-backup-subversion-repositories/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Automatically update a Subversion working copy on commit</title>
		<link>http://www.zulius.com/how-to/automatically-update-a-subversion-working-copy-on-commit/</link>
		<comments>http://www.zulius.com/how-to/automatically-update-a-subversion-working-copy-on-commit/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 04:21:19 +0000</pubDate>
		<dc:creator>Tim White</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.zulius.com/wordpress/?p=44</guid>
		<description><![CDATA[Requirements: Subversion gcc Platform: any Linux distro Keeping code up-to-date in multiple environments can be a pain in the ass. You might develop on one server, stage on another, and then have all your production code run on yet another server. Thus, getting the most recent code moved to each server can involve a lot [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 158px"><img alt="Subversion updating" src="/img/blog/postCommitTitleImage.png" title="Subversion updating" width="148" height="110" /><p class="wp-caption-text">Subversion updating</p></div>
<p><strong>Requirements:</strong><br />
<a href="http://subversion.tigris.org/">Subversion</a><br />
<a href="http://gcc.gnu.org/">gcc</a>
</p>
<p>
<strong>Platform:</strong><br />
any Linux distro
</p>
<p>Keeping code up-to-date in multiple environments can be a pain in the ass.  You might develop on one server, stage on another, and then have all your production code run on yet another server.  Thus, getting the most recent code moved to each server can involve a lot of updating from a code repository.</p>
<p>If you're using Subversion, it's possible to issue an update automatically anytime a commit is made to a repository.  This guide will detail setting up a <em>post-commit hook</em> to update a working copy residing on the same server of a repository.</p>
<p>The most painless way to implement this is with a self-compiled executable that executes the "svn update" command.  In this case we'll be compiling a C script so that the setuid bit can be set (*nix environments only allow the setuid bit to be set on executables).  This will allow the script to execute as root to avoid any permissions problems when updating the Subversion working copy.</p>
<p>Let's get rolling.  We need to find where the svn command binary is located.  Log on to the server where the repository and working copy are located and enter:</p>
<pre class="brush: plain;">$ whereis svn</pre>
<p>This should return something like:</p>
<pre class="brush: plain;">svn: /usr/bin/svn /usr/share/man/man1/svn.1.gz</pre>
<p>Make note of the first path (the above example is "/usr/bin/svn").  Create a new file called post-commit.c and enter the following code.  Make sure to enter the path to svn and the path to the working copy of your code:</p>
<pre class="brush: cpp; gutter: true;">#include &lt;stddef.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;unistd.h&gt;
int main(void)
{
  execl(&quot;/usr/bin/svn&quot;, &quot;svn&quot;, &quot;--config-dir&quot;, &quot;/root/.subversion&quot;,
           &quot;update&quot;, &quot;/path/to/working/copy&quot;,
        (const char *) NULL);
  return(EXIT_FAILURE);
}</pre>
<p>Now compile the script into an executable:</p>
<pre class="brush: plain;">$ gcc -o post-commit post-commit.c</pre>
<p>Set the setuid bit:</p>
<pre class="brush: plain;">$ chmod 4755 post-commit</pre>
<p>You now have an executable ready for some hot post-commit action.  You just need to copy it into your repository's hooks directory.  For example, if your repository is named "bar" and it's located in the "foo" directory, you would enter:</p>
<pre class="brush: plain;">$ mv post-commit /foo/bar/hooks/</pre>
<p>And you're good to go.  Anytime a commit is performed to the repository, the changes will be immediately reflected in the working copy.</p>
<h2>Troubleshooting</h2>
<p>If your post-commit is failing, you may need to disable Subversion password caching on your repository server.  Due to <a href="http://blogs.open.collab.net/svn/2009/07/subversion-16-security-improvements.html">Subversion 1.6's Security Improvements</a>, a plaintext password warning gets issued to the client on initial commands:</p>
<pre class="brush: plain;">
-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   &lt;https://www.mydomain.com&gt; My Repository

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)?
</pre>
<p>Since your post-commit hook has no way of responding to this warning, it will fail.  To fix this, edit file /root/.subversion/servers and add the following line under the [global] section:</p>
<pre class="brush: plain;">
store-passwords = no
</pre>
<img src="http://www.zulius.com/blog/?ak_action=api_record_view&id=44&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.zulius.com/how-to/automatically-update-a-subversion-working-copy-on-commit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

