You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2009/03/13 00:38:38 UTC

svn commit: r753058 - in /buildr/trunk: CHANGELOG lib/buildr/core/build.rb spec/core/build_spec.rb

Author: assaf
Date: Thu Mar 12 23:38:38 2009
New Revision: 753058

URL: http://svn.apache.org/viewvc?rev=753058&view=rev
Log:
Fixed:  BUILDR-226 Release task should use XML output of "svn info" instead of human-readable output (Alexis Midon).

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/core/build.rb
    buildr/trunk/spec/core/build_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=753058&r1=753057&r2=753058&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Thu Mar 12 23:38:38 2009
@@ -42,6 +42,8 @@
 * Fixed:  BUILDR-201 Sample project is not valid (Alexis Midon).
 * Fixed:  BUILDR-214 Buildr is stuck uploading to sftp repository (Heikki Hulkko).
 * Fixed:  BUILDR-216 Profiles documentation is wrong (Shane Witbeck).
+* Fixed:  BUILDR-226 Release task should use XML output of "svn info" instead
+of human-readable output (Alexis Midon).
 * Fixed:  BUILDR-235 JRuby download link is broke (Alexis Midon).
 * Fixed:  BUILDR-253 ZipTask now uses Zlib::DEFAULT_COMPRESSION instead of NO_COMPRESSION
 * Fixed:  BUILDR-261 ScalaSpecs should be run with Scala dependencies

Modified: buildr/trunk/lib/buildr/core/build.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/build.rb?rev=753058&r1=753057&r2=753058&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/build.rb (original)
+++ buildr/trunk/lib/buildr/core/build.rb Thu Mar 12 23:38:38 2009
@@ -210,7 +210,7 @@
 
     # Return the current SVN URL
     def repo_url
-      svn('info').scan(/URL: (.*)/)[0][0]
+      svn('info', '--xml')[/<url>(.*?)<\/url>/, 1].strip
     end
     
   protected

Modified: buildr/trunk/spec/core/build_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/build_spec.rb?rev=753058&r1=753057&r2=753058&view=diff
==============================================================================
--- buildr/trunk/spec/core/build_spec.rb (original)
+++ buildr/trunk/spec/core/build_spec.rb Thu Mar 12 23:38:38 2009
@@ -294,18 +294,30 @@
 
     describe '#repo_url' do
       it 'should extract the SVN URL from svn info' do
-        Svn.should_receive(:svn).and_return <<-EOF
-Path: .
-URL: http://my.repo.org/foo/trunk
-Repository Root: http://my.repo.org
-Repository UUID: 12345678-9abc-def0-1234-56789abcdef0
-Revision: 112
-Node Kind: directory
-Schedule: normal
-Last Changed Author: Lacton
-Last Changed Rev: 110
-Last Changed Date: 2008-08-19 12:00:00 +0200 (Tue, 19 Aug 2008)
-        EOF
+        Svn.should_receive(:svn).and_return <<-XML
+<?xml version="1.0"?>
+<info>
+<entry
+   kind="dir"
+   path="."
+   revision="724987">
+<url>http://my.repo.org/foo/trunk</url>
+<repository>
+<root>http://my.repo.org</root>
+<uuid>13f79535-47bb-0310-9956-ffa450edef68</uuid>
+</repository>
+<wc-info>
+<schedule>normal</schedule>
+<depth>infinity</depth>
+</wc-info>
+<commit
+   revision="724955">
+<author>boisvert</author>
+<date>2008-12-10T01:53:51.240936Z</date>
+</commit>
+</entry>
+</info>
+        XML
         Svn.repo_url.should == 'http://my.repo.org/foo/trunk'
       end
     end