[前][次][番号順一覧][スレッド一覧]

ruby-changes:36883

From: naruse <ko1@a...>
Date: Wed, 24 Dec 2014 13:26:31 +0900 (JST)
Subject: [ruby-changes:36883] naruse:r48964 (trunk): * tool/redmine-backporter.rb: require view_changesets permission.

naruse	2014-12-24 13:26:18 +0900 (Wed, 24 Dec 2014)

  New Revision: 48964

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48964

  Log:
    * tool/redmine-backporter.rb: require view_changesets permission.

  Modified files:
    trunk/ChangeLog
    trunk/tool/redmine-backporter.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48963)
+++ ChangeLog	(revision 48964)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Dec 24 13:25:22 2014  NARUSE, Yui  <naruse@r...>
+
+	* tool/redmine-backporter.rb: require view_changesets permission.
+
 Wed Dec 24 13:00:24 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* tool/downloader.rb (Downloader.download): fix the exception to
Index: tool/redmine-backporter.rb
===================================================================
--- tool/redmine-backporter.rb	(revision 48963)
+++ tool/redmine-backporter.rb	(revision 48964)
@@ -261,6 +261,9 @@ while true https://github.com/ruby/ruby/blob/trunk/tool/redmine-backporter.rb#L261
     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 https://github.com/ruby/ruby/blob/trunk/tool/redmine-backporter.rb#L279
     #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"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]