<?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>Tsukasa's ramblings &#187; Mercurial</title>
	<atom:link href="http://blag.tsukasa.net.au/category/programming/mercurial/feed/" rel="self" type="application/rss+xml" />
	<link>http://blag.tsukasa.net.au</link>
	<description>Tech ramblings of Greg Darke, a University of Sydney student</description>
	<lastBuildDate>Fri, 28 May 2010 12:40:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Of databases and repositories</title>
		<link>http://blag.tsukasa.net.au/2008/10/06/of-databases-and-repositories/</link>
		<comments>http://blag.tsukasa.net.au/2008/10/06/of-databases-and-repositories/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 12:13:41 +0000</pubDate>
		<dc:creator>Tsukasa</dc:creator>
				<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://blag.tsukasa.net.au/?p=39</guid>
		<description><![CDATA[One thing that most programmers will cringe at, is the thought of placing a database into a version control repository such as subversion or mercurial. Now I know that many of have done this for various reasons (I know I am guilty of it myself).
The point of this post is to show how this can [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that most programmers will cringe at, is the thought of placing a database into a version control repository such as <a href="http://subversion.tigris.org/">subversion</a> or <a href="http://www.selenic.com/mercurial/">mercurial</a>. Now I know that many of have done this for various reasons (I know I am guilty of it myself).</p>
<p>The point of this post is to show how this can be made a little nicer under mercurial using <a href="http://www.selenic.com/mercurial/wiki/index.cgi/EncodeDecodeFilter">encode/decode filters</a>. With a carefully constructed set of filters, you are able to actually perform text diffs and make sane merges between repositories. All you have to do is drop the following into your hgrc file (either the one in your project or ~/.hgrc):</p>
<p><!-- File:081006_encode_decode_filter.hgrc -->
<div class="codeBlock">
<pre class="VimPre">[encode]
data.db = tempfile: sqlite3 INFILE .dump &gt; OUTFILE

[decode]
data.db = tempfile: sqlite3 OUTFILE '.read INFILE'</pre>
</div>
<p>This requires that you have the sqlite3 binary installed, otherwise you will end up with a data.db file containing the raw sql used to generate the database.</p>
]]></content:encoded>
			<wfw:commentRss>http://blag.tsukasa.net.au/2008/10/06/of-databases-and-repositories/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
