Patch #26149 » 0001-removes-duplicate-shell_quote-method.patch
| lib/redmine/scm/adapters/abstract_adapter.rb | ||
|---|---|---|
|
module Scm
|
||
|
module Adapters
|
||
|
class AbstractAdapter #:nodoc:
|
||
|
include Redmine::Utils::Shell
|
||
|
# raised if scm command exited with error, e.g. unknown revision.
|
||
|
class ScmCommandAborted < ::Redmine::Scm::Adapters::CommandFailed; end
|
||
|
class << self
|
||
|
def client_command
|
||
|
""
|
||
|
end
|
||
|
def shell_quote(str)
|
||
|
Redmine::Utils::Shell.shell_quote str
|
||
|
end
|
||
|
def shell_quote_command
|
||
|
if Redmine::Platform.mswin? && RUBY_PLATFORM == 'java'
|
||
|
client_command
|
||
|
else
|
||
|
shell_quote(client_command)
|
||
|
end
|
||
|
Redmine::Utils::Shell.shell_quote_command client_command
|
||
|
end
|
||
|
# Returns the version of the scm client
|
||
| ... | ... | |
|
true
|
||
|
end
|
||
|
def shell_quote(str)
|
||
|
if Redmine::Platform.mswin?
|
||
|
'"' + str.gsub(/"/, '\\"') + '"'
|
||
|
else
|
||
|
"'" + str.gsub(/'/, "'\"'\"'") + "'"
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
def initialize(url, root_url=nil, login=nil, password=nil,
|
||
| ... | ... | |
|
(path[-1,1] == "/") ? path[0..-2] : path
|
||
|
end
|
||
|
def shell_quote(str)
|
||
|
self.class.shell_quote(str)
|
||
|
end
|
||
|
private
|
||
|
def retrieve_root_url
|
||
|
info = self.info
|
||
| lib/redmine/utils.rb | ||
|---|---|---|
|
end
|
||
|
module Shell
|
||
|
module_function
|
||
|
def shell_quote(str)
|
||
|
if Redmine::Platform.mswin?
|
||
|
'"' + str.gsub(/"/, '\\"') + '"'
|
||
| ... | ... | |
|
"'" + str.gsub(/'/, "'\"'\"'") + "'"
|
||
|
end
|
||
|
end
|
||
|
def shell_quote_command(command)
|
||
|
if Redmine::Platform.mswin? && RUBY_PLATFORM == 'java'
|
||
|
command
|
||
|
else
|
||
|
shell_quote(command)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
module DateCalculation
|
||