class Git::Si::SvnControl
Public Class Methods
add_command(*files)
click to toggle source
# File lib/git/si/svn-control.rb, line 75 def self.add_command(*files) raise GitSiError.new("Add command requires filenames") if ( files.length == 0 ) "#{@@svn_binary} add " + files.join(' ') end
blame_command(*files)
click to toggle source
# File lib/git/si/svn-control.rb, line 80 def self.blame_command(*files) raise GitSiError.new("Blame command requires filenames") if ( files.length == 0 ) "#{@@svn_binary} blame " + files.join(' ') end
commit_command(*args)
click to toggle source
# File lib/git/si/svn-control.rb, line 99 def self.commit_command(*args) command = "#{@@svn_binary} commit" if ( args.length > 0 ) command += " " + args.join(' ') end command end
diff_command(*args)
click to toggle source
# File lib/git/si/svn-control.rb, line 23 def self.diff_command(*args) command = "#{@@svn_binary} diff" if ( args.length > 0 ) command += " " + args.join(' ') end command end
info_command()
click to toggle source
# File lib/git/si/svn-control.rb, line 19 def self.info_command "#{@@svn_binary} info" end
list_file_command()
click to toggle source
# File lib/git/si/svn-control.rb, line 107 def self.list_file_command "#{@@svn_binary} list -R" end
parse_conflicted_files(svn_update_output)
click to toggle source
# File lib/git/si/svn-control.rb, line 59 def self.parse_conflicted_files(svn_update_output) svn_update_output.split(/\r?\n/).collect do |line| line.strip.match(Regexp.union(/^\s*C\s+(\S.+)/, /^Resolved conflicted state of '(.+)'/)) do |pattern| pattern.to_a.compact.last end end.compact end
parse_deleted_files(svn_update_output)
click to toggle source
# File lib/git/si/svn-control.rb, line 51 def self.parse_deleted_files(svn_update_output) svn_update_output.split(/\r?\n/).collect do |line| line.strip.match(Regexp.union(/^\s*D\s+(\S.+)/)) do |pattern| pattern.to_a.compact.last end end.compact end
parse_external_repos(status_string)
click to toggle source
# File lib/git/si/svn-control.rb, line 124 def self.parse_external_repos(status_string) status_string.split(/\r?\n/).collect do |line| line.strip.match(/^\s*X\s+(\S.+)/) do |pattern| pattern.to_a.compact.last end end.compact end
parse_file_list(list_output)
click to toggle source
# File lib/git/si/svn-control.rb, line 111 def self.parse_file_list(list_output) list_output.split(/\r?\n/).collect do |filename| filename.strip if filename.strip !~ Regexp.union( /\/$/, /^\./, /\/\./ ) and not filename.empty? end.compact end
parse_last_revision(svn_info)
click to toggle source
# File lib/git/si/svn-control.rb, line 31 def self.parse_last_revision(svn_info) results = svn_info.match(/^Revision:\s+(\d+)/) return results[1] if results return nil end
parse_root_path(svn_info)
click to toggle source
# File lib/git/si/svn-control.rb, line 37 def self.parse_root_path(svn_info) results = svn_info.match(/Root Path:\s+(.+)/) return results[1] if results return nil end
parse_svn_status(status_string)
click to toggle source
# File lib/git/si/svn-control.rb, line 117 def self.parse_svn_status(status_string) return '' unless status_string status_string.split(/\r?\n/).select do |line| line.strip !~ /(^X|\.git|\.swp$)/ end end
parse_unknown_files(svn_update_output)
click to toggle source
# File lib/git/si/svn-control.rb, line 67 def self.parse_unknown_files(svn_update_output) svn_update_output.split(/\r?\n/).collect do |line| line.strip.match(/^\s*\?\s+(\S.+)/) do |pattern| pattern.to_a.compact.last end end.compact end
parse_updated_files(svn_update_output)
click to toggle source
# File lib/git/si/svn-control.rb, line 43 def self.parse_updated_files(svn_update_output) svn_update_output.split(/\r?\n/).collect do |line| line.strip.match(Regexp.union(/^\s*[AGU]\s+(\S.+)/, /^Restored '(.+)'/, /^Resolved conflicted state of '(.+)'/)) do |pattern| pattern.to_a.compact.last end end.compact end
revert_command(*args)
click to toggle source
# File lib/git/si/svn-control.rb, line 89 def self.revert_command(*args) command = "#{@@svn_binary} revert -R" if ( args.length > 0 ) command += " " + args.join(' ') else command += " ." end command end
status_command(*args)
click to toggle source
# File lib/git/si/svn-control.rb, line 11 def self.status_command(*args) command = "#{@@svn_binary} status --ignore-externals" if ( args.length > 0 ) command += " " + args.join(' ') end command end
svn_binary=(binary)
click to toggle source
# File lib/git/si/svn-control.rb, line 7 def self.svn_binary=(binary) @@svn_binary = binary && binary.length > 0 ? binary : @@default_svn_binary end
update_command()
click to toggle source
# File lib/git/si/svn-control.rb, line 85 def self.update_command "#{@@svn_binary} up --accept theirs-full --ignore-externals" end