Skip to content

Commit

Permalink
extract refresh local cache code to its own method
Browse files Browse the repository at this point in the history
  • Loading branch information
despo committed Mar 16, 2012
1 parent afbfe76 commit 3d30635
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/capistrano/recipes/deploy/strategy/copy.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ class Copy < Base
def deploy! def deploy!
if copy_cache if copy_cache
if File.exists?(copy_cache) if File.exists?(copy_cache)
logger.debug "refreshing local cache to revision #{revision} at #{copy_cache}" refresh_local_cache
system(source.sync(revision, copy_cache))
else else
logger.debug "preparing local cache at #{copy_cache}" logger.debug "preparing local cache at #{copy_cache}"
system(source.checkout(revision, copy_cache)) system(source.checkout(revision, copy_cache))
Expand Down Expand Up @@ -153,6 +152,11 @@ def copy_cache


private private


def refresh_local_cache
logger.debug "refreshing local cache to revision #{revision} at #{copy_cache}"
system(source.sync(revision, copy_cache))
end

# Specify patterns to exclude from the copy. This is only valid # Specify patterns to exclude from the copy. This is only valid
# when using a local cache. # when using a local cache.
def copy_exclude def copy_exclude
Expand Down

0 comments on commit 3d30635

Please sign in to comment.