Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'marius-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Bugno committed Jan 18, 2011
2 parents 717b596 + f76e146 commit 9e93c01
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions extras/big_tuna/vcs/subversion.rb
@@ -0,0 +1,43 @@
module BigTuna::VCS
class Subversion < Base
NAME = "Subversion"
VALUE = "svn"

def self.supported?
return @_supported unless @_supported.nil?
begin
@_supported = BigTuna::Runner.execute(Dir.pwd, "svn --version").ok?
rescue BigTuna::Runner::Error => e
@_supported = false
end
@_supported
end

def head_info
info = {}
command = "svn log -l 1"
begin
output = BigTuna::Runner.execute(source, command)
rescue BigTuna::Runner::Error => e
raise BigTuna::VCS::Error.new("Couldn't access repository log")
end
log = output.stdout[1].match(/(\S+) \| (\S+) \| (.+) \|/)
info[:commit] = log[1]
info[:author] = log[2]
email = begin
YAML.load(File.read('config/email_addresses.yml'))[log[2]]
rescue
nil
end
info[:email] = email
info[:committed_at] = Time.parse(log[3])
info[:commit_message] = output.stdout[3..-2]
[info, command]
end

def clone(where_to)
command = "svn checkout #{source} #{where_to}"
BigTuna::Runner.execute(Dir.pwd, command)
end
end
end

0 comments on commit 9e93c01

Please sign in to comment.