comparison lib/redmine/scm/adapters/.svn/text-base/abstract_adapter.rb.svn-base @ 507:0c939c159af4 redmine-1.2

Update to Redmine 1.2.1 on 1.2-stable branch (Redmine SVN rev 6270)
author Chris Cannam
date Thu, 14 Jul 2011 10:32:19 +0100
parents cbce1fd3b1b7
children
comparison
equal deleted inserted replaced
441:cbce1fd3b1b7 507:0c939c159af4
197 def self.logger 197 def self.logger
198 RAILS_DEFAULT_LOGGER 198 RAILS_DEFAULT_LOGGER
199 end 199 end
200 200
201 def self.shellout(cmd, &block) 201 def self.shellout(cmd, &block)
202 logger.debug "Shelling out: #{strip_credential(cmd)}" if logger && logger.debug? 202 if logger && logger.debug?
203 logger.debug "Shelling out: #{strip_credential(cmd)}"
204 end
203 if Rails.env == 'development' 205 if Rails.env == 'development'
204 # Capture stderr when running in dev environment 206 # Capture stderr when running in dev environment
205 cmd = "#{cmd} 2>>#{RAILS_ROOT}/log/scm.stderr.log" 207 cmd = "#{cmd} 2>>#{RAILS_ROOT}/log/scm.stderr.log"
206 end 208 end
207 begin 209 begin
215 block.call(io) if block_given? 217 block.call(io) if block_given?
216 end 218 end
217 rescue Errno::ENOENT => e 219 rescue Errno::ENOENT => e
218 msg = strip_credential(e.message) 220 msg = strip_credential(e.message)
219 # The command failed, log it and re-raise 221 # The command failed, log it and re-raise
220 logger.error("SCM command failed, make sure that your SCM binary (eg. svn) is in PATH (#{ENV['PATH']}): #{strip_credential(cmd)}\n with: #{msg}") 222 logmsg = "SCM command failed, "
223 logmsg += "make sure that your SCM command (e.g. svn) is "
224 logmsg += "in PATH (#{ENV['PATH']})\n"
225 logmsg += "You can configure your scm commands in config/configuration.yml.\n"
226 logmsg += "#{strip_credential(cmd)}\n"
227 logmsg += "with: #{msg}"
228 logger.error(logmsg)
221 raise CommandFailed.new(msg) 229 raise CommandFailed.new(msg)
222 end 230 end
223 end 231 end
224 232
225 # Hides username/password in a given command 233 # Hides username/password in a given command