<?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>One Man's Walk in work &#187; subversion</title>
	<atom:link href="http://onemanswalk.com/work/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://onemanswalk.com/work</link>
	<description>jeremy lightsmith on agile, ruby, and consulting</description>
	<lastBuildDate>Wed, 04 May 2011 04:29:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Working with iWork and Subversion</title>
		<link>http://onemanswalk.com/work/2007/11/04/working-with-iwork-and-subversion/</link>
		<comments>http://onemanswalk.com/work/2007/11/04/working-with-iwork-and-subversion/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 22:56:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iwork]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	So I&#8217;m a big fan of iWork &#8216;08, pages is nice enough, doesn&#8217;t get in my way, etc.  Numbers is pretty awesome.  It&#8217;s been a while since someone did something revolutionary in the spreadsheet world.  Numbers is it.

	I do have a couple gripes.

	1) if I open a word or excel file, when [...]]]></description>
			<content:encoded><![CDATA[	<p>So I&#8217;m a big fan of iWork &#8216;08, pages is nice enough, doesn&#8217;t get in my way, etc.  Numbers is pretty awesome.  It&#8217;s been a while since someone did something revolutionary in the spreadsheet world.  Numbers is it.</p>

	<p>I do have a couple gripes.</p>

	<p>1) if I open a word or excel file, when I save, it should be saved back to that same word or excel file.  Not all my friends have macs, let alone iWork, why can&#8217;t I save back to the file I opened?  And if I have to do the extra export step, why does iWork forget where the file came from?  Grr.</p>

	<p>2) I am a total excel power user, and numbers is still missing a bunch of features for addins, macros, etc.  It doesn&#8217;t even have applescript support yet as far as I can tell (I&#8217;m sure it will, though, and I am glad they released before they had it)  I&#8217;ve been getting by on a manual export to csv so I can munge data.</p>

	<p>3) and what this blog post is about, is that iWork does not play nice w/ subversion.</p>

	<p>iWork stores it&#8217;s files in &#8220;bundles&#8221; which are actually directories even though they look like files from finder.  When you have stored one of these bundles in subversion, there will be .svn directories inside of it, containing subversion metadata.  The problem comes that every time you save a file in iWork, the entire bundle is replaced w/ the new copy&#8230;and <span class="caps">ALL </span>.svn directories are destroyed.</p>

	<p>This basically renders subversion useless for iWork files.  This is no good, there are some pretty painful <a href="http://www.jpbutler.com/2007/08/29/workaround-for-iwork-and-subversion/" title="">workarounds</a> on the net, and there are a few scripts that turned up, but I wrote my own.</p>

	<p>This script (I call it svn_restore_dirs) will search any subdirectories of the current working directory for files ending in .numbers, .pages, etc.  It will then redownload .svn directories for any of these that are missing theirs.</p>

	<p>Seems to work, and is simple enough.  I wish apple would get their act together.</p>

	<p>Enjoy the script</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'fileutils'</span>
&nbsp;
EXTENSIONS_TO_SEARCH = <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>numbers pages key graffle<span style="color:#006600; font-weight:bold;">&#41;</span>
TMP_DIR = <span style="color:#996600;">&quot;/tmp/missing_svn&quot;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> find_directories_without_svn_dirs
  search_pattern = EXTENSIONS_TO_SEARCH.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>ext<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#996600;">&quot;-name <span style="color:#000099;">\&quot;</span>*.#{ext}<span style="color:#000099;">\&quot;</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot; -or &quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  dirs = <span style="color:#996600;">`find . <span style="color:#000099;">\\</span>( #{search_pattern} <span style="color:#000099;">\\</span>) -type d`</span>.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  dirs.<span style="color:#9900CC;">reject</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>dir<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>dir, <span style="color:#996600;">&quot;.svn&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>  
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> get_url_for<span style="color:#006600; font-weight:bold;">&#40;</span>file<span style="color:#006600; font-weight:bold;">&#41;</span>
  info = <span style="color:#996600;">`svn info &quot;#{file}&quot;`</span>
  <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#996600;">&quot;can't parse #{info}&quot;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> info =~ <span style="color:#006600; font-weight:bold;">/</span>URL\: <span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#9900CC;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">/</span>
  <span style="color:#0000FF; font-weight:bold;">return</span> $<span style="color:#006666;">1</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> copy_svn_dirs<span style="color:#006600; font-weight:bold;">&#40;</span>from, to<span style="color:#006600; font-weight:bold;">&#41;</span>
  to = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">expand_path</span><span style="color:#006600; font-weight:bold;">&#40;</span>to<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">chdir</span> from <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#CC00FF; font-weight:bold;">Dir</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;**/.svn&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>svn_dir<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC00FF; font-weight:bold;">FileUtils</span>.<span style="color:#9900CC;">mv</span> svn_dir, <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>to, svn_dir<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
find_directories_without_svn_dirs.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>dir<span style="color:#006600; font-weight:bold;">|</span>
  url = get_url_for<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span>dir<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;replacing svn dirs for #{dir} from #{url}/#{File.basename(dir)}&quot;</span>
&nbsp;
  <span style="color:#CC00FF; font-weight:bold;">FileUtils</span>.<span style="color:#9900CC;">rm_rf</span><span style="color:#006600; font-weight:bold;">&#40;</span>TMP_DIR<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>TMP_DIR<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#996600;">`svn co &quot;#{url}/#{File.basename(dir)}&quot; #{TMP_DIR}`</span>
&nbsp;
  copy_svn_dirs<span style="color:#006600; font-weight:bold;">&#40;</span>TMP_DIR, dir<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> $? == <span style="color:#006666;">0</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>





 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2007/11/04/working-with-iwork-and-subversion/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rubyforge Now Has Subversion!!!</title>
		<link>http://onemanswalk.com/work/2006/01/24/rubyforge-now-has-subversion/</link>
		<comments>http://onemanswalk.com/work/2006/01/24/rubyforge-now-has-subversion/#comments</comments>
		<pubDate>Tue, 24 Jan 2006 23:03:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	It&#8217;s about freekin&#8217; time!

	It looks like sourceforge isn&#8217;t far behind, either.

	I&#8217;ve been torn on every new project I&#8217;ve started on either of these sites between self hosting, and getting tons of svn happiness, or being a good oss citizen and getting out of the box standards and integration. Now I don&#8217;t have to make that [...]]]></description>
			<content:encoded><![CDATA[	<p>It&#8217;s about freekin&#8217; time!</p>

	<p>It looks like sourceforge isn&#8217;t far behind, either.</p>

	<p>I&#8217;ve been torn on every new project I&#8217;ve started on either of these sites between self hosting, and getting tons of svn happiness, or being a good oss citizen and getting out of the box standards and integration. Now I don&#8217;t have to make that decision anymore.</p>

	<p>Go team.</p>

 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2006/01/24/rubyforge-now-has-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

