Mark private SubversionDownloadStrategy methods
This commit is contained in:
parent
5afa11ecab
commit
6081874612
@ -382,37 +382,21 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
|
|||||||
@url = @url.sub(/^svn\+/, "") if @url.start_with?("svn+http://")
|
@url = @url.sub(/^svn\+/, "") if @url.start_with?("svn+http://")
|
||||||
end
|
end
|
||||||
|
|
||||||
def repo_url
|
|
||||||
`svn info '#{@clone}' 2>/dev/null`.strip[/^URL: (.+)$/, 1]
|
|
||||||
end
|
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
clear_cache unless @url.chomp("/") == repo_url or quiet_system "svn", "switch", @url, @clone
|
clear_cache unless @url.chomp("/") == repo_url or quiet_system "svn", "switch", @url, @clone
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
def clone_repo
|
|
||||||
case @ref_type
|
|
||||||
when :revision
|
|
||||||
fetch_repo @clone, @url, @ref
|
|
||||||
when :revisions
|
|
||||||
# nil is OK for main_revision, as fetch_repo will then get latest
|
|
||||||
main_revision = @ref[:trunk]
|
|
||||||
fetch_repo @clone, @url, main_revision, true
|
|
||||||
|
|
||||||
get_externals do |external_name, external_url|
|
|
||||||
fetch_repo @clone+external_name, external_url, @ref[external_name], true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
fetch_repo @clone, @url
|
|
||||||
end
|
|
||||||
end
|
|
||||||
alias_method :update, :clone_repo
|
|
||||||
|
|
||||||
def stage
|
def stage
|
||||||
quiet_safe_system 'svn', 'export', '--force', @clone, Dir.pwd
|
quiet_safe_system 'svn', 'export', '--force', @clone, Dir.pwd
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def repo_url
|
||||||
|
`svn info '#{@clone}' 2>/dev/null`.strip[/^URL: (.+)$/, 1]
|
||||||
|
end
|
||||||
|
|
||||||
def shell_quote str
|
def shell_quote str
|
||||||
# Oh god escaping shell args.
|
# Oh god escaping shell args.
|
||||||
# See http://notetoself.vrensk.com/2008/08/escaping-single-quotes-in-ruby-harder-than-expected/
|
# See http://notetoself.vrensk.com/2008/08/escaping-single-quotes-in-ruby-harder-than-expected/
|
||||||
@ -445,8 +429,6 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
|
|||||||
quiet_safe_system(*args)
|
quiet_safe_system(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def cache_tag
|
def cache_tag
|
||||||
head? ? "svn-HEAD" : "svn"
|
head? ? "svn-HEAD" : "svn"
|
||||||
end
|
end
|
||||||
@ -454,6 +436,24 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
|
|||||||
def repo_valid?
|
def repo_valid?
|
||||||
@clone.join(".svn").directory?
|
@clone.join(".svn").directory?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def clone_repo
|
||||||
|
case @ref_type
|
||||||
|
when :revision
|
||||||
|
fetch_repo @clone, @url, @ref
|
||||||
|
when :revisions
|
||||||
|
# nil is OK for main_revision, as fetch_repo will then get latest
|
||||||
|
main_revision = @ref[:trunk]
|
||||||
|
fetch_repo @clone, @url, main_revision, true
|
||||||
|
|
||||||
|
get_externals do |external_name, external_url|
|
||||||
|
fetch_repo @clone+external_name, external_url, @ref[external_name], true
|
||||||
|
end
|
||||||
|
else
|
||||||
|
fetch_repo @clone, @url
|
||||||
|
end
|
||||||
|
end
|
||||||
|
alias_method :update, :clone_repo
|
||||||
end
|
end
|
||||||
|
|
||||||
StrictSubversionDownloadStrategy = SubversionDownloadStrategy
|
StrictSubversionDownloadStrategy = SubversionDownloadStrategy
|
||||||
@ -463,6 +463,7 @@ class UnsafeSubversionDownloadStrategy < SubversionDownloadStrategy
|
|||||||
def fetch_args
|
def fetch_args
|
||||||
%w[--non-interactive --trust-server-cert]
|
%w[--non-interactive --trust-server-cert]
|
||||||
end
|
end
|
||||||
|
private :fetch_args
|
||||||
end
|
end
|
||||||
|
|
||||||
class GitDownloadStrategy < VCSDownloadStrategy
|
class GitDownloadStrategy < VCSDownloadStrategy
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user