mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Fix deploy:pending to query SCM for the subsequent revision so that it does not include the last deployed change (currently only works correctly for Subversion, other SCM's need to be updated)
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7869 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
8053eaae0d
commit
577fffebd0
4 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Fix deploy:pending to query SCM for the subsequent revision so that it does not include the last deployed change [Jamis Buck]
|
||||
|
||||
* Prefer 'Last Changed Rev' over 'Revision' when querying latest revision via Subversion [Jamis Buck]
|
||||
|
||||
* Explicitly require 'stringio' in copy_test [mislav]
|
||||
|
|
|
@ -446,7 +446,8 @@ namespace :deploy do
|
|||
might not be supported on all SCM's.
|
||||
DESC
|
||||
task :default, :except => { :no_release => true } do
|
||||
system(source.local.log(current_revision))
|
||||
from = source.next_revision(current_revision)
|
||||
system(source.local.log(from))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -114,6 +114,18 @@ module Capistrano
|
|||
raise NotImplementedError, "`query_revision' is not implemented by #{self.class.name}"
|
||||
end
|
||||
|
||||
# Returns the revision number immediately following revision, if at
|
||||
# all possible. A block should always be passed to this method, which
|
||||
# accepts a command to invoke and returns the result, although a
|
||||
# particular SCM's implementation is not required to invoke the block.
|
||||
#
|
||||
# By default, this method simply returns the revision itself. If a
|
||||
# particular SCM is able to determine a subsequent revision given a
|
||||
# revision identifier, it should override this method.
|
||||
def next_revision(revision)
|
||||
revision
|
||||
end
|
||||
|
||||
# Should analyze the given text and determine whether or not a
|
||||
# response is expected, and if so, return the appropriate response.
|
||||
# If no response is expected, return nil. The +state+ parameter is a
|
||||
|
|
|
@ -59,6 +59,11 @@ module Capistrano
|
|||
yaml['Last Changed Rev'] || yaml['Revision']
|
||||
end
|
||||
|
||||
# Increments the given revision number and returns it.
|
||||
def next_revision(revision)
|
||||
revision.to_i + 1
|
||||
end
|
||||
|
||||
# Determines what the response should be for a particular bit of text
|
||||
# from the SCM. Password prompts, connection requests, passphrases,
|
||||
# etc. are handled here.
|
||||
|
|
Loading…
Add table
Reference in a new issue