summaryrefslogtreecommitdiff
path: root/tool/redmine-backporter.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-23 13:04:06 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-23 13:04:06 +0000
commit429537310ea0d2caaad591b6295f52655bb4831e (patch)
treeaa7f47a4e045bdb55744a75d53f42a6681ea2fad /tool/redmine-backporter.rb
parentb9ffe579da5094dae64d82120b9533bb5d03e1eb (diff)
avoid a bug of the latest redmine
even if call ?include=changesets, latest redmine doesn't return changesets. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/redmine-backporter.rb')
-rwxr-xr-xtool/redmine-backporter.rb28
1 files changed, 16 insertions, 12 deletions
diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb
index 5d4b235..c09fa18 100755
--- a/tool/redmine-backporter.rb
+++ b/tool/redmine-backporter.rb
@@ -276,20 +276,24 @@ eom
#end
sio.puts i["description"]
sio.puts
- sio.puts "= changesets"
- @changesets = []
- i["changesets"].each do |x|
- @changesets << x["revision"]
- sio.puts "== #{x["revision"]} #{x["committed_on"]} #{x["user"]["name"] rescue nil}"
- sio.puts x["comments"]
+ if i["changesets"]
+ sio.puts "= changesets"
+ @changesets = []
+ i["changesets"].each do |x|
+ @changesets << x["revision"]
+ sio.puts "== #{x["revision"]} #{x["committed_on"]} #{x["user"]["name"] rescue nil}"
+ sio.puts x["comments"]
+ end
end
- sio.puts "= journals"
- i["journals"].each do |x|
- sio.puts "== #{x["user"]["name"]} (#{x["created_on"]})"
- x["details"].each do |y|
- sio.puts JSON(y)
+ if i["journals"] && !i["journals"].empty?
+ sio.puts "= journals"
+ i["journals"].each do |x|
+ sio.puts "== #{x["user"]["name"]} (#{x["created_on"]})"
+ x["details"].each do |y|
+ sio.puts JSON(y)
+ end
+ sio.puts x["notes"]
end
- sio.puts x["notes"]
end
more(sio)