summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-29 09:59:27 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-29 09:59:27 +0000
commitc782c791b23ad95b783697ffd52f8dcce5964931 (patch)
tree9d5a09fd26446daedb420b2ceb4b0cfd871d8e56 /tool
parent33a8940855d6f2533dbb77e83f3b1bba4b849d7c (diff)
* tool/redmine-backporter.rb (backport): show merger.rb's path.
* tool/redmine-backporter.rb (show): show current issue again if no ticket number is given. * tool/redmine-backporter.rb (rel): show error message if current bugs.ruby-lang.org doesn't support the API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/redmine-backporter.rb25
1 files changed, 20 insertions, 5 deletions
diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb
index aa9991155c..72046e2498 100755
--- a/tool/redmine-backporter.rb
+++ b/tool/redmine-backporter.rb
@@ -299,6 +299,10 @@ def show_last_journal(http, uri)
puts x["notes"]
end
+def merger_path
+ File.expand_path('../merger.rb', __FILE__)
+end
+
def backport_command_string
unless @changesets.respond_to?(:validated)
@changesets = @changesets.select do |c|
@@ -312,7 +316,7 @@ def backport_command_string
end
@changesets.define_singleton_method(:validated){true}
end
- " backport --ticket=#{@issue} #{@changesets.join(',')}"
+ " #{merger_path} --ticket=#{@issue} #{@changesets.join(',')}"
end
def status_char(obj)
@@ -348,10 +352,15 @@ commands = {
},
"show" => proc{|args|
- raise CommandSyntaxError unless /\A(\d+)\z/ =~ args
- id = $1.to_i
- id = @issues[id]["id"] if @issues && id < @issues.size
- @issue = id
+ if /\A(\d+)\z/ =~ args
+ id = $1.to_i
+ id = @issues[id]["id"] if @issues && id < @issues.size
+ @issue = id
+ elsif @issue
+ id = @issue
+ else
+ raise CommandSyntaxError
+ end
uri = "#{REDMINE_BASE}/issues/#{id}"
uri = URI(uri+".json?include=children,attachments,relations,changesets,journals")
res = JSON(uri.read($openuri_options))
@@ -407,6 +416,12 @@ eom
Net::HTTP.start(uri.host, uri.port, http_options) do |http|
res = http.post(uri.path, "issue_id=#@issue",
'X-Redmine-API-Key' => REDMINE_API_KEY)
+ begin
+ res.value
+ rescue
+ $stderr.puts "deployed redmine doesn't have https://github.com/ruby/bugs.ruby-lang.org/commit/01fbba60d68cb916ddbccc8a8710e68c5217171d\nask naruse or hsbt"
+ return
+ end
puts res.body
class << @changesets
remove_method(:validated) rescue nil