Changeset 8925
- Timestamp:
- 02/23/08 04:04:27 (4 months ago)
- Files:
-
- tools/capistrano/CHANGELOG (modified) (1 diff)
- tools/capistrano/lib/capistrano/recipes/deploy/scm/mercurial.rb (modified) (2 diffs)
- tools/capistrano/test/deploy/scm/mercurial_test.rb (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/capistrano/CHANGELOG
r8924 r8925 1 1 *SVN* 2 3 * Add support for password prompts from the Mercurial SCM [ches] 2 4 3 5 * Add support for :max_hosts option in task definition or run() [Rob Holland <rob@inversepath.com>] tools/capistrano/lib/capistrano/recipes/deploy/scm/mercurial.rb
r7114 r8925 71 71 case text 72 72 when /^user:/mi 73 if variable(:scm_user) 74 "#{variable(:scm_user)}\n" 73 # support :scm_user for backwards compatibility of this module 74 if user = variable(:scm_username) || variable(:scm_user) 75 "#{user}\n" 75 76 else 76 raise "No variable :scm_user specified and Mercurial asked!\n" +77 raise "No variable :scm_username specified and Mercurial asked!\n" + 77 78 "Prompt was: #{text}" 78 79 end 79 when /^password:/mi 80 if variable(:scm_password) 81 "#{variable(:scm_password)}\n" 82 else 80 when /\bpassword:/mi 81 unless pass = scm_password_or_prompt 82 # fall back on old behavior of erroring out with msg 83 83 raise "No variable :scm_password specified and Mercurial asked!\n" + 84 84 "Prompt was: #{text}" 85 85 end 86 "#{pass}\n" 86 87 when /yes\/no/i 87 88 "yes\n" 88 89 end 89 90 end 90 91 91 92 private 92 93 … … 123 124 end 124 125 end 126 127 # honor Cap 2.1+'s :scm_prefer_prompt if present 128 def scm_password_or_prompt 129 @scm_password_or_prompt ||= variable(:scm_password) || 130 (Capistrano::CLI.password_prompt("hg password: ") if variable(:scm_prefer_prompt)) 131 end 125 132 126 133 end