diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index ce10da52adf900c7e7e9d40b6a6b133b7d840ae4..5b3b4773d02e8998b42494c16c37e06a1cd89c4a 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -89,7 +89,16 @@ module Homebrew
     elsif !hash_type
       odie "#{formula}: no tag/revision specified!"
     else
-      odie "#{formula}: no url/#{hash_type} specified!"
+      rsrc = Resource.new { @url = new_url }
+      rsrc.download_strategy = CurlDownloadStrategy
+      rsrc.owner = Resource.new(formula.name)
+      rsrc_path = rsrc.fetch
+      if Utils.popen_read("/usr/bin/tar", "-tf", rsrc_path) =~ /\/.*\./
+        new_hash = rsrc_path.sha256
+      else
+        odie "#{formula}: no url/#{hash_type} specified!" if new_url.include?(".tar")
+        new_hash = rsrc_path.sha256
+      end
     end
 
     if ARGV.dry_run?