summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rwxr-xr-xtool/redmine-backporter.rb17
2 files changed, 13 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index afc8afbe76..5c51626f55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Dec 24 13:25:22 2014 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/redmine-backporter.rb: require view_changesets permission.
+
Wed Dec 24 13:00:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* tool/downloader.rb (Downloader.download): fix the exception to
diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb
index c09fa186a7..121aa3e718 100755
--- a/tool/redmine-backporter.rb
+++ b/tool/redmine-backporter.rb
@@ -261,6 +261,9 @@ while true
uri = URI(uri+".json?include=children,attachments,relations,changesets,journals")
res = JSON(uri.read(openuri_options))
i = res["issue"]
+ unless i["changesets"]
+ abort "You don't have view_changesets permission"
+ end
id = "##{i["id"]}".color(*PRIORITIES[i["priority"]["name"]])
sio = StringIO.new
sio.puts <<eom
@@ -276,14 +279,12 @@ eom
#end
sio.puts i["description"]
sio.puts
- 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
+ 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
if i["journals"] && !i["journals"].empty?
sio.puts "= journals"