Permalink
Browse files

Merging out some changes we applied here, which were already merged i…

…nto Net:SSH
  • Loading branch information...
1 parent 731034d commit b96507cbf66643495fe5b042c90a58d16ab1b315 Lee Hambley committed Nov 2, 2009
View
@@ -1,9 +1,3 @@
-== 2.5.10 / 25 October 2009
-
-* Fixes Darcs remote repository problem when using the copy strategy [Alex `regularfry` Young]
-* Allows the specification of :copy_via for use by the copy strategy [Emily `duien` Price]
-* Documentation improvements for embedding Capistrano [Lee Hambley]
-
== 2.5.9 / 1 August 2009
* Adds support for customizing which `tar` command to use. [Jeremy Wells]
@@ -18,22 +18,11 @@ def head
:head
end
- def to_match(revision)
- if revision.nil? || revision == self.head
- nil
- else
- "--to-match='hash #{revision}'"
- end
- end
-
# Returns the command that will check out the given revision to the
# given destination. The 'revision' parameter must be the 'hash' value
# for the revision in question, as given by 'darcs changes --xml-output'.
def checkout(revision, destination)
- scm :get, *[verbose,
- "--repo-name=#{destination}",
- to_match(revision),
- repository].compact
+ scm :get, verbose, "--repo-name=#{destination}", "--to-match='hash #{revision}'", repository
end
# Tries to update the destination repository in-place, to bring it up
@@ -38,10 +38,6 @@ module Strategy
# :copy_compression, which must be one of :gzip, :bz2, or
# :zip, and which specifies how the source should be compressed for
# transmission to each host.
- #
- # It also supports the variable :copy_via, which must be one of :sftp or
- # :scp, and which specifies the method used to transfer the compressed
- # code to the remote server. It defaults to :sftp.
class Copy < Base
# Obtains a copy of the source code locally (via the #command method),
# compresses it to a single file, copies that file to all target
@@ -100,8 +96,7 @@ def deploy!
logger.trace "compressing #{destination} to #{filename}"
Dir.chdir(tmpdir) { system(compress(File.basename(destination), File.basename(filename)).join(" ")) }
- upload(filename, remote_filename, {:via => configuration[:copy_via]})
- # FIXED Allow specifying transfer mode
+ upload(filename, remote_filename)
run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
ensure
FileUtils.rm filename rescue nil
@@ -1,37 +0,0 @@
-require "utils"
-require 'capistrano/recipes/deploy/scm/darcs'
-
-class DeploySCMDarcsTest < Test::Unit::TestCase
- class TestSCM < Capistrano::Deploy::SCM::Darcs
- default_command "darcs"
- end
- def setup
- @config = { :repository => "." }
- # def @config.exists?(name); key?(name); end
-
- @source = TestSCM.new(@config)
- end
-
- # We should be able to pick a specific hash.
- def test_checkout_hash
- hsh = "*version_hash*"
- assert_match(%r{--to-match=.hash #{Regexp.quote(hsh)}},
- @source.checkout(hsh, "*foo_location*"),
- "Specifying a revision hash got the --to-match option wrong.")
- end
-
- # Picking the head revision should leave out the hash, because head is the
- # default and we don't have a HEAD pseudotag
- def test_checkout_head
- hsh = @source.head
- assert_no_match(%r{--to-match}, @source.checkout(hsh, "*foo_location*"),
- "Selecting the head revision incorrectly produced a --to-match option.")
- end
-
- # Leaving the revision as nil shouldn't break anything.
- def test_checkout_nil
- assert_no_match(%r{--to-match}, @source.checkout(nil, "*foo_location*"),
- "Leaving the revision as nil incorrectly produced a --to-match option.")
- end
-end
-

0 comments on commit b96507c

Please sign in to comment.