<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Magp.ie &#187; revision</title>
	<atom:link href="http://magp.ie/tag/revision/feed/" rel="self" type="application/rss+xml" />
	<link>http://magp.ie</link>
	<description>A nest for the random, shiny, online tidbits I stumble across...</description>
	<lastBuildDate>Wed, 16 May 2012 09:40:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='magp.ie' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/061e340c5da13b5a41ae8016bee03aa8?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Magp.ie &#187; revision</title>
		<link>http://magp.ie</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://magp.ie/osd.xml" title="Magp.ie" />
	<atom:link rel='hub' href='http://magp.ie/?pushpress=hub'/>
		<item>
		<title>Revert or rollback a SVN revision</title>
		<link>http://magp.ie/2010/03/25/revert-or-rollback-a-svn-revision/</link>
		<comments>http://magp.ie/2010/03/25/revert-or-rollback-a-svn-revision/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 18:47:02 +0000</pubDate>
		<dc:creator>Eoin</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[revert]]></category>
		<category><![CDATA[revision]]></category>
		<category><![CDATA[rollback]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://magp.ie/?p=154</guid>
		<description><![CDATA[If you have ever deployed code from a SVN repository with a bug in it and you need to revert to a working revision then you may find the following handy. First find the revision numbers for the file(s) in &#8230; <a href="http://magp.ie/2010/03/25/revert-or-rollback-a-svn-revision/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magp.ie&#038;blog=11708208&#038;post=154&#038;subd=blogalhost&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have ever deployed code from a SVN repository with a bug in it and you need to revert to a working revision then you may find the following handy.</p>
<p>First find the revision numbers for the file(s) in question.</p>
<p>Use the <a href="http://svnbook.red-bean.com/en/1.0/re15.html" target="_blank">log</a> command to get the info from previous commits including revision numbers.</p>
<p>So something like&#8230;<span id="more-154"></span><br />
<pre class="brush: plain;">
svn log update-data.php 
--------------------------------------------------------------
r4057 | eoin | 2010-03-25 17:33:32 +0000 (Thu, 25 Mar 2010) | 1 line

turn on db errors
--------------------------------------------------------------
r4056 | eoin | 2010-03-25 17:32:36 +0000 (Thu, 25 Mar 2010) | 1 line

add update file
--------------------------------------------------------------
</pre></p>
<p>Use <a href="http://svnbook.red-bean.com/en/1.0/re09.html" target="_blank">diff</a> command to see the difference between the 2 revisions.<br />
<pre class="brush: plain;">
svn diff -r 4056:4057
Index: update-data.php
=============================================
--- update-data.php	(revision 4056)
+++ update-data.php	(revision 4057)
@@ -6,7 +6,7 @@
 
-$db-&gt;show_errors = false;
+$db-&gt;show_errors = true;
</pre></p>
<p>Sometimes this is all you need, as you can see the mistake you made. Now you can make a change to the working copy and commit a fix. However if there were too many changes to do yourself, you may prefer to revert to the last known good revision. In this case, you will need to merge the changes from your current revision back to the revision you want to revert to.</p>
<p>You should try a dry run to see what a the outcome of a merge will be before you execute the real merge.<br />
<pre class="brush: plain;">
svn merge --dry-run -r 4057:4056 update-data.php 
U    update-data.php
</pre></p>
<p>Now execute the <a href="http://svnbook.red-bean.com/en/1.1/re16.html" target="_blank">merge</a> command to revert to previous revision.<br />
<pre class="brush: plain;">
svn merge -r 4057:4056 update-data.php 
U    update-data.php

svn diff update-data.php 
Index: update-data.php
==============================================
--- update-data.php	(revision 4057)
+++ update-data.php	(working copy)
@@ -6,7 +6,7 @@
 
-$db-&gt;show_errors = true;
+$db-&gt;show_errors = false;
</pre></p>
<p>Use a diff to see the changes made after the merge and you should see that the change(s) made have been undone. Now commit the working copy to include this change and all&#8217;s well in the world again.<br />
<pre class="brush: plain;">
svn -m 'turn off db errors again' commit update-data.php
</pre></p>
<p>One final point, be <strong>super</strong> careful with a merge, things can get real <em>messy</em>!<br />
Take your time, make sure you use <strong>diff</strong> to see what changes have been made and check again when your through <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Really good and detailed explanation of the revert process from <a href="http://aralbalkan.com/1381" target="_blank">aralbalkan</a>.</p>
<br />Filed under: <a href='http://magp.ie/category/guides/'>Guides</a> Tagged: <a href='http://magp.ie/tag/revert/'>revert</a>, <a href='http://magp.ie/tag/revision/'>revision</a>, <a href='http://magp.ie/tag/rollback/'>rollback</a>, <a href='http://magp.ie/tag/svn/'>SVN</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogalhost.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogalhost.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogalhost.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogalhost.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogalhost.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogalhost.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogalhost.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogalhost.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogalhost.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogalhost.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogalhost.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogalhost.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogalhost.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogalhost.wordpress.com/154/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magp.ie&#038;blog=11708208&#038;post=154&#038;subd=blogalhost&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magp.ie/2010/03/25/revert-or-rollback-a-svn-revision/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>53.734750 -8.989992</georss:point>
		<geo:lat>53.734750</geo:lat>
		<geo:long>-8.989992</geo:long>
		<media:content url="http://1.gravatar.com/avatar/72dd449e5e79e046c1c09ed8712b525a?s=96&#38;d=monsterid&#38;r=PG" medium="image">
			<media:title type="html">eoigal</media:title>
		</media:content>
	</item>
	</channel>
</rss>
