# Get info about the svn repository\r
def info\r
cmd = "#{SVN_BIN} info --xml #{target('')}"\r
- cmd << " --username #{@login} --password #{@password}" if @login\r
+ cmd << credentials_string\r
info = nil\r
shellout(cmd) do |io|\r
begin\r
identifier = 'HEAD' unless identifier and identifier > 0\r
entries = Entries.new\r
cmd = "#{SVN_BIN} list --xml #{target(path)}@#{identifier}"\r
- cmd << " --username #{@login} --password #{@password}" if @login\r
+ cmd << credentials_string\r
cmd << " 2>&1"\r
shellout(cmd) do |io|\r
output = io.read\r
identifier_to = 1 unless identifier_to and identifier_to.to_i > 0\r
revisions = Revisions.new\r
cmd = "#{SVN_BIN} log --xml -r #{identifier_from}:#{identifier_to}"\r
- cmd << " --username #{@login} --password #{@password}" if @login\r
+ cmd << credentials_string\r
cmd << " --verbose " if options[:with_paths]\r
cmd << target(path)\r
shellout(cmd) do |io|\r
cmd << "#{identifier_to}:"\r
cmd << "#{identifier_from}"\r
cmd << "#{target(path)}@#{identifier_from}"\r
- cmd << " --username #{@login} --password #{@password}" if @login\r
+ cmd << credentials_string\r
diff = []\r
shellout(cmd) do |io|\r
io.each_line do |line|\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 << " --username #{@login} --password #{@password}" if @login\r
+ cmd << credentials_string\r
cat = nil\r
shellout(cmd) do |io|\r
io.binmode\r
rescue Errno::ENOENT => e\r
raise CommandFailed \r
end\r
+ \r
+ private\r
+ \r
+ def credentials_string\r
+ str = ''\r
+ str << " --username #{shell_quote(@login)}" unless @login.blank?\r
+ str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank?\r
+ str\r
+ end\r
end\r
end\r
end\r