Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Applying patch for this bug from Lighthouse

  • Loading branch information...
commit dc9c8fa41975f50cf09775397a03cdeed5821fad 1 parent 25d1c23
@leehambley leehambley authored
View
2  lib/capistrano/recipes/deploy/scm/subversion.rb
@@ -56,7 +56,7 @@ def query_revision(revision)
result = yield(command)
yaml = YAML.load(result)
raise "tried to run `#{command}' and got unexpected result #{result.inspect}" unless Hash === yaml
- yaml['Last Changed Rev'] || yaml['Revision']
+ [ (yaml['Last Changed Rev'] || 0).to_i, (yaml['Revision'] || 0).to_i ].max
end
# Increments the given revision number and returns it.
View
32 test/deploy/scm/subversion_test.rb
@@ -0,0 +1,32 @@
+require "utils"
+require 'capistrano/recipes/deploy/scm/subversion'
+
+class DeploySCMSubversionTest < Test::Unit::TestCase
+ class TestSCM < Capistrano::Deploy::SCM::Subversion
+ default_command "svn"
+ end
+
+ def setup
+ @config = { :repository => "." }
+ def @config.exists?(name); key?(name); end
+
+ @source = TestSCM.new(@config)
+ end
+
+ def test_query_revision
+ revision = @source.query_revision('HEAD') do |o|
+ assert_equal "svn info . -rHEAD", o
+ %Q{Path: rails_2_3
+URL: svn+ssh://example.com/var/repos/project/branches/rails_2_3
+Repository Root: svn+ssh://example.com/var/repos
+Repository UUID: 2d86388d-c40f-0410-ad6a-a69da6a65d20
+Revision: 2095
+Node Kind: directory
+Last Changed Author: sw
+Last Changed Rev: 2064
+Last Changed Date: 2009-03-11 11:04:25 -0700 (Wed, 11 Mar 2009)
+}
+ end
+ assert_equal 2095, revision
+ end
+end

3 comments on commit dc9c8fa

@gsecillano

What was the bug about? If an application is deployed from a branch, shouldn't the revision be the latest from the same branch?

@leehambley
Owner

You're really commenting on an issue that's more than 5 years old, now, that this piece of software has been rendered obsolete by the new replacement version?

@gsecillano
Please sign in to comment.
Something went wrong with that request. Please try again.