=== modified file 'vendor/gems/capistrano-1.99.1/lib/capistrano/configuration/connections.rb'
--- vendor/gems/capistrano-1.99.1/lib/capistrano/configuration/connections.rb	2007-05-25 15:53:54 +0000
+++ vendor/gems/capistrano-1.99.1/lib/capistrano/configuration/connections.rb	2007-06-04 19:48:49 +0000
@@ -82,11 +82,13 @@
         if task = current_task
           servers = find_servers_for_task(task, options)
 
-          if servers.empty?
+          if servers.empty? 
+            return if task.options[:best_efforts]
             raise ScriptError, "`#{task.fully_qualified_name}' is only run for servers matching #{task.options.inspect}, but no servers matched"
           end
         else
           servers = find_servers(options)
+          
           raise ScriptError, "no servers found to match #{options.inspect}" if servers.empty?
         end
 
@@ -108,4 +110,4 @@
         end
     end
   end
-end
\ No newline at end of file
+end

=== modified file 'vendor/gems/capistrano-1.99.1/test/configuration/connections_test.rb'
--- vendor/gems/capistrano-1.99.1/test/configuration/connections_test.rb	2007-05-25 15:53:54 +0000
+++ vendor/gems/capistrano-1.99.1/test/configuration/connections_test.rb	2007-06-04 19:42:47 +0000
@@ -111,7 +111,7 @@
     assert_raises(ScriptError) { @config.execute_on_servers(:a => :b, :c => :d) { |list| } }
   end
 
-  def test_execute_on_servers_should_raise_an_error_if_the_current_task_has_no_matching_servers
+  def test_execute_on_servers_should_raise_an_error_if_the_current_task_has_no_matching_servers_by_default
     @config.current_task = stub("task", :fully_qualified_name => "name", :options => {})
     @config.expects(:find_servers_for_task).with(@config.current_task, {}).returns([])
     assert_raises(ScriptError) do
@@ -121,6 +121,16 @@
     end
   end
 
+  def test_execute_on_servers_should_not_raise_an_error_if_the_current_task_has_no_matching_servers_but_is_marked_best_efforts
+    @config.current_task = stub("task", :fully_qualified_name => "name", :options => { :best_efforts => true })
+    @config.expects(:find_servers_for_task).with(@config.current_task, {}).returns([])
+    assert_nothing_raised do
+      @config.execute_on_servers do
+        flunk "should not get here"
+      end
+    end
+  end
+
   def test_execute_on_servers_should_determine_server_list_from_active_task
     assert @config.sessions.empty?
     @config.current_task = stub("task")
@@ -177,4 +187,4 @@
     @config.connect! :once => true
     assert_equal %w(cap1), @config.sessions.keys.sort.map { |s| s.host }
   end
-end
\ No newline at end of file
+end

