Skip to content

Commit

Permalink
Added Mercurial branch support with :branch option
Browse files Browse the repository at this point in the history
(cherry picked from commit c41bd5a)
  • Loading branch information
Jon Yurek authored and leehambley committed May 26, 2009
1 parent 28fe9c5 commit 65ef1d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/capistrano/recipes/deploy/scm/mercurial.rb
Expand Up @@ -18,7 +18,7 @@ class Mercurial < Base
# For mercurial HEAD == tip except that it bases this assumption on what
# tip is in the current repository (so push before you deploy)
def head
"tip"
configuration[:branch] || "tip"
end

# Clone the repository and update to the specified changeset.
Expand Down Expand Up @@ -134,4 +134,4 @@ def scm_password_or_prompt
end
end
end
end
end
5 changes: 5 additions & 0 deletions test/deploy/scm/mercurial_test.rb
Expand Up @@ -17,6 +17,11 @@ def test_head
assert_equal "tip", @source.head
end

def test_different_head
@config[:branch] = "staging"
assert_equal "staging", @source.head
end

def test_checkout
@config[:repository] = "http://example.com/project-hg"
dest = "/var/www"
Expand Down

0 comments on commit 65ef1d0

Please sign in to comment.