mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
switchtower: use the :checkout variable to determine what operation to use for svn checkouts (instead of co, like "export"). Also fix a broken test.
git-svn-id: http://svn.rubyonrails.org/rails/tools/switchtower@3338 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
db28e14219
commit
57a3a14f59
4 changed files with 14 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Use the :checkout variable to determine what operation to use for svn checkouts (instead of co, like "export").
|
||||
|
||||
* The Rails rake tasks now load ST directly, instead of invoking it via system
|
||||
|
||||
* Added ssh_options variable to configure the SSH connection parameters #2734 [jerrett@bravenet.com]
|
||||
|
|
|
@ -67,9 +67,10 @@ module SwitchTower
|
|||
# the requested password is the same as the password for logging into the
|
||||
# remote server.)
|
||||
def checkout(actor)
|
||||
svn = configuration[:svn] ? configuration[:svn] : "svn"
|
||||
svn = configuration[:svn] || "svn"
|
||||
op = configuration[:checkout] || "co"
|
||||
|
||||
command = "#{svn} co -q -r#{configuration.revision} #{configuration.repository} #{actor.release_path};"
|
||||
command = "#{svn} #{op} -q -r#{configuration.revision} #{configuration.repository} #{actor.release_path};"
|
||||
|
||||
run_checkout(actor, command) do |ch, stream, out|
|
||||
prefix = "#{stream} :: #{ch[:host]}"
|
||||
|
|
|
@ -86,6 +86,14 @@ MSG
|
|||
assert_match %r{/path/to/svn}, @actor.command
|
||||
end
|
||||
|
||||
def test_checkout_via_export
|
||||
@actor.story = []
|
||||
@config[:checkout] = "export"
|
||||
assert_nothing_raised { @scm.checkout(@actor) }
|
||||
assert_nil @actor.channels.last.sent_data
|
||||
assert_match %r{/path/to/svn export}, @actor.command
|
||||
end
|
||||
|
||||
def test_checkout_needs_ssh_password
|
||||
@actor.story = [[:out, "Password: "]]
|
||||
assert_nothing_raised { @scm.checkout(@actor) }
|
||||
|
|
|
@ -25,6 +25,7 @@ class MockConfiguration < Hash
|
|||
def initialize(*args)
|
||||
super
|
||||
self[:release_path] = "/path/to/releases/version"
|
||||
self[:ssh_options] = {}
|
||||
end
|
||||
|
||||
def logger
|
||||
|
|
Loading…
Add table
Reference in a new issue