*** redmine.orig/lib/redmine/scm/adapters/subversion_adapter.rb Wed Aug 12 01:13:21 2009 --- redmine/lib/redmine/scm/adapters/subversion_adapter.rb Tue Aug 4 16:14:33 2009 *************** *** 25,31 **** class SubversionAdapter < AbstractAdapter # SVN executable name ! SVN_BIN = "svn" class << self def client_version --- 25,32 ---- class SubversionAdapter < AbstractAdapter # SVN executable name ! SVN_BIN = "/usr/bin/svn" ! SVN_COMMON_OPTIONS = "--config-dir #{RAILS_ROOT}/.subversion" class << self def client_version *************** *** 48,54 **** # Get info about the svn repository def info ! cmd = "#{SVN_BIN} info --xml #{target('')}" cmd << credentials_string info = nil shellout(cmd) do |io| --- 49,55 ---- # Get info about the svn repository def info ! cmd = "#{SVN_BIN} info #{SVN_COMMON_OPTIONS} --xml #{target('')}" cmd << credentials_string info = nil shellout(cmd) do |io| *************** *** 77,83 **** path ||= '' identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" entries = Entries.new ! cmd = "#{SVN_BIN} list --xml #{target(URI.escape(path))}@#{identifier}" cmd << credentials_string shellout(cmd) do |io| output = io.read --- 78,84 ---- path ||= '' identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" entries = Entries.new ! cmd = "#{SVN_BIN} list #{SVN_COMMON_OPTIONS} --xml #{target(URI.escape(path))}@#{identifier}" cmd << credentials_string shellout(cmd) do |io| output = io.read *************** *** 116,122 **** return nil unless self.class.client_version_above?([1, 5, 0]) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" ! cmd = "#{SVN_BIN} proplist --verbose --xml #{target(URI.escape(path))}@#{identifier}" cmd << credentials_string properties = {} shellout(cmd) do |io| --- 117,123 ---- return nil unless self.class.client_version_above?([1, 5, 0]) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" ! cmd = "#{SVN_BIN} proplist #{SVN_COMMON_OPTIONS} --verbose --xml #{target(URI.escape(path))}@#{identifier}" cmd << credentials_string properties = {} shellout(cmd) do |io| *************** *** 138,144 **** identifier_from = (identifier_from and identifier_from.to_i > 0) ? identifier_from.to_i : "HEAD" identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : 1 revisions = Revisions.new ! cmd = "#{SVN_BIN} log --xml -r #{identifier_from}:#{identifier_to}" cmd << credentials_string cmd << " --verbose " if options[:with_paths] cmd << ' ' + target(URI.escape(path)) --- 139,145 ---- identifier_from = (identifier_from and identifier_from.to_i > 0) ? identifier_from.to_i : "HEAD" identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : 1 revisions = Revisions.new ! cmd = "#{SVN_BIN} log #{SVN_COMMON_OPTIONS} --xml -r #{identifier_from}:#{identifier_to}" cmd << credentials_string cmd << " --verbose " if options[:with_paths] cmd << ' ' + target(URI.escape(path)) *************** *** 175,181 **** identifier_from = (identifier_from and identifier_from.to_i > 0) ? identifier_from.to_i : '' identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : (identifier_from.to_i - 1) ! cmd = "#{SVN_BIN} diff -r " cmd << "#{identifier_to}:" cmd << "#{identifier_from}" cmd << " #{target(URI.escape(path))}@#{identifier_from}" --- 176,182 ---- identifier_from = (identifier_from and identifier_from.to_i > 0) ? identifier_from.to_i : '' identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : (identifier_from.to_i - 1) ! cmd = "#{SVN_BIN} diff #{SVN_COMMON_OPTIONS} -r " cmd << "#{identifier_to}:" cmd << "#{identifier_from}" cmd << " #{target(URI.escape(path))}@#{identifier_from}" *************** *** 192,198 **** def cat(path, identifier=nil) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" ! cmd = "#{SVN_BIN} cat #{target(URI.escape(path))}@#{identifier}" cmd << credentials_string cat = nil shellout(cmd) do |io| --- 193,199 ---- def cat(path, identifier=nil) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" ! cmd = "#{SVN_BIN} cat #{SVN_COMMON_OPTIONS} #{target(URI.escape(path))}@#{identifier}" cmd << credentials_string cat = nil shellout(cmd) do |io| *************** *** 205,211 **** def annotate(path, identifier=nil) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" ! cmd = "#{SVN_BIN} blame #{target(URI.escape(path))}@#{identifier}" cmd << credentials_string blame = Annotate.new shellout(cmd) do |io| --- 206,212 ---- def annotate(path, identifier=nil) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" ! cmd = "#{SVN_BIN} blame #{SVN_COMMON_OPTIONS} #{target(URI.escape(path))}@#{identifier}" cmd << credentials_string blame = Annotate.new shellout(cmd) do |io|