Skip to content
Snippets Groups Projects
Commit 79873bf4 authored by Dave Bayer's avatar Dave Bayer Committed by Max Howell
Browse files

fix: svn update doesn't take url argument


`svn up` doesn't take url argument; compare `svn help up` to `svn help checkout`
Apparently `svn up` can ignore this argument (not documented), but providing this
argument could confuse code readers into believing that changing the url will
switch the branch. It doesn't; the argument is ignored.

This fix was relayed to me, but I've studied it further before posting.
It is related to the bug where --HEAD installs reuse the wrong cache.
Reading the former code, one might hope that providing a changed URL would
have `svn up` change branches. It doesn't; the url was ignored.

Closes Homebrew/homebrew#7159.

Signed-off-by: default avatarMax Howell <max@methylblue.com>
parent 4743bc96
No related branches found
No related tags found
No related merge requests found
......@@ -195,7 +195,7 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
def initialize url, name, version, specs
super
@unique_token="#{name}--svn" unless name.to_s.empty? or name == '__UNKNOWN__'
@unique_token += "--HEAD" if ARGV.include? '--HEAD'
@unique_token += "-HEAD" if ARGV.include? '--HEAD'
@co=HOMEBREW_CACHE+@unique_token
end
......@@ -238,16 +238,14 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
end
end
def _fetch_command svncommand, url, target
[svn, svncommand, '--force', url, target]
end
def fetch_repo target, url, revision=nil, ignore_externals=false
# Use "svn up" when the repository already exists locally.
# This saves on bandwidth and will have a similar effect to verifying the
# cache as it will make any changes to get the right revision.
svncommand = target.exist? ? 'up' : 'checkout'
args = _fetch_command svncommand, url, target
args = [svn, svncommand, '--force']
args << url if !target.exist?
args << target
args << '-r' << revision if revision
args << '--ignore-externals' if ignore_externals
quiet_safe_system(*args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment