mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
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
This commit is contained in:
parent
0b4a0620fd
commit
8aaae21705
2 changed files with 7 additions and 2 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue