Module: Capistrano::Hg::DefaultStrategy
- Defined in:
- lib/capistrano/hg.rb
Instance Method Summary collapse
- #check ⇒ Object
- #clone ⇒ Object
- #fetch_revision ⇒ Object
- #release ⇒ Object
- #test ⇒ Object
- #update ⇒ Object
Instance Method Details
#check ⇒ Object
17 18 19 |
# File 'lib/capistrano/hg.rb', line 17 def check hg "id", repo_url end |
#clone ⇒ Object
21 22 23 |
# File 'lib/capistrano/hg.rb', line 21 def clone hg "clone", "--noupdate", repo_url, repo_path end |
#fetch_revision ⇒ Object
39 40 41 |
# File 'lib/capistrano/hg.rb', line 39 def fetch_revision context.capture(:hg, "log --rev #{fetch(:branch)} --template \"{node}\n\"") end |
#release ⇒ Object
29 30 31 32 33 34 35 36 37 |
# 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 ⇒ Object
13 14 15 |
# File 'lib/capistrano/hg.rb', line 13 def test test! " [ -d #{repo_path}/.hg ] " end |
#update ⇒ Object
25 26 27 |
# File 'lib/capistrano/hg.rb', line 25 def update hg "pull" end |