On 31 Sty, 05:07, Jamis Buck <[EMAIL PROTECTED]> wrote:
> Yup, remote_cache just does an svn up and copy--it has absolutely no
> intelligence built-in for branching and so forth. I'm sorry that bit
> you.
>
> If anyone has the inclination, a patch would be welcome, so long as it
> did not complicate the common case.
>
> - Jamis

I have an idea.
Lets cache the whole repository on the remote server. Not only one
branch(trunk, tag).
# in your application deploy recipe
 # instead of
 # set :repository,  "your_repo_url/my_app/trunk"
 # write
 set :repository,  "your_repo_url/my_app"
 # and set a branch variable
 set :branch, "trunk"  # the user can change it acording to varialbes
set via the CLI or based on the current stage etc.

And lets copy not the whole shared_path/cached-copy but the specified
branch from the cached copy to the release_path
#in capistrano/recipes/deploy/strategy/remote_cashe.rb
 # add this method
 def repository_cache_branch
   File.join(repository_cache, configuration[:branch] || "")
 end
# and change the original copy_repository_cache method to this
 def copy_repository_cache
   logger.trace "copying the cached version to
#{configuration[:release_path]}"
   run "cp -RPp #{repository_cache_branch}
#{configuration[:release_path]} && #{mark}" # repository_cache
replaced by repository_cache_branch
 end

Here is the diff patch http://www.szymon.jez.net.pl/files/remote_cache.rb.diff

The changes made in this patch are backwards compatible. They don't
affect the way people were using remote_cache. When the variable
branch is not set and the variable repository is pointing directly to
a branch it will work as always.

I tested this with my production app using capistrano-2.2.0

I think it could be applied to capistrano's trunk.
Szymon

PS. Thanks everyone(especially James) for contributing to Capistano
it's a great tool.
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to