summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
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