module Capistrano::Hg::DefaultStrategy

Public Instance Methods

check() click to toggle source
# File lib/capistrano/hg.rb, line 17
def check
  hg "id", repo_url
end
clone() click to toggle source
# File lib/capistrano/hg.rb, line 21
def clone
  hg "clone", "--noupdate", repo_url, repo_path
end
fetch_revision() click to toggle source
# File lib/capistrano/hg.rb, line 39
def fetch_revision
  context.capture(:hg, "log --rev #{fetch(:branch)} --template \"{node}\n\"")
end
release() click to toggle source
# File lib/capistrano/hg.rb, line 29
def release
  if (tree = fetch(:repo_tree))
    tree = tree.slice %r#^/?(.*?)/?$#, 1
    components = tree.split("/").size
    hg "archive --type tgz -p . -I", tree, "--rev", fetch(:branch), "| tar -x --strip-components #{components} -f - -C", release_path
  else
    hg "archive", release_path, "--rev", fetch(:branch)
  end
end
test() click to toggle source
# File lib/capistrano/hg.rb, line 13
def test
  test! " [ -d #{repo_path}/.hg ] "
end
update() click to toggle source
# File lib/capistrano/hg.rb, line 25
def update
  hg "pull"
end