Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make cached copy work with svn

  • Loading branch information...
commit aa7363736d27d2fae3f53ffb27d230d1cc0aec8b 1 parent c623566
@smerritt smerritt authored ezmobius committed
Showing with 10 additions and 3 deletions.
  1. +10 −3 lib/chef-deploy/cached_deploy.rb
View
13 lib/chef-deploy/cached_deploy.rb
@@ -247,11 +247,18 @@ def repository_cache
end
def update_repository_cache
- command = "if [ -d #{repository_cache} ] &&" +
- "git --git-dir #{repository_cache}/.git/ remote -v | grep -q #{configuration[:repository]}; then " +
+ test = case configuration[:scm]
+ when 'git'
+ "git --git-dir #{repository_cache}/.git/ remote -v | grep -q #{configuration[:repository]}"
+ when 'svn'
+ repo_base_url = configuration[:repository].gsub(/\/branches*$|\/tags*$|\/trunk*$/, '')
+ "(cd #{repository_cache} && svn info | grep -q \"Repository Root:\" | grep -q #{repo_base_url})"
+ end
+
+ "if [ -d #{repository_cache} ] &&" +
+ "#{test}; then " +
"#{source.sync(revision, repository_cache)}; " +
"else #{source.checkout(revision, repository_cache)}; fi"
- command
end
def copy_repository_cache
Please sign in to comment.
Something went wrong with that request. Please try again.