<?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>The eflow blog &#187; subversion</title>
	<atom:link href="http://blog.eflow.org/archives/tag/subversion/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.eflow.org</link>
	<description>Insert some amazingly witty tagline here</description>
	<lastBuildDate>Fri, 23 Apr 2010 03:19:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Merge Problems with Inconsistent Newlines in SVN</title>
		<link>http://blog.eflow.org/archives/162</link>
		<comments>http://blog.eflow.org/archives/162#comments</comments>
		<pubDate>Thu, 18 Dec 2008 19:32:26 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[openmrs]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=162</guid>
		<description><![CDATA[When trying to merge from our trunk to a branch I was getting these errors:
    svn: File &#8216;/tmp/svnkitmerge42139.tmp/.diff.192.tmp&#8217; has inconsistent newlines
    svn: File &#8216;/tmp/svnkitmerge42139.tmp/.diff.192.tmp&#8217; has inconsistent newlines

and

svn: File &#8216;/tmp/tmp&#8217; has inconsistent newlines svn: Inconsistent line ending style
svn: Error reading spooled REPORT request response
    svn: Generic IO [...]]]></description>
			<content:encoded><![CDATA[<p>When trying to merge from our trunk to a branch I was getting these errors:</p>
<blockquote><p>    svn: File &#8216;/tmp/svnkitmerge42139.tmp/.diff.192.tmp&#8217; has inconsistent newlines<br />
    svn: File &#8216;/tmp/svnkitmerge42139.tmp/.diff.192.tmp&#8217; has inconsistent newlines
</p></blockquote>
<p>and</p>
<blockquote><p>
svn: File &#8216;/tmp/tmp&#8217; has inconsistent newlines svn: Inconsistent line ending style<br />
svn: Error reading spooled REPORT request response</p>
<p>    svn: Generic IO error<br />
    svn: Generic IO error
</p></blockquote>
<p><br/><br />
Here are the steps I did to get around this and still merge from trunk to the branch:</p>
<ol>
<li>Check out a fresh copy of the branch. </li>
<li> Merge the branch to the latest, skipping over the revision that did the newline changes (5893 in my case).  You might have to do two merges for this: previous merge point to 5892, then one from 5894 to HEAD.</li>
<li>Run the <a href="http://blog.eflow.org/archives/130">fix_newlines.sh</a> script.</li>
<li>Commit the branch.</li>
</ol>
<p>Note: If you have changes on another checked out copy, an &#8220;svn update&#8221; won&#8217;t work on that one.  You will have to apply a patch of the changes to the freshly checked out/merged copy.</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=162" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/162/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merging a Renamed Branch Back to Trunk</title>
		<link>http://blog.eflow.org/archives/164</link>
		<comments>http://blog.eflow.org/archives/164#comments</comments>
		<pubDate>Tue, 16 Dec 2008 22:42:33 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[openmrs]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=164</guid>
		<description><![CDATA[I had a lot of trouble recently merging a renamed branch back into trunk.  I ended up having to resort to the command line to get the exact parameter setup that I wanted.  Subclipse didn&#8217;t quite cut it, unfortunately.
To set the stage:

All changes on trunk have been merged to the branch (complex-obs) and [...]]]></description>
			<content:encoded><![CDATA[<p>I had a lot of trouble recently merging a renamed branch back into trunk.  I ended up having to resort to the command line to get the exact parameter setup that I wanted.  Subclipse didn&#8217;t quite cut it, unfortunately.</p>
<p>To set the stage:</p>
<ol>
<li>All changes on trunk have been merged to the branch (complex-obs) and committed</li>
<li>The checked out trunk copy is up-to-date</li>
</ol>
<p>I created a patch file comparing trunk to the branch:</p>
<blockquote><p>svn diff &#8211;old /home/ben/workspace/openmrs-trunk-clean &#8211;new http://svn.openmrs.org/openmrs/branches/complex-obs > /home/ben/openmrs/patches/complexobs.diff</p></blockquote>
<p>I then applied that patch file to my local trunk copy:</p>
<blockquote><p>patch -p0 < /home/ben/openmrs/patches/complexobs.diff</p></blockquote>
<p>This should only be used if you plan on closing the branch.  Subversion isn&#8217;t able to keep track of any ancestry this way, so future merges would be harder.</p>
<p>Note: Diff files don&#8217;t handle binary files.  You will need to move those yourself.  I suggest comparing the patched trunk with your branch to make sure everything is the same. (In eclipse, select the root of both projects, then right click&#8211;>compare with&#8211;>each other)</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=164" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/164/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing SVN Inconsistent Newlines</title>
		<link>http://blog.eflow.org/archives/130</link>
		<comments>http://blog.eflow.org/archives/130#comments</comments>
		<pubDate>Mon, 03 Nov 2008 15:21:30 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[openmrs]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=130</guid>
		<description><![CDATA[I&#8217;ve spoken previously about the travails of having a developer community that uses both Windows and Unix-based machines: merging files edited in both environments. Hopefully those days are over. (At least for the OpenMRS community)

Chase Yarbrough attempted to fix this by adding the svn:eol-style to all of the files in the OpenMRS repository recursively.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve <a href="http://blog.eflow.org/archives/45">spoken previously</a> about the travails of having a developer community that uses both Windows and Unix-based machines: merging files edited in both environments. Hopefully those days are over. (At least for the OpenMRS community)<br />
<span id="more-130"></span></p>
<p>Chase Yarbrough <a href="http://dev.openmrs.org/changeset/4095">attempted to fix</a> this by adding the svn:eol-style to all of the files in the OpenMRS repository recursively.  The problem is that all files that were already committed from both operating systems failed with:</p>
<blockquote><p>
svn: File &#8217;somefilename.ext&#8217; has inconsistent newlines<br />
svn: Inconsistent line ending style
</p></blockquote>
<p>However, merging continued to be a pain with those files that were skipped over.  </p>
<p><br/></p>
<h3>Solution</h3>
<p>I created a short script to recursively loop over all files in the root directory, run dos2unix, and then set the svn:eol-style to CRLF:</p>
<p><a href='http://blog.eflow.org/wp-content/uploads/2008/12/fix_newlines.sh'>Download this script</a></p>
<blockquote>
<pre>
#!/bin/sh

# This script normalizes the newlines in all files in
# a directory and adds the svn:eol-style property
# Author: Ben Wolfe - 10/2008
# http://blog.eflow.org

path=`pwd`

# get a flat list of all files under the current directory
f=`ls -RlQ | awk -v PATH=$path '{ \
if ($1 ~ /.*:$/) \
path = substr($1,3,length($1)-4); \
else \
if ($0 ~ /^-/) \
printf("%s%s/%s\n", PATH, path, \
substr($0, match($0,"\".*\"")+1, RLENGTH-2) \
) \
}'`

for i in $f
do
#ignore the build folder contents
if ! echo $i | grep build > /dev/null;
then
        #check subversion for this property
        x=`svn propget svn:eol-style $i`
        if [ ! -n "$x" ]
        then
                # get the file's extension
                ext=`echo "$i" | awk -F . '{print $NF}'`

                # This is an "if list contains" method for shell scripts
                # check if ext is one of the text based extensions
                case $ext in
                        java|jsp|css|js|xml|sql|txt|properties|tld|tag|html|htm|sh)
                                #echo No svn:eol-style prop: $i . Adding now.
                                dos2unix -a $i
                                svn propset svn:eol-style "CRLF" $i
                                ;;
                        *)
                                echo invalid extension: $ext
                                ;;
                esac
        fi
fi
done

echo "done"
</pre>
</blockquote>
<p>I committed all changes from running this script in <a href="http://dev.openmrs.org/changeset/5893">changeset 5893</a>.</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=130" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/130/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
