summaryrefslogtreecommitdiff
path: root/tool/redmine-backporter.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-16 09:48:57 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-16 09:48:57 +0000
commit84a41254717edd0e37c0f9b4e56358737013ed85 (patch)
tree2e3b759a29560da1b9ee1a552dedd9ab96d374c5 /tool/redmine-backporter.rb
parentc7124d811fbfcbc02a7d1e5cf0d79cb62de73016 (diff)
* tool/redmine-backporter.rb: support adding related revisions
to issues. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/redmine-backporter.rb')
-rwxr-xr-xtool/redmine-backporter.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb
index b3e8ea5..918584a 100755
--- a/tool/redmine-backporter.rb
+++ b/tool/redmine-backporter.rb
@@ -298,7 +298,18 @@ eom
end
more(sio)
+ when /\Arel +(\d+)\z/
+ # this feature requires custom redmine which allows add_related_issue API
+ rev = $1.to_i
+ uri = URI("#{REDMINE_BASE}/projects/ruby-trunk/repository/revisions/#{rev}/issues.json")
+ 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)
+ puts res.body
+ end
+
when 's'
+ # this feature implies backport command which wraps tool/merger.rb
unless @issue
puts "ticket not selected"
next