public
Description: Piston is a utility that eases vendor branch management. This repository is a complete reimplementation of Piston to provide different backends, depending on the repositories and working copies you pistonize from.
Homepage: http://piston.rubyforge.org/
Clone URL: git://github.com/francois/piston.git
Search Repo:
Added nice error message for when can't guess the type of a repository.
Sat Apr 19 14:50:02 -0700 2008
commit  ba77f51f2c8ac783fe93227ef66bd08e52552bcc
tree    33e23017a279bbd8cd69cd91abfb407587c8fdb1
parent  54a0436ca6787bb99a5950c9587f3ad4a6654f5e
...
86
87
88
89
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
92
93
...
86
87
88
 
 
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
0
@@ -86,8 +86,21 @@ Main {
0
                                          :force => params["force"].value,
0
                                          :dry_run => params["dry-run"].value,
0
                                          :repository_type => params["repository-type"].value)
0
-
0
- cmd.run(params[:repository].value, self.target_revision, params[:directory].value)
0
+
0
+ begin
0
+ cmd.run(params[:repository].value, self.target_revision, params[:directory].value)
0
+ rescue Piston::Repository::UnhandledUrl => e
0
+ supported_types = Piston::Repository.handlers.collect do |handler|
0
+ handler.repository_type
0
+ end
0
+ puts "Unsure how to handle:"
0
+ puts "\t#{params[:repository].value.inspect}."
0
+ puts "You should try using --repository-type. Supported types are:"
0
+ supported_types.each do |type|
0
+ puts "\t#{type}"
0
+ end
0
+ exit_failure!
0
+ end
0
     end
0
   end
0
 
...
16
17
18
19
20
21
22
23
24
25
26
 
 
 
27
28
29
...
35
36
37
38
39
40
41
...
16
17
18
 
 
 
 
 
 
 
 
19
20
21
22
23
24
...
30
31
32
 
33
34
35
0
@@ -16,14 +16,9 @@ module Piston
0
           logger.debug {"Asking #{handler}"}
0
           handler.understands_url?(url)
0
         end
0
-
0
- if handler.nil?
0
- supported_types = handlers.collect do |handler|
0
- handler.repository_type
0
- end
0
- message = "No internal handlers found for #{url.inspect}. You should check out --repository-type. Supported types are: #{supported_types.join(', ')}"
0
- raise UnhandledUrl, message
0
- end
0
+
0
+ raise UnhandledUrl unless handler
0
+
0
         handler.new(url)
0
       end
0
 
0
@@ -35,7 +30,6 @@ module Piston
0
       def handlers
0
         @@handlers
0
       end
0
- private :handlers
0
     end
0
 
0
     attr_reader :url

Comments

    No one has commented yet.