diff lib/redmine/scm/adapters/abstract_adapter.rb @ 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 851510f1b535 cbb26bc654de
line wrap: on
line diff
--- a/lib/redmine/scm/adapters/abstract_adapter.rb	Mon Jun 06 14:24:13 2011 +0100
+++ b/lib/redmine/scm/adapters/abstract_adapter.rb	Thu Jul 14 10:32:19 2011 +0100
@@ -199,7 +199,9 @@
         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,13 @@
           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 command (e.g. svn) is "
+            logmsg += "in PATH (#{ENV['PATH']})\n"
+            logmsg += "You can configure your scm commands in config/configuration.yml.\n"
+            logmsg += "#{strip_credential(cmd)}\n"
+            logmsg += "with: #{msg}"
+            logger.error(logmsg)
             raise CommandFailed.new(msg)
           end
         end