\r
require 'redmine/scm/adapters/abstract_adapter'\r
require 'rexml/document'\r
+require 'uri'\r
\r
module Redmine\r
module Scm\r
path ||= ''\r
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"\r
entries = Entries.new\r
- cmd = "#{SVN_BIN} list --xml #{target(path)}@#{identifier}"\r
+ cmd = "#{SVN_BIN} list --xml #{target(URI.escape(path))}@#{identifier}"\r
cmd << credentials_string\r
shellout(cmd) do |io|\r
output = io.read\r
# Skip directory if there is no commit date (usually that\r
# means that we don't have read access to it)\r
next if entry.attributes['kind'] == 'dir' && entry.elements['commit'].elements['date'].nil?\r
- entries << Entry.new({:name => entry.elements['name'].text,\r
+ entries << Entry.new({:name => URI.unescape(entry.elements['name'].text),\r
:path => ((path.empty? ? "" : "#{path}/") + entry.elements['name'].text),\r
:kind => entry.attributes['kind'],\r
:size => (entry.elements['size'] and entry.elements['size'].text).to_i,\r
return nil unless self.class.client_version_above?([1, 5, 0])\r
\r
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"\r
- cmd = "#{SVN_BIN} proplist --verbose --xml #{target(path)}@#{identifier}"\r
+ cmd = "#{SVN_BIN} proplist --verbose --xml #{target(URI.escape(path))}@#{identifier}"\r
cmd << credentials_string\r
properties = {}\r
shellout(cmd) do |io|\r
cmd = "#{SVN_BIN} log --xml -r #{identifier_from}:#{identifier_to}"\r
cmd << credentials_string\r
cmd << " --verbose " if options[:with_paths]\r
- cmd << ' ' + target(path)\r
+ cmd << ' ' + target(URI.escape(path))\r
shellout(cmd) do |io|\r
begin\r
doc = REXML::Document.new(io)\r
cmd = "#{SVN_BIN} diff -r "\r
cmd << "#{identifier_to}:"\r
cmd << "#{identifier_from}"\r
- cmd << " #{target(path)}@#{identifier_from}"\r
+ cmd << " #{target(URI.escape(path))}@#{identifier_from}"\r
cmd << credentials_string\r
diff = []\r
shellout(cmd) do |io|\r
\r
def cat(path, identifier=nil)\r
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"\r
- cmd = "#{SVN_BIN} cat #{target(path)}@#{identifier}"\r
+ cmd = "#{SVN_BIN} cat #{target(URI.escape(path))}@#{identifier}"\r
cmd << credentials_string\r
cat = nil\r
shellout(cmd) do |io|\r
\r
def annotate(path, identifier=nil)\r
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"\r
- cmd = "#{SVN_BIN} blame #{target(path)}@#{identifier}"\r
+ cmd = "#{SVN_BIN} blame #{target(URI.escape(path))}@#{identifier}"\r
cmd << credentials_string\r
blame = Annotate.new\r
shellout(cmd) do |io|\r