<?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>tewari &#187; version-control</title>
	<atom:link href="http://www.tewari.info/category/version-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tewari.info</link>
	<description>Professional Software Development by Ash Tewari</description>
	<lastBuildDate>Thu, 03 Jun 2010 01:52:16 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SVN Merge &#8211; Selecting Changesets</title>
		<link>http://www.tewari.info/2010/04/25/svn-merge-selecting-changesets/</link>
		<comments>http://www.tewari.info/2010/04/25/svn-merge-selecting-changesets/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 00:15:31 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[version-control]]></category>
		<category><![CDATA[merge-tracking]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[TortoiseSVN]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2010/04/25/svn-merge-selecting-changesets/</guid>
		<description><![CDATA[	Here is a simple scenario – I have already merged changesets 45-55 from the trunk to branch b1. After this merge, more changes (56-60) were submitted into the trunk and I now need to merge those changes also to branch b1.
	Which changesets do you select to merge ? 56-60, right ? Well, not exactly. It [...]]]></description>
			<content:encoded><![CDATA[	<p>Here is a simple scenario – I have already merged changesets 45-55 from the trunk to branch b1. After this merge, more changes (56-60) were submitted into the trunk and I now need to merge those changes also to branch b1.</p>
	<p>Which changesets do you select to merge ? 56-60, right ? Well, not exactly. It depends. If you are using <a href="http://subversion.tigris.org/">Subversion</a> merge command, you will need to specify 55-60. If you are using <a href="http://tortoisesvn.net/">TortoiseSVN</a>, you will select 56-60. You should keep this in mind if you are used to TortoiseSVN and you are attempting a merge using SVN merge command. Otherwise, you will end up with a merge without change 56.</p>
	<p>Selecting changes to merge can become non-trivial when you don’t know which changes have already been merged. However, there is good news. With subversion 1.5, when you are selecting changes from source branch to merge into a target branch, don’t do it ! Subversion 1.5 onwards has built-in merge tracking. When using TortoiseSVN, if your intention is to merge all changes, just leave the changeset selection blank. Subversion knows which ones have already been merged and which ones to merge and it does it automatically. You can also select changes that have already been merged and those will be handled (excluded) automatically too.</p>
	<p>There is a summary of what to expect from Subversion Merge-Tracking feature here &#8211; <a href="http://blog.red-bean.com/sussman/?p=92">Subversion 1.5 merge-tracking in a nutshell</a>.</p>
	<p>There is detailed description of Subversion Merge-Tracking <a href="http://svn.apache.org/repos/asf/subversion/trunk/notes/merge-tracking/index.html">here</a> and search for ‘mergeinfo property’ in Subversion <a href="http://svnbook.red-bean.com/">documentation</a>.</p>
	<p><a href="http://www.tewari.info/wp-content/20100425_1151.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="changes already merged appear in grey" src="http://www.tewari.info/wp-content/20100425_1151_thumb.png" border="0" alt="changes already merged appear in grey" width="596" height="484" /></a></p>
	<p>The above screen-shot shows the changes already merged in grey. Thanks to Subversion’s mergeinfo property.</p>
	<p>So, can I just stop worrying about changesets altogether, when merging ? There are a few caveats to how mergeinfo metadata is (and sometimes not) recorded. Read this for more information -  <a href="http://svnbook.red-bean.com/en/1.5/svn.branchmerge.advanced.html#svn.branchmerge.advanced.finalword">The Final Word on Merge Tracking</a>.</p>
	<p>Read about <a href="http://subversion.tigris.org/">Subversion</a> merging and branching <a href="http://svnbook.red-bean.com/en/1.5/index.html">here</a> and <a href="http://tortoisesvn.net/">TortoiseSVN</a> merging documentation <a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-merge.html">here</a> – browse down to these sections : Reviewing the Merge Results and Merge Tracking.<hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=196&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_196" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2010/04/25/svn-merge-selecting-changesets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Validation in TortoiseSVN pre_commit_hook</title>
		<link>http://www.tewari.info/2010/03/31/code-validation-in-tortoisesvn-pre_commit_hook/</link>
		<comments>http://www.tewari.info/2010/03/31/code-validation-in-tortoisesvn-pre_commit_hook/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 04:32:10 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[version-control]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[pre_commit_hook]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[TortoiseSVN]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=178</guid>
		<description><![CDATA[	If you want to abort a commit if your code fails certain rule and you don&#8217;t have access to the SVN Server to configure a hook. What do you do ?
	Assuming you are using TortoiseSVN, you can configure a Client-Side hook.
	Here is an example &#8211; Say you want to abort commit if you have a [...]]]></description>
			<content:encoded><![CDATA[	<p>If you want to abort a commit if your code fails certain rule and you don&#8217;t have access to the <a title="svn" href="http://subversion.tigris.org/" target="_self">SVN </a>Server to configure a hook. What do you do ?</p>
	<p>Assuming you are using <a title="tortoisesvn" href="http://tortoisesvn.tigris.org/" target="_self">TortoiseSVN</a>, you can configure a <a title="tortoisesvn-client-side-hook" href="http://tortoisesvn.tigris.org/tsvn_1.5_releasenotes.html#client-side-hooks" target="_self">Client-Side hook</a>.</p>
	<p>Here is an example &#8211; Say you want to abort commit if you have a comment in your code that starts with <span style="color: #ff0000;"><strong>//Do Not Commit</strong></span>. You can create a <a title="wikipedia-powershell" href="http://en.wikipedia.org/wiki/Windows_PowerShell" target="_self">PowerShell </a>script that validates all the files in your changeset and use this script as a Client-Side pre_commit_hook in TortoiseSVN.</p>
	<p><div id="attachment_181" class="wp-caption alignnone" style="width: 628px"><img class="size-full wp-image-181" title="TortoiseSVN-Settings-HookScripts" src="http://www.tewari.info/wp-content/TortoiseSVN-Settings-HookScripts.png" alt="TortoiseSVN-Settings-HookScripts" width="618" height="410" /><p class="wp-caption-text">TortoiseSVN-Settings-HookScripts</p></div></p>
	<p>The pre_commit_hook configuration :</p>
	<p><div id="attachment_182" class="wp-caption alignnone" style="width: 638px"><img class="size-full wp-image-182" title="Configure-Hook-Scripts" src="http://www.tewari.info/wp-content/Configure-Hook-Scripts.png" alt="Configure-Hook-Scripts" width="628" height="235" /><p class="wp-caption-text">Configure-Hook-Scripts</p></div></p>
	<p>//Powershell script : pre_commit.ps1</p>
	<p><span style="color: #ff0000;">$donotcommit</span> = <span style="color: #993300;">&#8220;//Do Not Commit</span>&#8220;;</p>
	<p><span style="color: #ff0000;">$changeset</span> =<span style="color: #0000ff;"> Get-Content</span> <span style="color: #ff6600;">$args</span><span style="color: #000000;">[<span style="color: #993300;">0</span>]</span>;</p>
	<p><span style="color: #0000ff;">foreach</span>(<span style="color: #ff6600;">$file</span> in <span style="color: #ff6600;">$changeset</span>)<br />
{<br />
<span style="color: #0000ff;"> if</span>( <span style="color: #0000ff;">Get-Content</span> <span style="color: #ff6600;">$file</span> | <span style="color: #0000ff;">Select-String</span> <span style="color: #ff6600;">$donotcommit</span> <span style="color: #0000ff;">-quiet</span> )<br />
{<br />
<span style="color: #0000ff;">Write-Error</span> &#8220;<span style="color: #993300;">$file contains code that you are not supposed to commit. [$donotcommit]</span>&#8220;;<br />
<span style="color: #0000ff;">exit</span> <span style="color: #993300;">9</span>;<br />
}<br />
}</p>
	<p>Now, if your changeset has a file with a comment starting with <strong><span style="color: #ff0000;">//Do Not Commit</span></strong> and you click on OK to commit this change, the commit will be aborted with this error message -</p>
	<p><div id="attachment_191" class="wp-caption alignnone" style="width: 612px"><img class="size-full wp-image-191" title="pre_commit_hook-validation" src="http://www.tewari.info/wp-content/pre_commit_hook-validation1.png" alt="pre_commit_hook-validation" width="602" height="293" /><p class="wp-caption-text">pre_commit_hook-validation</p></div><hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=178&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_178" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2010/03/31/code-validation-in-tortoisesvn-pre_commit_hook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Schema Version Control Tool</title>
		<link>http://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/</link>
		<comments>http://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 03:05:52 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[freeware]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[version-control]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[database schema]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[DBMS]]></category>
		<category><![CDATA[DbUpdater]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Evolutionary]]></category>
		<category><![CDATA[free tool]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[schema version]]></category>
		<category><![CDATA[SchemaVersionsLog]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[sql scripts]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[version control tool]]></category>
		<category><![CDATA[Versioning]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/</guid>
		<description><![CDATA[	It is essential to treat database schema as source code  and apply all the norms and best practices applicable to it. From what I hear  and read, database schema version control is non-existent in too many  projects.
	Various techniques to accomplish version control of  database schemas have been discussed and published. Martin [...]]]></description>
			<content:encoded><![CDATA[	<p designtimesp="18554">It is essential to treat database schema as source code  and apply all the norms and best practices applicable to it. From what I hear  and read, database schema version control is non-existent in too many  projects.</p>
	<p designtimesp="18555">Various techniques to accomplish version control of  database schemas have been discussed and published. Martin Fowler and Pramod  Sadagale has written a comprehensive article on <a href="http://martinfowler.com/articles/evodb.html" designtimesp="18556">Evolutionary Database  Design</a>. It is a must-read for everyone involved with database  development.</p>
	<p designtimesp="18562">K. Scott Allen writes in detail about an  excellent system here &#8211; <a href="http://odetocode.com/Blogs/scott/archive/2008/02/02/11721.aspx" title="Versioning Databases - Change Scripts" designtimesp="18561">Versioning Databases &#8211; Change Scripts</a>. This approach  is sufficiently light-weight (for my taste) and provides complete control over  the whole process.</p>
	<p designtimesp="18562">I am providing a free tool here that you can use to  implement this system. It will even create the SchemaVersionsLog table for your  database, if it doesn&#8217;t exist. If you are using this tool with MSSQL Server, you  can get started with very little effort. If you are using a different DBMS, you  can still use this tool. It uses NHibernate to access the SchemaVersionsLog  table. So, any DBMS supported by NHibernate is acceptable, as long as it comes with a command line tool to execute the sql scripts.</p>
	<p designtimesp="18562">Download <a href="http://www.tewari.info/dbupdater/" title="DbUpdater : Database Schema Version Control" target="_blank">DbUpdater here</a>.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=17&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_17" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
