Skip to content

Commit

Permalink
Better support for key passphrases in the SVN module (closes #5920) […
Browse files Browse the repository at this point in the history
…llasram@gmail.com]

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@4827 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jamis committed Aug 27, 2006
1 parent 8208667 commit 13e64d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*SVN*

* Better support for key passphrases in the SVN module (closes #5920) [llasram@gmail.com]

* Fix missing default for :local in cvs.rb (closes #3645) [jeremy@hinegardner.org]

* Fix awkward spacing in gemspec file (closes #3888) [grant@antiflux.org]
Expand Down
10 changes: 7 additions & 3 deletions lib/capistrano/scm/subversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def svn_password
configuration[:svn_password] || configuration[:password]
end

def svn_passphrase
configuration[:svn_passphrase] || svn_password
end

def svn_stream_handler(actor)
Proc.new do |ch, stream, out|
prefix = "#{stream} :: #{ch[:host]}"
Expand All @@ -105,10 +109,10 @@ def svn_stream_handler(actor)
actor.logger.info "subversion is asking whether to connect or not",
prefix
ch.send_data "yes\n"
elsif out =~ %r{passphrase}
message = "subversion needs your key's passphrase, sending empty string"
elsif out =~ %r{passphrase}i
message = "subversion needs your key's passphrase"
actor.logger.info message, prefix
ch.send_data "\n"
ch.send_data "#{svn_passphrase}\n"
elsif out =~ %r{The entry \'(\w+)\' is no longer a directory}
message = "subversion can't update because directory '#{$1}' was replaced. Please add it to svn:ignore."
actor.logger.info message, prefix
Expand Down

0 comments on commit 13e64d5

Please sign in to comment.