1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Use the auth info for subversion more consistently

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@6104 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2007-02-03 18:02:24 +00:00
parent 61240ed18b
commit c67f578202
2 changed files with 11 additions and 4 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Use the auth info for subversion more consistently [Jamis Buck]
* Add a "capture" helper, for capturing the stdout of a remote command and returning it as a string [Jamis Buck]
* Add a "get" helper, to pull a file from a remote server to the localhost [bmihelac]

View file

@ -50,7 +50,7 @@ module Capistrano
from ||= current_revision(actor)
to ||= "HEAD"
`svn diff #{configuration.repository}@#{from} #{configuration.repository}@#{to}`
`svn diff #{authorization} #{configuration.repository}@#{from} #{configuration.repository}@#{to}`
end
# Check out (on all servers associated with the current task) the latest
@ -60,8 +60,7 @@ module Capistrano
# remote server.)
def checkout(actor)
op = configuration[:checkout] || "co"
username = configuration[:svn_username] ? "--username #{configuration[:svn_username]}" : ""
command = "#{svn} #{op} #{username} -q -r#{configuration.revision} #{configuration.repository} #{actor.release_path} &&"
command = "#{svn} #{op} #{authorization} -q -r#{configuration.revision} #{configuration.repository} #{actor.release_path} &&"
run_checkout(actor, command, &svn_stream_handler(actor))
end
@ -78,8 +77,14 @@ module Capistrano
configuration[:svn] || "svn"
end
def authorization
username = configuration[:svn_username] ? "--username #{configuration[:svn_username]}" : ""
password = configuration[:svn_password] ? "--password #{configuration[:svn_password]}" : ""
"#{username} #{password}"
end
def svn_log(path)
`svn log -q --limit 1 #{path}`
`svn log #{authorization} -q --limit 1 #{path}`
end
def svn_password