diff options
author | Stefan Huber <MSNexploder@gmail.com> | 2014-04-27 16:33:33 +0200 |
---|---|---|
committer | Stefan Huber <MSNexploder@gmail.com> | 2014-04-27 16:33:33 +0200 |
commit | 38f195e11f37ce5139af4ff3384eb2f26c2edb19 (patch) | |
tree | f282b06b60c84a2e2eb5e559b09dfbc25e9225f3 | |
parent | 500436a33de0b884525dbf82cfc69332fc96f8b9 (diff) | |
download | bundler-38f195e11f37ce5139af4ff3384eb2f26c2edb19.tar.gz |
local override for svn only makes sense without a specific revision
-rw-r--r-- | lib/bundler/source/svn.rb | 17 | ||||
-rw-r--r-- | lib/bundler/source/svn/svn_proxy.rb | 4 |
2 files changed, 7 insertions, 14 deletions
diff --git a/lib/bundler/source/svn.rb b/lib/bundler/source/svn.rb index 58e9ab98..0a3b9872 100644 --- a/lib/bundler/source/svn.rb +++ b/lib/bundler/source/svn.rb @@ -98,6 +98,12 @@ module Bundler 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" @@ -108,16 +114,7 @@ module Bundler # 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 diff --git a/lib/bundler/source/svn/svn_proxy.rb b/lib/bundler/source/svn/svn_proxy.rb index bc992e52..c67a9372 100644 --- a/lib/bundler/source/svn/svn_proxy.rb +++ b/lib/bundler/source/svn/svn_proxy.rb @@ -47,10 +47,6 @@ module Bundler @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}" |