scm: code clean up abstract adapter.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6006 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
91abe15482
commit
b2d04df37e
|
@ -207,7 +207,9 @@ module Redmine
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.shellout(cmd, &block)
|
def self.shellout(cmd, &block)
|
||||||
logger.debug "Shelling out: #{strip_credential(cmd)}" if logger && logger.debug?
|
if logger && logger.debug?
|
||||||
|
logger.debug "Shelling out: #{strip_credential(cmd)}"
|
||||||
|
end
|
||||||
if Rails.env == 'development'
|
if Rails.env == 'development'
|
||||||
# Capture stderr when running in dev environment
|
# Capture stderr when running in dev environment
|
||||||
cmd = "#{cmd} 2>>#{RAILS_ROOT}/log/scm.stderr.log"
|
cmd = "#{cmd} 2>>#{RAILS_ROOT}/log/scm.stderr.log"
|
||||||
|
@ -225,7 +227,12 @@ module Redmine
|
||||||
rescue Errno::ENOENT => e
|
rescue Errno::ENOENT => e
|
||||||
msg = strip_credential(e.message)
|
msg = strip_credential(e.message)
|
||||||
# The command failed, log it and re-raise
|
# The command failed, log it and re-raise
|
||||||
logger.error("SCM command failed, make sure that your SCM binary (eg. svn) is in PATH (#{ENV['PATH']}): #{strip_credential(cmd)}\n with: #{msg}")
|
logmsg = "SCM command failed, "
|
||||||
|
logmsg += "make sure that your SCM binary (eg. svn) is "
|
||||||
|
logmsg += "in PATH (#{ENV['PATH']}): "
|
||||||
|
logmsg += "#{strip_credential(cmd)}\n"
|
||||||
|
logmsg += "with: #{msg}"
|
||||||
|
logger.error(logmsg)
|
||||||
raise CommandFailed.new(msg)
|
raise CommandFailed.new(msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue