<?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>beer planet &#187; co</title> <atom:link href="http://beerpla.net/tag/co/feed/" rel="self" type="application/rss+xml" /><link>http://beerpla.net</link> <description>where things have nothing to do with beer - tutorials, tips, how-tos, thoughts, hacks, and other techy nonsense</description> <lastBuildDate>Fri, 06 Jan 2012 08:50:59 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel='hub' href='http://beerpla.net/?pushpress=hub'/> <item><title>How To Check If The Local SVN Revision Is Up-To-Date</title><link>http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/</link> <comments>http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/#comments</comments> <pubDate>Thu, 24 Jul 2008 05:46:15 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[checkout]]></category> <category><![CDATA[co]]></category> <category><![CDATA[compare]]></category> <category><![CDATA[dry run]]></category> <category><![CDATA[revision]]></category> <category><![CDATA[SVN]]></category> <category><![CDATA[up]]></category> <category><![CDATA[up-to-date]]></category> <category><![CDATA[update]]></category> <guid
isPermaLink="false">http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/</guid> <description><![CDATA[<p>I&#039;ve encountered a problem recently where I had to figure out if some checked out code is up-to-date with the svn repository, without actually running svn update. Unfortunately, svn update doesn&#039;t have a dry-run option, so I had to find another solution.</p><p>I came up with 2, depending on how detailed the information needs to be, which I&#039;m about to share in this post.</p><p><strong>1. If you want exact file and directory names, you can run:</strong></p><p><div
class="wp_syntax"><div
class="code"><pre>svn status -u</pre></div></div></p><p>If any files need updating, you will see a * before the file name.</p><p><font
face="consolas"></font></p><div
class="wp_syntax"><div
class="code"><pre>svn status wc
M     wc/bar.c
A  +   wc/qax.c</pre></div></div><p></p><p><font
face="consolas"></font></p><div
class="wp_syntax"><div
class="code"><pre>svn status -u wc
M            965    wc/bar.c
       *     965    wc/foo.c
A</pre></div></div><p>...<div
class=clear></div> <a
href="http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p>I&#039;ve encountered a problem recently where I had to figure out if some checked out code is up-to-date with the svn repository, without actually running svn update. Unfortunately, svn update doesn&#039;t have a dry-run option, so I had to find another solution.</p><p>I came up with 2, depending on how detailed the information needs to be, which I&#039;m about to share in this post.</p><p><strong>1. If you want exact file and directory names, you can run:</strong></p><p><div
class="wp_syntax"><div
class="code"><pre>svn status -u</pre></div></div></p><p>If any files need updating, you will see a * before the file name.</p><p><font
face="consolas"></p><div
class="wp_syntax"><div
class="code"><pre>svn status wc
M     wc/bar.c
A  +   wc/qax.c</pre></div></div><p></font></p><p><font
face="consolas"></p><div
class="wp_syntax"><div
class="code"><pre>svn status -u wc
M            965    wc/bar.c
       *     965    wc/foo.c
A  +         965    wc/qax.c
Status against revision:   981</pre></div></div><p></font></p><p><font
face="consolas">Or more verbose</font></p><p><font
face="consolas"></p><div
class="wp_syntax"><div
class="code"><pre>svn status --show-updates --verbose wc
M            965       938 kfogel       wc/bar.c
       *     965       922 sussman      wc/foo.c
A  +         965       687 joe          wc/qax.c
             965       687 joe          wc/zig.c
Status against revision:   981</pre></div></div><p></font></p><p>Parsing the output in Perl, for instance, should be trivial. A connection to the repository is established for this check, so be sure to catch in your code the times when such connection is not available.</p><p><strong>2. If you only care about whether a specific directory needs to be updated or not, here&#039;s a quicker method:</strong></p><p>svn info vs svn info -rHEAD</p><p><div
class="wp_syntax"><div
class="code"><pre>cd somedir;
svn info -r HEAD | grep -i &quot;Last Changed Rev&quot;
Last Changed Rev: 8544
svn info | grep -i &quot;Last Changed Rev&quot;
Last Changed Rev: 8531</pre></div></div></p><p>If these numbers are not the same, an update is needed.</p><p>What can I be missing? Are there any other creative ways, or is svn update going to support dry-run? Feel free to leave a comment if you know something I don&#039;t.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Check+If+The+Local+SVN+Revision+Is+Up-To-Date&amp;link=http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/&amp;notes=I%27ve%20encountered%20a%20problem%20recently%20where%20I%20had%20to%20figure%20out%20if%20some%20checked%20out%20code%20is%20up-to-date%20with%20the%20svn%20repository%2C%20without%20actually%20running%20svn%20update.%20Unfortunately%2C%20svn%20update%20doesn%27t%20have%20a%20dry-run%20option%2C%20so%20I%20had%20to%20find%20another%20solution.%20I%20came%20up%20with%202%2C%20depending%20on%20how%20detailed%20t&amp;short_link=http://bit.ly/bpdXJa&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Check+If+The+Local+SVN+Revision+Is+Up-To-Date&amp;link=http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/&amp;notes=I%27ve%20encountered%20a%20problem%20recently%20where%20I%20had%20to%20figure%20out%20if%20some%20checked%20out%20code%20is%20up-to-date%20with%20the%20svn%20repository%2C%20without%20actually%20running%20svn%20update.%20Unfortunately%2C%20svn%20update%20doesn%27t%20have%20a%20dry-run%20option%2C%20so%20I%20had%20to%20find%20another%20solution.%20I%20came%20up%20with%202%2C%20depending%20on%20how%20detailed%20t&amp;short_link=http://bit.ly/bpdXJa&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Check+If+The+Local+SVN+Revision+Is+Up-To-Date&amp;link=http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/&amp;notes=I%27ve%20encountered%20a%20problem%20recently%20where%20I%20had%20to%20figure%20out%20if%20some%20checked%20out%20code%20is%20up-to-date%20with%20the%20svn%20repository%2C%20without%20actually%20running%20svn%20update.%20Unfortunately%2C%20svn%20update%20doesn%27t%20have%20a%20dry-run%20option%2C%20so%20I%20had%20to%20find%20another%20solution.%20I%20came%20up%20with%202%2C%20depending%20on%20how%20detailed%20t&amp;short_link=http://bit.ly/bpdXJa&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Check+If+The+Local+SVN+Revision+Is+Up-To-Date&amp;link=http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/&amp;notes=I%27ve%20encountered%20a%20problem%20recently%20where%20I%20had%20to%20figure%20out%20if%20some%20checked%20out%20code%20is%20up-to-date%20with%20the%20svn%20repository%2C%20without%20actually%20running%20svn%20update.%20Unfortunately%2C%20svn%20update%20doesn%27t%20have%20a%20dry-run%20option%2C%20so%20I%20had%20to%20find%20another%20solution.%20I%20came%20up%20with%202%2C%20depending%20on%20how%20detailed%20t&amp;short_link=http://bit.ly/bpdXJa&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Check+If+The+Local+SVN+Revision+Is+Up-To-Date&amp;link=http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/&amp;notes=I%27ve%20encountered%20a%20problem%20recently%20where%20I%20had%20to%20figure%20out%20if%20some%20checked%20out%20code%20is%20up-to-date%20with%20the%20svn%20repository%2C%20without%20actually%20running%20svn%20update.%20Unfortunately%2C%20svn%20update%20doesn%27t%20have%20a%20dry-run%20option%2C%20so%20I%20had%20to%20find%20another%20solution.%20I%20came%20up%20with%202%2C%20depending%20on%20how%20detailed%20t&amp;short_link=http://bit.ly/bpdXJa&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Check+If+The+Local+SVN+Revision+Is+Up-To-Date&amp;link=http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/&amp;notes=I%27ve%20encountered%20a%20problem%20recently%20where%20I%20had%20to%20figure%20out%20if%20some%20checked%20out%20code%20is%20up-to-date%20with%20the%20svn%20repository%2C%20without%20actually%20running%20svn%20update.%20Unfortunately%2C%20svn%20update%20doesn%27t%20have%20a%20dry-run%20option%2C%20so%20I%20had%20to%20find%20another%20solution.%20I%20came%20up%20with%202%2C%20depending%20on%20how%20detailed%20t&amp;short_link=http://bit.ly/bpdXJa&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Check+If+The+Local+SVN+Revision+Is+Up-To-Date&amp;link=http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/&amp;notes=I%27ve%20encountered%20a%20problem%20recently%20where%20I%20had%20to%20figure%20out%20if%20some%20checked%20out%20code%20is%20up-to-date%20with%20the%20svn%20repository%2C%20without%20actually%20running%20svn%20update.%20Unfortunately%2C%20svn%20update%20doesn%27t%20have%20a%20dry-run%20option%2C%20so%20I%20had%20to%20find%20another%20solution.%20I%20came%20up%20with%202%2C%20depending%20on%20how%20detailed%20t&amp;short_link=http://bit.ly/bpdXJa&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=How%20To%20Check%20If%20The%20Local%20SVN%20Revision%20Is%20Up-To-Date&amp;link=http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/&amp;notes=I%27ve%20encountered%20a%20problem%20recently%20where%20I%20had%20to%20figure%20out%20if%20some%20checked%20out%20code%20is%20up-to-date%20with%20the%20svn%20repository%2C%20without%20actually%20running%20svn%20update.%20Unfortunately%2C%20svn%20update%20doesn%27t%20have%20a%20dry-run%20option%2C%20so%20I%20had%20to%20find%20another%20solution.%20I%20came%20up%20with%202%2C%20depending%20on%20how%20detailed%20t&amp;short_link=http://bit.ly/bpdXJa&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2010/02/20/how-to-view-a-specific-svn-revision-in-your-browser/" rel="bookmark" title="February 20, 2010">How To View A Specific SVN Revision In Your Browser</a></li><li><a
href="http://beerpla.net/2008/06/16/how-to-svn-update-all-your-wordpress-plugins-in-one-go/" rel="bookmark" title="June 16, 2008">How To SVN Update All Your WordPress Plugins In One Go</a></li><li><a
href="http://beerpla.net/2006/07/15/converting-from-cvs-to-svn-developers-notes-and-why-svn-is-better/" rel="bookmark" title="July 15, 2006">Converting from CVS to SVN: Developer&#039;s Notes And Why SVN Is Better</a></li><li><a
href="http://beerpla.net/2010/03/06/how-to-show-hiddeninvisible-files-in-total-commander-both-locally-and-on-an-ftp-server/" rel="bookmark" title="March 6, 2010">How To Show Hidden/Invisible Files In Total Commander, Both Locally And On An FTP Server</a></li><li><a
href="http://beerpla.net/2009/06/20/how-to-properly-set-svn-svnexternals-property-in-svn-command-line/" rel="bookmark" title="June 20, 2009">How To Properly Set SVN svn:externals Property In SVN Command Line</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2008%2F07%2F23%2Fhow-to-check-if-the-local-svn-revision-is-up-to-date%2F&amp;title=How%20To%20Check%20If%20The%20Local%20SVN%20Revision%20Is%20Up-To-Date" id="wpa2a_2"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2008/07/23/how-to-check-if-the-local-svn-revision-is-up-to-date/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
