<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Derik Whittaker : HowTo, Craftsmanship</title><link>http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/Craftsmanship/default.aspx</link><description>Tags: HowTo, Craftsmanship</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Automating Merges w/ TortoiseSVN</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/05/13/automating-merges-w-tortoisesvn.aspx</link><pubDate>Thu, 13 May 2010 10:31:30 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:58821</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=58821</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=58821</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/05/13/automating-merges-w-tortoisesvn.aspx#comments</comments><description>&lt;p&gt;Our team works off the &lt;a href="http://martinfowler.com/bliki/FeatureBranch.html"&gt;feature branch&lt;/a&gt; concept and because of this the various teams need to do a source-to-branch merge on a consistent interval.&amp;#160; Doing this process is not difficult, but it is reparative and could become error prone if you are not paying attention.&amp;#160; Because of this we have created a simple .bat script which will aid in automating most of the repetitive tasks which should reduce the amount of errors we encounter. &lt;/p&gt;  &lt;p&gt;The script (this is v1 of the script so there may be improvements we could make) is as follows:&lt;/p&gt;  &lt;p&gt;CLS    &lt;br /&gt;ECHO OFF     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;REM -- These values may need to change, but not all that often    &lt;br /&gt;SET TortoiseSvnLocation=&amp;quot;C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe&amp;quot; &lt;/p&gt;  &lt;p&gt;REM -- Make sure to change these values    &lt;br /&gt;SET /p TrunkHead=Please Enter the latest revision for the Trunk (should be HEAD):     &lt;br /&gt;SET /p BranchHead=Please Enter the latest revision for the Branch (should be HEAD):     &lt;br /&gt;SET /p TrunkStartRevision=Please Enter the Start Revision:     &lt;br /&gt;SET /p TrunkEndRevision=Please Enter the End Revision: &lt;/p&gt;  &lt;p&gt;REM -- Make sure you have the physical locations correct    &lt;br /&gt;SET TrunkLocationOnDisk=&amp;quot;C:\Source\Trunk&amp;quot;     &lt;br /&gt;SET BranchLocationOnDisk=&amp;quot;C:\Source\\Branch&amp;quot; &lt;/p&gt;  &lt;p&gt;REM -- Make sure you have the Url&amp;#39;s pointing to the correct location on disk    &lt;br /&gt;SET TrunkUrl=https://URL_TO_ROOT_SOURCE     &lt;br /&gt;SET BranchUrl=https:/URL_TO_BRANCH_SOURCE&lt;/p&gt;  &lt;p&gt;ECHO Chaning To Trunk Location    &lt;br /&gt;CD %TrunkLocationOnDisk% &lt;/p&gt;  &lt;p&gt;ECHO /* About to update the trunk to the %TrunkHead% */    &lt;br /&gt;%TortoiseSvnLocation% /command:update /rev:%TrunkHead% /path:%TrunkLocationOnDisk% /closeonend:1 &lt;/p&gt;  &lt;p&gt;ECHO Chaning To Branch Location    &lt;br /&gt;CD %BranchLocationOnDisk% &lt;/p&gt;  &lt;p&gt;ECHO /* About to update the branch to the %BranchHead% */    &lt;br /&gt;%TortoiseSvnLocation% /command:update /rev:%BranchHead% /path:%BranchLocationOnDisk% /closeonend:1 &lt;/p&gt;  &lt;p&gt;%TortoiseSvnLocation% /command:merge /path:%BranchLocationOnDisk% /fromurl:%TrunkUrl% /revrange:%TrunkStartRevision%-%TrunkEndRevision% &lt;/p&gt;  &lt;p&gt;pause&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The intent of the script is do perform the following actions&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;CD into the folder for the trunk&lt;/li&gt;    &lt;li&gt;Pull latest of the trunk (SVN path provided in TrunkURL)&lt;/li&gt;    &lt;li&gt;CD into the folder for the branch&lt;/li&gt;    &lt;li&gt;Pull latest of the branch (SVN path provided in BranchURL)&lt;/li&gt;    &lt;li&gt;Run the merge command and provide the start-stop revisions (which are provided via user imput)&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;As you can see the script is not rocket science, but it does work and it does save you having to perform the same repetitive steps over and over again.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=58821" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Craftsmanship/default.aspx">Craftsmanship</category></item></channel></rss>