class Capistrano::SCM::Svn

Public Instance Methods

archive_to_release_path() click to toggle source
# File lib/capistrano/scm/svn.rb, line 43
def archive_to_release_path
  svn :export, "--force", ".", release_path
end
check_repo_is_reachable() click to toggle source
# File lib/capistrano/scm/svn.rb, line 26
def check_repo_is_reachable
  svn_username = fetch(:svn_username) ? "--username #{fetch(:svn_username)}" : ""
  svn_password = fetch(:svn_password) ? "--password #{fetch(:svn_password)}" : ""
  backend.test :svn, :info, repo_url, svn_username, svn_password
end
clone_repo() click to toggle source
# File lib/capistrano/scm/svn.rb, line 32
def clone_repo
  svn :checkout, repo_url, repo_path.to_s
end
define_tasks() click to toggle source
# File lib/capistrano/scm/svn.rb, line 10
def define_tasks
  eval_rakefile File.expand_path("../tasks/svn.rake", __FILE__)
end
fetch_repo_mirror_url() click to toggle source
# File lib/capistrano/scm/svn.rb, line 51
def fetch_repo_mirror_url
  backend.capture(:svn, :info, repo_path.to_s).each_line do |line|
    return $1 if /\AURL: (.*)\n\z/ =~ line
  end
end
fetch_revision() click to toggle source
# File lib/capistrano/scm/svn.rb, line 47
def fetch_revision
  backend.capture(:svnversion, repo_path.to_s)
end
register_hooks() click to toggle source
# File lib/capistrano/scm/svn.rb, line 4
def register_hooks
  after "deploy:new_release_path", "svn:create_release"
  before "deploy:check", "svn:check"
  before "deploy:set_current_revision", "svn:set_current_revision"
end
repo_mirror_exists?() click to toggle source
# File lib/capistrano/scm/svn.rb, line 22
def repo_mirror_exists?
  backend.test " [ -d #{repo_path}/.svn ] "
end
svn(*args) click to toggle source
# File lib/capistrano/scm/svn.rb, line 14
def svn(*args)
  args.unshift(:svn)
  args.push "--username #{fetch(:svn_username)}" if fetch(:svn_username)
  args.push "--password #{fetch(:svn_password)}" if fetch(:svn_password)
  args.push "--revision #{fetch(:svn_revision)}" if fetch(:svn_revision)
  backend.execute(*args)
end
update_mirror() click to toggle source
# File lib/capistrano/scm/svn.rb, line 36
def update_mirror
  # Switch the repository URL if necessary.
  repo_mirror_url = fetch_repo_mirror_url
  svn :switch, repo_url unless repo_mirror_url == repo_url
  svn :update
end