<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   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/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Code Kills - Work</title>
    <link>http://blog.codekills.net/</link>
    <description></description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:david@wolever.net" />
    <generator>Serendipity 1.1.3 - http://www.s9y.org/</generator>
    <pubDate>Tue, 06 May 2008 21:43:06 GMT</pubDate>

    <image>
        <url>http://blog.codekills.net/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Code Kills - Work - </title>
        <link>http://blog.codekills.net/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>SVK + Unicode == :(</title>
    <link>http://blog.codekills.net/archives/39-SVK-+-Unicode.html</link>
            <category>Fixed-it</category>
            <category>Work</category>
    
    <comments>http://blog.codekills.net/archives/39-SVK-+-Unicode.html#comments</comments>
    <wfw:comment>http://blog.codekills.net/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.codekills.net/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>david@wolever.net (David Wolever)</author>
    <content:encoded>
    &lt;p&gt;I was not impressed when I tried to check out a UTF-8 encoded file with SVK, then got the helpful message &lt;code&gt;Can&#039;t encode path as ascii&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ svk up
Syncing //drp/trunk(/drp/trunk) in /home/wolever/Trunk to 5388.
Can&#039;t encode path as ascii.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I was even less impressed when I searched Google for &lt;a href=&quot;http://google.ca/search?q=svk+unicode&quot;&gt;svk unicode&lt;/a&gt; and this blog was the first hit.&lt;/p&gt;

&lt;p&gt;Fortunately my Google-foo is high today, and I was able to find &lt;a href=&quot;http://wiki.opengarden.org/User:PeteE/Synchronizing_SVN_Repositories_With_Svk#section_7&quot;&gt;a page&lt;/a&gt; that gives a solution:  Making sure that your locale is set to something similar to &lt;code&gt;en_US.UTF-8&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On Debian, here&#039;s how I do it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo apt-get install locales # Ubuntu 6.06 didn&#039;t have it...
...
$ export LANG=&quot;en_US.UTF-8&quot;
$ export LANGUAGE=&quot;$LANG&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And, of course, it may be good to put those two &lt;code&gt;export&lt;/code&gt;s in &lt;code&gt;~/.bashrc&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Oh, but wait!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ svk up
Syncing //drp/trunk(/drp/trunk) in /home/wolever/Trunk to 5388.
Can&#039;t encode path as ascii.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It still doesn&#039;t work!&lt;/p&gt;

&lt;p&gt;It turns out that, for what ever reason, something was upset.  Eventually I got it working by deleting the offending directory, then using &lt;code&gt;svk revert&lt;/code&gt; to revert it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ rm -r hacking/
$ svk revert -R hacking
...
Reverted hacking/utf8_爱的
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Hurra!&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Tue, 06 May 2008 17:43:06 -0400</pubDate>
    <guid isPermaLink="false">http://blog.codekills.net/archives/39-guid.html</guid>
    
</item>
<item>
    <title>Another reason I like SVK</title>
    <link>http://blog.codekills.net/archives/37-Another-reason-I-like-SVK.html</link>
            <category>DrProject</category>
            <category>Work</category>
    
    <comments>http://blog.codekills.net/archives/37-Another-reason-I-like-SVK.html#comments</comments>
    <wfw:comment>http://blog.codekills.net/wfwcomment.php?cid=37</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.codekills.net/rss.php?version=2.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    

    <author>david@wolever.net (David Wolever)</author>
    <content:encoded>
    &lt;p&gt;I got a fairly significant patch to DrProject today.  I wanted to show it to the other developers so they could give it a look over.  How&#039;d I do it?&lt;/p&gt;

&lt;p&gt;&lt;html&gt;&lt;/p&gt;

&lt;pre&gt;
    $ patch -p0 &lt; patch
    ... check that it works ...
    &lt;font color=&quot;green&quot;&gt;# Create a new branch for the patch&lt;/font&gt;
    $ svk cp //drp/trunk //drp/branches/patch -m &quot;Created branch for patch&quot;
    &lt;font color=&quot;green&quot;&gt;# Do an in-place switch of my repository (which takes about 2 seconds,
    # versus the minute or two it would take to check the entire tree out)&lt;/font&gt;
    $ svk switch //drp/branches/patch 
    &lt;font color=&quot;green&quot;&gt;# Because switch doesn&#039;t revert modified files, the changes are still here,
    # ready to be checked in&lt;/font&gt;
    $ svk ci -m &quot;Checking in patched code&quot;
&lt;/pre&gt;

&lt;p&gt;&lt;/html&gt;&lt;/p&gt;

&lt;p&gt;Now they can use &lt;a href=&quot;http://www.drproject.org/&quot;&gt;DrProject&#039;s&lt;/a&gt; fancy online changeset viewer, checkout the code for themselves, use &lt;code&gt;svn diff&lt;/code&gt;... The list is endless.&lt;/p&gt;

&lt;p&gt;Now that rocks SO much more than mailing around &lt;code&gt;.diff&lt;/code&gt; files (and makes life happier when it comes time to pull it back into trunk).&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Wed, 16 Apr 2008 14:47:35 -0400</pubDate>
    <guid isPermaLink="false">http://blog.codekills.net/archives/37-guid.html</guid>
    
</item>
<item>
    <title>How SVK has made my life happy</title>
    <link>http://blog.codekills.net/archives/35-How-SVK-has-made-my-life-happy.html</link>
            <category>Work</category>
    
    <comments>http://blog.codekills.net/archives/35-How-SVK-has-made-my-life-happy.html#comments</comments>
    <wfw:comment>http://blog.codekills.net/wfwcomment.php?cid=35</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://blog.codekills.net/rss.php?version=2.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    

    <author>david@wolever.net (David Wolever)</author>
    <content:encoded>
    &lt;p&gt;SVK, despite some of it&#039;s shortcomings, has proved worthy of my use in the last couple of days.  Here is a quick script which shows how I&#039;ve been using it, and how it&#039;s rocked the pants off of SVN:&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;red&quot;&gt;red = commands with SVN&lt;/font&gt;&lt;br /&gt;
&lt;font color=&quot;blue&quot;&gt;blue = equivalent SVK commands&lt;/font&gt;&lt;br /&gt;
&lt;font color=&quot;green&quot;&gt;green = comment&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;

&lt;pre&gt;
&lt;font color=&quot;green&quot;&gt;# Mirror the DrP repository to //dpr&lt;/font&gt;
&lt;font color=&quot;red&quot;&gt;$ # No equivilent&lt;/font&gt;
&lt;font color=&quot;blue&quot;&gt;$ svk mirror https://drproject.org/drproject/DrProject/ //drp/&lt;/font&gt;

&lt;font color=&quot;green&quot;&gt;# Create the tags branch&lt;/font&gt;
&lt;font color=&quot;red&quot;&gt;$ svn cp https://drproject.org/drproject/DrProject/tunk \
         https://drproject.org/drproject/DrProject/branches/tags&lt;/font&gt;
&lt;font color=&quot;blue&quot;&gt;$ svk cp //drp/trunk //drp/branches/tags&lt;/font&gt;

&lt;font color=&quot;green&quot;&gt;# Check out the branch&lt;/font&gt;
&lt;font color=&quot;red&quot;&gt;$ svn co https://drproject.org/drproject/DrProject/branches/tags Tags&lt;/font&gt;
&lt;font color=&quot;blue&quot;&gt;$ svk co //drp/branches/tags Tags&lt;/font&gt;

&lt;font color=&quot;green&quot;&gt;# Some changes are made to the tags branch&lt;/font&gt;

&lt;font color=&quot;green&quot;&gt;# Checkin those changes&lt;/font&gt;
&lt;font color=&quot;red&quot;&gt;$ svn ci -m &quot;Made some changes to tags branch&quot;&lt;/font&gt;
&lt;font color=&quot;blue&quot;&gt;$ svk ci -m &quot;Made some changes to tags branch&quot;&lt;/font&gt;
&lt;font color=&quot;green&quot;&gt;# In this case, SVK is not being used in decentralized
# mode, so the changes will be pushed upstream to the
# SVN repository, just like the svn commit does.&lt;/font&gt;

&lt;font color=&quot;green&quot;&gt;# Changes have also been made to trunk.
# Time to merge those changes in.

# First, a merge with SVN:&lt;/font&gt;
&lt;font color=&quot;red&quot;&gt;$ svn log --stop-on-copy&lt;/font&gt;
&lt;font color=&quot;green&quot;&gt;# Look for either the last revision which trunk was merged
# You can&#039;t always use the base revision, otherwise conflicts
# may ensue.&lt;/font&gt;
&lt;font color=&quot;red&quot;&gt;$ svn merge -r $REV:HEAD https://drproject.org/drproject/DrProject/tunk .&lt;/font&gt;
&lt;font color=&quot;green&quot;&gt;# Hope that there are no trivial conflicts to sort out,
# then test and commit the merge. &lt;/font&gt;
&lt;font color=&quot;red&quot;&gt;$ svn ci -m &quot;Merged trunk into tags.&quot;&lt;/font&gt;

&lt;font color=&quot;green&quot;&gt;# And now, exactly the same operation with SVK:&lt;/font&gt;
&lt;font color=&quot;blue&quot;&gt;$ svk pull&lt;/font&gt;
&lt;font color=&quot;green&quot;&gt;# ... changes are merged ...&lt;/font&gt;
&lt;font color=&quot;blue&quot;&gt;$ &lt;/font&gt;
&lt;/pre&gt;

&lt;p&gt;I don&#039;t think I need to say any more &lt;img src=&quot;http://blog.codekills.net/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;(Yes, I realize that there are tools like &lt;a href=&quot;http://www.orcaware.com/svn/wiki/Svnmerge.py&quot;&gt;svnmerge.py&lt;/a&gt; which make SVN merges less painful... But that&#039;s one extra command to run.  And you&#039;ve still got those stinking &lt;tt&gt;.svn&lt;/tt&gt; directories everywhere.)&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://blog.codekills.net/archives/35-How-SVK-has-made-my-life-happy.html#extended&quot;&gt;Continue reading &quot;How SVK has made my life happy&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 04 Apr 2008 15:40:06 -0400</pubDate>
    <guid isPermaLink="false">http://blog.codekills.net/archives/35-guid.html</guid>
    
</item>
<item>
    <title>Reverting Changes in SVN (or: it's not as easy as svn up -r)</title>
    <link>http://blog.codekills.net/archives/33-Reverting-Changes-in-SVN-or-its-not-as-easy-as-svn-up-r.html</link>
            <category>DrProject</category>
            <category>Python</category>
            <category>Work</category>
    
    <comments>http://blog.codekills.net/archives/33-Reverting-Changes-in-SVN-or-its-not-as-easy-as-svn-up-r.html#comments</comments>
    <wfw:comment>http://blog.codekills.net/wfwcomment.php?cid=33</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.codekills.net/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    

    <author>david@wolever.net (David Wolever)</author>
    <content:encoded>
    &lt;p&gt;If there is one thing that I&#039;ve found universally confusing about version control systems, it&#039;s how to revert back to a previous revision, then move on from there.  Conventional wisdom would dictate that &lt;code&gt;svn up -r $OLD&lt;/code&gt; with some additional flag that says &lt;code&gt;pretend that we&#039;re still at HEAD&lt;/code&gt; would do the trick... But, alas, there exists no such flag.&lt;/p&gt;

&lt;p&gt;So, besides &lt;code&gt;svn cat -r $OLD $FILE &amp;gt; $FILE&lt;/code&gt;, what&#039;s the best way to revert a file (or entire tree) to an older revision?  Well, it turns out that &lt;strong&gt;merge&lt;/strong&gt; is the tool you&#039;re looking for.&lt;/p&gt;

&lt;p&gt;The trick is that you can &lt;code&gt;diff&lt;/code&gt; backwards as well as forwards:&lt;/p&gt;

&lt;pre&gt;
[wolever@thebes] ~/test_dr/All svn diff -r &lt;strong&gt;2:1&lt;/strong&gt;
Index: stuff
===================================================================
--- stuff       (revision 2)
+++ stuff       (revision 1)
@@ -1,4 +1,3 @@
 Let us endeavor so to live that when we come to die even the undertaker will be
 sorry.
                -- Mark Twain, &quot;Pudd&#039;nhead Wilson&#039;s Calendar&quot;
-Increased knowledge will help you now.  Have mate&#039;s phone bugged.
Index: docs.html
&lt;/pre&gt;

&lt;p&gt;Which means that &lt;strong&gt;merge&lt;/strong&gt; will work both ways as well:&lt;/p&gt;

&lt;pre&gt;
[wolever@thebes] ~/test_dr/All svn &lt;strong&gt;merge -r 2:1&lt;/strong&gt; stuff
U    stuff
[wolever@thebes] ~/test_dr/All svn ci -m &quot;reverted changes&quot; stuff
[wolever@thebes] ~/test_dr/All svn diff -r 1:3 stuff
[wolever@thebes] ~/test_dr/All

&lt;/pre&gt;

&lt;p&gt;Of course, this will also work with the myriad of other version control tools out there.  In fact, if you&#039;re still using SVN, reverting old changes is probably the least of your problems... At least compared to, say, merging different branches ^_^&lt;/p&gt;

&lt;p&gt;But that&#039;s a post for another day -- I need to stop writing about merging and actually get on with, err, &lt;a href=&quot;https://www.drproject.org/DrProject/ticket/1236&quot;&gt;doing it&lt;/a&gt;...&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Fri, 08 Feb 2008 11:57:24 -0500</pubDate>
    <guid isPermaLink="false">http://blog.codekills.net/archives/33-guid.html</guid>
    
</item>

</channel>
</rss>