From 8aaae2170521f9273fecdaaa2aade9c891d91f87 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Sat, 13 Oct 2007 14:17:54 +0000 Subject: [PATCH] When Subversion#query_revision fails, give a more sane error git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7858 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- CHANGELOG | 2 ++ lib/capistrano/recipes/deploy/scm/subversion.rb | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 72dd1bd8..fd17855b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* When Subversion#query_revision fails, give a more sane error [Jamis Buck] + * Don't run the upgrade:revisions task on non-release servers [Jamis Buck] * Fix cap shell to properly recognize sudo prompt [Mark Imbriaco, barnaby, Jamis Buck] diff --git a/lib/capistrano/recipes/deploy/scm/subversion.rb b/lib/capistrano/recipes/deploy/scm/subversion.rb index 8b1d69db..4de260ff 100644 --- a/lib/capistrano/recipes/deploy/scm/subversion.rb +++ b/lib/capistrano/recipes/deploy/scm/subversion.rb @@ -52,8 +52,11 @@ module Capistrano # executed (svn info), and will extract the revision from the response. def query_revision(revision) return revision if revision =~ /^\d+$/ - result = yield(scm(:info, repository, authentication, "-r#{revision}")) - YAML.load(result)['Revision'] + command = scm(:info, repository, authentication, "-r#{revision}") + result = yield(command) + yaml = YAML.load(result) + raise "tried to run `#{command}' and got unexpected result #{result.inspect}" unless Hash === yaml + yaml['Revision'] end # Determines what the response should be for a particular bit of text