mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
33a8940855
commit
c782c791b2
2 changed files with 35 additions and 5 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
||||||
|
Tue Mar 29 18:56:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
Tue Mar 29 18:54:34 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* tool/merger.rb: support to backport header as backport identifier.
|
||||||
|
Now you can specify by 'merge revision(s) 49254: [Backport #10738]'.
|
||||||
|
|
||||||
Tue Mar 29 16:53:44 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
Tue Mar 29 16:53:44 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
* enc/unicode/case-folding.rb, casefold.h: Tweaked handling of 6
|
* enc/unicode/case-folding.rb, casefold.h: Tweaked handling of 6
|
||||||
|
|
|
@ -299,6 +299,10 @@ def show_last_journal(http, uri)
|
||||||
puts x["notes"]
|
puts x["notes"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def merger_path
|
||||||
|
File.expand_path('../merger.rb', __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
def backport_command_string
|
def backport_command_string
|
||||||
unless @changesets.respond_to?(:validated)
|
unless @changesets.respond_to?(:validated)
|
||||||
@changesets = @changesets.select do |c|
|
@changesets = @changesets.select do |c|
|
||||||
|
@ -312,7 +316,7 @@ def backport_command_string
|
||||||
end
|
end
|
||||||
@changesets.define_singleton_method(:validated){true}
|
@changesets.define_singleton_method(:validated){true}
|
||||||
end
|
end
|
||||||
" backport --ticket=#{@issue} #{@changesets.join(',')}"
|
" #{merger_path} --ticket=#{@issue} #{@changesets.join(',')}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def status_char(obj)
|
def status_char(obj)
|
||||||
|
@ -348,10 +352,15 @@ commands = {
|
||||||
},
|
},
|
||||||
|
|
||||||
"show" => proc{|args|
|
"show" => proc{|args|
|
||||||
raise CommandSyntaxError unless /\A(\d+)\z/ =~ args
|
if /\A(\d+)\z/ =~ args
|
||||||
id = $1.to_i
|
id = $1.to_i
|
||||||
id = @issues[id]["id"] if @issues && id < @issues.size
|
id = @issues[id]["id"] if @issues && id < @issues.size
|
||||||
@issue = id
|
@issue = id
|
||||||
|
elsif @issue
|
||||||
|
id = @issue
|
||||||
|
else
|
||||||
|
raise CommandSyntaxError
|
||||||
|
end
|
||||||
uri = "#{REDMINE_BASE}/issues/#{id}"
|
uri = "#{REDMINE_BASE}/issues/#{id}"
|
||||||
uri = URI(uri+".json?include=children,attachments,relations,changesets,journals")
|
uri = URI(uri+".json?include=children,attachments,relations,changesets,journals")
|
||||||
res = JSON(uri.read($openuri_options))
|
res = JSON(uri.read($openuri_options))
|
||||||
|
@ -407,6 +416,12 @@ eom
|
||||||
Net::HTTP.start(uri.host, uri.port, http_options) do |http|
|
Net::HTTP.start(uri.host, uri.port, http_options) do |http|
|
||||||
res = http.post(uri.path, "issue_id=#@issue",
|
res = http.post(uri.path, "issue_id=#@issue",
|
||||||
'X-Redmine-API-Key' => REDMINE_API_KEY)
|
'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
|
puts res.body
|
||||||
class << @changesets
|
class << @changesets
|
||||||
remove_method(:validated) rescue nil
|
remove_method(:validated) rescue nil
|
||||||
|
|
Loading…
Reference in a new issue