From 579abc1802878751398030cfea3c1ec490b22ea7 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 8 Jun 2011 13:23:56 +0000 Subject: [PATCH] Merged r6006 from trunk. scm: code clean up abstract adapter. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@6008 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/abstract_adapter.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb index fec9de5c1..518326269 100644 --- a/lib/redmine/scm/adapters/abstract_adapter.rb +++ b/lib/redmine/scm/adapters/abstract_adapter.rb @@ -199,7 +199,9 @@ module Redmine end 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' # Capture stderr when running in dev environment cmd = "#{cmd} 2>>#{RAILS_ROOT}/log/scm.stderr.log" @@ -217,7 +219,12 @@ module Redmine rescue Errno::ENOENT => e msg = strip_credential(e.message) # 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) end end -- 2.39.5