diff --git a/lib/capistrano/recipes/deploy/scm/subversion.rb b/lib/capistrano/recipes/deploy/scm/subversion.rb index 6e9ee38b..4019a306 100644 --- a/lib/capistrano/recipes/deploy/scm/subversion.rb +++ b/lib/capistrano/recipes/deploy/scm/subversion.rb @@ -27,7 +27,7 @@ module Capistrano # Returns the command that will do an "svn update" to the given # revision, for the working copy at the given destination. def sync(revision, destination) - scm :update, arguments, arguments(:update), verbose, authentication, "-r#{revision}", destination + scm :switch, arguments, verbose, authentication, "-r#{revision}", repository, destination end # Returns the command that will do an "svn export" of the given revision diff --git a/test/deploy/scm/subversion_test.rb b/test/deploy/scm/subversion_test.rb index 26d1047c..2f83b895 100644 --- a/test/deploy/scm/subversion_test.rb +++ b/test/deploy/scm/subversion_test.rb @@ -29,4 +29,12 @@ Last Changed Date: 2009-03-11 11:04:25 -0700 (Wed, 11 Mar 2009) end assert_equal 2095, revision end + + def test_sync + @config[:repository] = "http://svn.github.com/capistrano/capistrano.git" + rev = '602' + dest = "/var/www" + assert_equal "svn switch -q -r602 http://svn.github.com/capistrano/capistrano.git /var/www", @source.sync(rev, dest) + end + end