<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Isshen, LLC: Category Subversion/SVK</title>
    <link>http://blog.isshen.com/articles/category/subversion-svk</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Subversion 1.4.4 upgrade</title>
      <description>&lt;p&gt;Adam had recently got a MacBookPro. We no longer have to mess with InstantRails on Windows. It also means he can use native Subversion and SVK. However, &lt;a href="http://homepage.mac.com/hiirem/svkbuilds.html"&gt;the OSX-native package&lt;/a&gt; uses Subversion 1.4. Our servers uses Subversion 1.3.x. To be fully compatible, that would mean compiling a custom copy of Subversion 1.3.&lt;/p&gt;

&lt;p&gt;After reading about the &lt;a href="http://subversion.tigris.org/svn_1.4_releasenotes.html"&gt;feature additions for Subversion 1.4&lt;/a&gt;, I decided it would be much easier for me to upgrade the server and my dev laptop to 1.4. Gentoo masks 1.4.4, but most Subversion upgrades are fairly transparent. There are two main benefits from the upgrade I wanted. Subversion 1.4 claims to be better at storing and transmitting binary data. We version a lot of raw data, so this would work out well. Subversion 1.4 also has a &lt;tt&gt;svnsync&lt;/tt&gt; command that works like SVK's svn mirroring. It lets you move or clone a repository. Maybe Linus Torvald's &lt;a href="http://codicesoftware.blogspot.com/2007/05/linus-torvalds-on-git-and-scm.html"&gt;acerbic comments about Subversion&lt;/a&gt; has been getting noticed.&lt;/p&gt;



&lt;p&gt;Upgrading to Subversion 1.4 on Gentoo is a piece of cake. You add:&lt;/p&gt;

&lt;blockquote&gt; &lt;tt&gt;echo "=dev-util/subversion-1.4.4-r3" &gt;&gt; /etc/portage/package.keywords&lt;/tt&gt;
&lt;/blockquote&gt;

&lt;p&gt;and then &lt;/p&gt;

&lt;blockquote&gt; &lt;tt&gt;emerge =dev-util/subversion-1.4.4-r3&lt;/tt&gt;&lt;/blockquote&gt;

&lt;p&gt;You can run &lt;tt&gt;revdep-rebuild&lt;/tt&gt; to make sure all the library references are working, but I found that this was not necessary, even with the SVK installed. (With the &lt;tt&gt;perl&lt;/tt&gt; use-flag set on Subversion, all the Perl bindings gets automatically updated on the system.)&lt;/p&gt;

&lt;p&gt;To take advantage of the more-efficient binary storage, all the repositories needed to be upgraded. I shut down Apache to prevent anyone from making commits, backed up my repository, and moved the repository to a different directory while I setup the new repository directories. I then wrote two quick-and-dirty shell scripts to do this:&lt;/p&gt;

&lt;blockquote&gt;&lt;tt&gt;#!/bin/sh&lt;br/&gt;
&lt;br/&gt;
mkdir tmp_dumps&lt;br/&gt;
for repo in `ls repos-1.3.x`; do&lt;br/&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;svnadmin dump repos-1.3.x/${repo} &gt; tmp_dumps/${i}&lt;br/&gt;
done&lt;br/&gt;&lt;/tt&gt;&lt;/blockquote&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;blockquote&gt;&lt;tt&gt;
#!/bin/sh&lt;br/&gt; 
&lt;br/&gt;
for repo in `ls tmp_dumps`; do&lt;br/&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;svnadmin create --fs-type fsfs repos/${repo}&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;svnadmin load repos/${repo} &lt; tmp_dumps/${repo}&lt;br/&gt;
done&lt;br/&gt;
&lt;/tt&gt;&lt;/blockquote&gt;

&lt;p&gt;Note the &lt;tt&gt;--fs-type fsfs&lt;/tt&gt; flag. You will have to change that if you are using the BerkeleyDB storage engine. These two scripts essentially creates a dump of all the repositories found in &lt;tt&gt;repos&lt;/tt&gt; directory, then reloads them. During the reload, Subversion 1.4's &lt;tt&gt;svnadmin create&lt;/tt&gt; command creates a new repository. The newly reloaded repository uses the more efficient binary storage scheme.&lt;/p&gt;

&lt;p&gt;Lastly, I upgraded all of my local working copies. Subversion does this transparently, but I have a number of large repositories I use often. A simple &lt;tt&gt;svn update&lt;/tt&gt; on each of the working copies upgrades the working copy to 1.4. Some of them take ten minutes to upgrade -- I do this now so I don't have to wait, later on.&lt;/p&gt;

&lt;p&gt;Ho-Sheng Hsiao&lt;br/&gt;
Isshen, LLC&lt;/p&gt;</description>
      <pubDate>Sat, 25 Aug 2007 20:23:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6ea27de3-32c5-4587-9d3b-71f65c690f0c</guid>
      <author>Hosh</author>
      <link>http://blog.isshen.com/articles/2007/08/25/subversion-1-4-4-upgrade</link>
      <category>Subversion/SVK</category>
      <category>svn</category>
      <category>svk</category>
      <category>gentoo</category>
      <category>tools</category>
    </item>
    <item>
      <title>How to do http + ssh with Subversion on Windows</title>
      <description>Many public hotspots block svn traffic, even those accessed via http. This predicament can lead many (like me) that must develop in a Windows-based environment in an unfortunate place while on the road. &lt;br /&gt;

Accessing subversion shares, need not be a headache, there is a simple solution.&lt;br /&gt;
&lt;br /&gt;
First you should install &lt;a href="tortoisesvn.tigris.org/"&gt; TortoiseSVN &lt;/a&gt; and verify it is working.&lt;br /&gt;
&lt;br /&gt;
Then right click on the desktop (or an explorer window) highlight &#8220;TortoiseSVN&#8221; then click Settings. &lt;br /&gt;
&lt;br /&gt;
Click the &#8220;Network&#8221; tab&lt;br /&gt;
&lt;br /&gt;
Check the &#8220;Enable Proxy Server&#8221; box, and in the &#8220;Server Address:&#8221; field place &#8220;localhost&#8221; and in the &#8220;Port&#8221; field place an unused port greater than 1024 (remember this number!). Click &#8220;Apply&#8221; then &#8220;OK&#8221;&lt;br /&gt;
&lt;br /&gt;
I recommend &lt;a href="http://www.xs4all.nl/~whaa/putty/"&gt;Putty Tray&lt;/a&gt; and their suite, including their improved version of Pagaent, for reasons that will soon become obvious for the next section.&lt;br /&gt;
&lt;br /&gt;
Open Pageant, then open your keyfile in it.&lt;br /&gt;
&lt;br /&gt;
Continuing on, open up Putty, fill in your server address (make sure SSH is filled in). Then go to Connection -&gt; SSH -&gt; Tunnels. Under &#8220;Source Port&#8221; place the same number you filled in earlier, and in destination, place the address of your server and port 80, ie: my.server.net:80, Click Add. Go back too the session tab, save and name your connection (don&#8217;t want too do this every time).&lt;br /&gt;
&lt;br /&gt;
Click Open.&lt;br /&gt;
&lt;br /&gt;
You should then be able too use TortoiseSVN normally, though remember you will &lt;strong&gt;always&lt;/strong&gt; need the SSH connection running too use it, it will not work otherwise (unless you clear the proxy in the settings).
&lt;br /&gt;&lt;br /&gt;
This is why &lt;a href="http://www.xs4all.nl/~whaa/putty/"&gt;Putty Tray&lt;/a&gt; is so great, you can minimize it too the system tray, and have one less window cluttering your developing environment, until you absolutely need too do something on that command line.&lt;br /&gt;
&lt;br /&gt;
As a &#8216;best practice&#8217; rule, I have learned too set the background colour on my tunnel window to something other (and obviously not) black, and not use it for much of anything besides tunnels.&lt;br /&gt;
&lt;br /&gt;
Good Luck!

&lt;h2&gt;References:&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://blog.isshen.com/articles/2006/12/16/how-to-do-http-ssh-with-subversion"&gt;How to do HTTP+SSH with Subversion on Linux&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</description>
      <pubDate>Fri, 27 Jul 2007 20:31:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:84168559-3886-4227-8f75-8248c2446d11</guid>
      <author>Adam</author>
      <link>http://blog.isshen.com/articles/2007/07/27/svn-http-via-ssh-from-xp</link>
      <category>Subversion/SVK</category>
      <category>Windows</category>
      <category>tools</category>
      <category>svn</category>
      <category>TortoiseSVN</category>
      <category>putty</category>
    </item>
    <item>
      <title>Branching and Merging with SVK</title>
      <description>&lt;p&gt;Originally posted on a private mailing list.&lt;/p&gt;

&lt;p&gt;Talking with a guy on #ledgersmb, I asked him about how well SVK and SVN worked together. I had &lt;a href="http://blog.isshen.com/articles/2007/01/20/disconnected-versioning-with-svk"&gt;previously used SVK for disconnected commits&lt;/a&gt;, but had not had the nerve to set up an SVK server.&lt;/p&gt;

&lt;p&gt;It turns out, you don't need to set up a SVK server, &lt;em&gt;per se&lt;/em&gt;, to take advantage of SVK's branching and merging.&lt;/p&gt;

&lt;p&gt;To play with it, I set up a directory with a single file:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;test/test.txt&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And branched it with&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;svk cp test test-branch&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If I modified test-branch/test.txt I can use svk push inside
test-branch, and it will automerge back to test/test.txt&lt;/p&gt;

&lt;p&gt;If I modified test/test.txt I can use svk pull inside test-branch and it will automerge modifications from test/&lt;/p&gt;

&lt;p&gt;I had an svn client working with, and it was able to update the changes cleanly. I can use svn to do commits against each branches, and SVK handles that no problem. As far as the svn client is working, someone did branching/merging, no problem. This is made possible because SVK stores the merging information inside SVN's revision properties. That's why I don't need a special SVK server, just using SVK as a beefed up SVN client.&lt;/p&gt;

&lt;p&gt;Now the next tricky thing was using svn cp test-branch test-svn-branch and playing with that. SVK still enters in merge tickets, but getting changes was no longer a simple svk update. I had to use svk pull at the parent directory to get it to update. For what I want to use this for, I will just have to remember to create branches using svk cp rather than svn cp.&lt;/p&gt;

&lt;p&gt;Why bother with all of this stuff? The short time I worked for BankOne, I learned a neat method for releasing software. Changes flows from:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;development -&gt; testing -&gt; qa -&gt; production&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When I first setup Subversion, I had attempted to do something like that. Commit changes to trunk, and have changes pushed upstream for testing (I skipped Q/A as that was done during testing), then to production. The problem is that Subversion's merging sucked. It sucked because it does not track merging changes.&lt;/p&gt;

&lt;p&gt;Having played with this, I can now do something like:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;(developer-1, developer-2, developer-3) -&gt; trunk -&gt; testing -&gt; production&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pushing to testing and production would be a simple svk pull&lt;/p&gt;

&lt;p&gt;Each developer has their own branches to isolate any potentially
destructive changes. The developers do not necessarily need SVK (unless they are doing disconnected commits, such as if they are roaming around with a laptop like I do). This is a good thing, since TortoiseSVN is a known factor, and Windows may or may not play with SVK (written in Perl) very well.&lt;/p&gt;

&lt;p&gt;The supervisor or PM would have commit priveledges to trunk, probably by using a different set of passwords, so he would do an svk push inside a developer branch once he makes sure it won't destroy anything. Lastly, all the changes, mistakes, whatever can get versioned, a habit I have similar to hitting "save" all the time. Nightly or continous builds would come off of trunk/testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;: SVK transparently makes merging as trivial as SVN branching without having to change anything server-side.&lt;/p&gt;</description>
      <pubDate>Thu, 05 Jul 2007 04:15:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:8a4b1a2e-d3fe-4730-8ff3-fbbd4d1a85ea</guid>
      <author>Hosh</author>
      <link>http://blog.isshen.com/articles/2007/07/05/branching-and-merging-with-svk</link>
      <category>Subversion/SVK</category>
      <category>svk</category>
    </item>
    <item>
      <title>Disconnected versioning with SVK</title>
      <description>&lt;p&gt;Originally published on a private mailing list.&lt;/p&gt;

&lt;p&gt;We were talking about subversion and commits a couple days ago. Adam and I prefer doing fine-grained commits to the trunk, whether the commits work or not; UG and Travis prefer committing changes when the code builds / works. I briefly mentioned a tool called "svk", but had not really investigated this until now.&lt;/p&gt;

&lt;p&gt;Very soon, I will need to be able to do development in an environment where I might not have internet -- 4 to 8 hours at a time. That's when I took a good look at SVK, and it is awesome.&lt;/p&gt;

&lt;p&gt;My first concern with SVK is how much of a migration is needed from Subversion. For what I need it for, the answer is: nothing. SVK lives mostly as Perl libraries, and operates on the client (local) side. I would be able to use SVK for doing local development, and Adam can continue doing updates using the same Subversion tools he had been using. His software (TortoiseSVN) wouldn't even know I was using SVK instead of Subversion.&lt;/p&gt;

&lt;p&gt;The concept works &lt;a href="http://www.bieberlabs.com/wordpress/archives/2005/03/19/explaining-the-svk-workflow"&gt;like this&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;svk depot --init
    svk mirror http://svn.mydomain.com/tools/trunk //tools/trunk
    svk sync //tools/trunk&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That creates the mirror of the Subversion repository. The depot --init command initializes a repository defaulting to my home directory on my laptop. No messing with server or system configurations.&lt;/p&gt;

&lt;p&gt;I branch my local copy&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;svk cp -p -m "Branching for local copy." //tools/trunk/calendar //devel/calendar&lt;/p&gt;
    
    &lt;p&gt;svk co //devel/calendar ~/work/calendar&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that's it. No .svn/ directories in my work area.&lt;/p&gt;

&lt;p&gt;I'm the only developer, but if/when we get others working, there will need to be updates from the trunk to the branch. That's done by:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;svk sync //tools/trunk
    svk smerge -C //tools/trunk //devel/calendar 
    svk smerge -l //tools/trunk //devel/calendar
    svk update ~/work/calendar&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Merging changes back is:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;svk sync //tools/trunk
    svk smerge -l //devel/calendar //tools/trunk&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since changes are made into the mirror, SVK will automagically committhose changes back to the Subversion server. smerge is the Star Merging algorithim introduced in by GNU arch. It will keep track of what you merged from branch to branch. Since Subversion doesn't keep track of this, doing something like this in Subversion requires a lot of digging and manually specifying revision ranges. Not fun.&lt;/p&gt;

&lt;p&gt;There are some downsides to SVK. The main one is that it is written as a series of Perl libraries, and may require CPAN dependencies. I have no idea how well it would run on a Windows desktop.&lt;/p&gt;

&lt;p&gt;The second is that I can't use the handy-dandy script/generate
controller mycontroller --svn&lt;/p&gt;

&lt;p&gt;... the way around it though takes advantage of how SVK stores local branches. Since mine's is at ~/.svk/local , I can do:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;svn co file:///home/hhh/.svk/local/devel/calendar&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and use my regular svn commands.&lt;/p&gt;

&lt;p&gt;For further documentation on SVK, check out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;http://www.bieberlabs.com/wordpress/svk-tutorials/&lt;/li&gt;
&lt;li&gt;http://svk.bestpractical.com/view/InstallingSVK&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Sat, 20 Jan 2007 06:11:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:47bcc95c-3c46-465b-bd01-e006d1e5e195</guid>
      <author>Hosh</author>
      <link>http://blog.isshen.com/articles/2007/01/20/disconnected-versioning-with-svk</link>
      <category>Subversion/SVK</category>
      <category>svk</category>
    </item>
    <item>
      <title>How to do http + ssh with Subversion on Linux</title>
      <description>&lt;p&gt;Originally posted on a private mailing list.&lt;/p&gt;

&lt;p&gt;One of the consequences of having a mobile development station is being able to go to places such as &lt;a href="http://www.panera.com"&gt;Panera's&lt;/a&gt; or the local coffee shop to do development work. These days, it is trivially easy for people to get something similar to Kismet and do packet sniffing ... so I tend to proxy my internet connection through ssh. Fortunately, most of the GUI programs does this -- Firefox, Thunderbird, Gaim, Xchat2.&lt;/p&gt;

&lt;p&gt;Unfortunately, Subversion doesn't.&lt;/p&gt;

&lt;p&gt;We have it set up so that Subversion runs through Apache in order to take advantage of authenticating (but not authorizing) against a MySQL database. In this way, svn+ssh is not an option. However, the svn command line does not understand SOCKS4 or SOCKS5. This is where a transparent socks proxy comes in. I'm using something called &lt;a href="http://proxychains.sourceforge.net/"&gt;proxychains&lt;/a&gt;, though &lt;a href="http://tsocks.sourceforge.net/"&gt;tsocks&lt;/a&gt; is also available on the internet. You set it up by writing into ~/.proxychains/proxychains.conf with:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;DynamicChain&lt;br/&gt;
    tcp_read_time_out 15000&lt;br/&gt;
    tcp_connect_time_out 10000&lt;br/&gt;&lt;/p&gt;
    
    &lt;p&gt;[ProxyList]&lt;br/&gt;
    socks5 127.0.0.1 1080&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and then you have two methods for accessing it. For svn commands, you can do:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;proxychain svn ls http://svn.mydomain.com/project/trunk/&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;but I prefer just setting the environment variable,&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;export LD_PRELOAD=/usr/lib/libproxychains.so&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Update 2007-07-22&lt;/strong&gt;: I now put in my .bashrc file alias svn="proxychains svn" and alias svk="proxychains svk"&lt;/p&gt;

&lt;p&gt;The library intercepts TCP connect calls and reroutes them through a socks proxy. Transparent, effect, ... and kinda scary, considering how easy it is to replace DLL calls like that. In any case, although I did this mainly because I have a laptop and &lt;a href="http://www.panera.com"&gt;Panera's&lt;/a&gt; uses an http proxy, I
think I'll need to do this for my workstation as well. Then require a proxy to access the Subversion server.&lt;/p&gt;

&lt;h2&gt;References:&lt;/h2&gt;

&lt;p&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blog.isshen.com/articles/2007/07/27/svn-http-via-ssh-from-xp"&gt;How to do HTTP+SSH with Subversion on Windows&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 16 Dec 2006 08:30:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:d4ea5845-496b-49c9-a350-132c6e33dbf1</guid>
      <author>Hosh</author>
      <link>http://blog.isshen.com/articles/2006/12/16/how-to-do-http-ssh-with-subversion</link>
      <category>Subversion/SVK</category>
      <category>svk</category>
      <category>svn</category>
      <category>proxychains</category>
      <category>socks5</category>
      <category>linux</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
