Permalink
Browse files

Added Mercurial branch support with :branch option

  • Loading branch information...
1 parent df0935c commit c41bd5ac50f3a34bbe0da22f0db115d3d18210b5 @jyurek jyurek committed Mar 3, 2009
Showing with 7 additions and 2 deletions.
  1. +2 −2 lib/capistrano/recipes/deploy/scm/mercurial.rb
  2. +5 −0 test/deploy/scm/mercurial_test.rb
@@ -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.
@@ -134,4 +134,4 @@ def scm_password_or_prompt
end
end
end
-end
+end
@@ -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"

0 comments on commit c41bd5a

Please sign in to comment.