##// END OF EJS Templates
scm: space cleanup of lib/redmine/scm/adapters/abstract_adapter.rb....
Toshi MARUYAMA -
r4741:bd9a3a720cb4
parent child
Show More
@@ -19,10 +19,10 require 'cgi'
19
19
20 module Redmine
20 module Redmine
21 module Scm
21 module Scm
22 module Adapters
22 module Adapters
23 class CommandFailed < StandardError #:nodoc:
23 class CommandFailed < StandardError #:nodoc:
24 end
24 end
25
25
26 class AbstractAdapter #:nodoc:
26 class AbstractAdapter #:nodoc:
27 class << self
27 class << self
28 def client_command
28 def client_command
@@ -188,11 +188,11 module Redmine
188 def shellout(cmd, &block)
188 def shellout(cmd, &block)
189 self.class.shellout(cmd, &block)
189 self.class.shellout(cmd, &block)
190 end
190 end
191
191
192 def self.logger
192 def self.logger
193 RAILS_DEFAULT_LOGGER
193 RAILS_DEFAULT_LOGGER
194 end
194 end
195
195
196 def self.shellout(cmd, &block)
196 def self.shellout(cmd, &block)
197 logger.debug "Shelling out: #{strip_credential(cmd)}" if logger && logger.debug?
197 logger.debug "Shelling out: #{strip_credential(cmd)}" if logger && logger.debug?
198 if Rails.env == 'development'
198 if Rails.env == 'development'
@@ -210,8 +210,8 module Redmine
210 logger.error("SCM command failed, make sure that your SCM binary (eg. svn) is in PATH (#{ENV['PATH']}): #{strip_credential(cmd)}\n with: #{msg}")
210 logger.error("SCM command failed, make sure that your SCM binary (eg. svn) is in PATH (#{ENV['PATH']}): #{strip_credential(cmd)}\n with: #{msg}")
211 raise CommandFailed.new(msg)
211 raise CommandFailed.new(msg)
212 end
212 end
213 end
213 end
214
214
215 # Hides username/password in a given command
215 # Hides username/password in a given command
216 def self.strip_credential(cmd)
216 def self.strip_credential(cmd)
217 q = (Redmine::Platform.mswin? ? '"' : "'")
217 q = (Redmine::Platform.mswin? ? '"' : "'")
@@ -231,7 +231,7 module Redmine
231 else
231 else
232 x.kind <=> y.kind
232 x.kind <=> y.kind
233 end
233 end
234 }
234 }
235 end
235 end
236
236
237 def revisions
237 def revisions
@@ -329,7 +329,7 module Redmine
329 end
329 end
330 end
330 end
331 end
331 end
332
332
333 class Annotate
333 class Annotate
334 attr_reader :lines, :revisions
334 attr_reader :lines, :revisions
335
335
General Comments 0
You need to be logged in to leave comments. Login now