Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
local override for svn only makes sense without a specific revision
Browse files Browse the repository at this point in the history
  • Loading branch information
MSNexploder committed Apr 27, 2014
1 parent 500436a commit 38f195e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
17 changes: 7 additions & 10 deletions lib/bundler/source/svn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ def local_override!(path)
path = Pathname.new(path)
path = path.expand_path(Bundler.root) unless path.relative?

if options["ref"]
raise SVNError, "Cannot use local override for #{name} at #{path} because " \
":ref is specified in Gemfile. Don't specify a revision or use " \
"`bundle config --delete` to remove the local override"
end

unless path.exist?
raise SVNError, "Cannot use local override for #{name} because #{path} " \
"does not exist. Check `bundle config --delete` to remove the local override"
Expand All @@ -108,16 +114,7 @@ def local_override!(path)
# Create a new svn proxy without the cached revision
# so the Gemfile.lock always picks up the new revision.
@svn_proxy = SVNProxy.new(path, uri, ref)

changed = cached_revision && cached_revision != svn_proxy.revision

if changed && !@unlocked && !svn_proxy.contains?(cached_revision)
raise SVNError, "The Gemfile lock is pointing to revision #{cached_revision} " \
"but the current branch in your local override for #{name} does not contain such commit. " \
"Please make sure your local copy is up to date."
end

changed
true
end

# TODO: actually cache svn specs
Expand Down
4 changes: 0 additions & 4 deletions lib/bundler/source/svn/svn_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ def revision
@revision ||= svn("info --revision #{ref} #{uri_escaped} | grep \"Revision\" | awk '{print $2}'").strip
end

def contains?(commit)
revision >= commit
end

def checkout
if path.exist?
Bundler.ui.confirm "Updating #{uri}"
Expand Down

0 comments on commit 38f195e

Please sign in to comment.