diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-22 13:43:16 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-22 13:43:16 +0000 |
commit | 7322a22816eb2f6c49cab8dd94c1b732a353bc62 (patch) | |
tree | 72af74418687697c865368316eed34bd14799014 /tool/redmine-backporter.rb | |
parent | 7662937cabfde446cef08d7ef2fd4563681f739f (diff) | |
download | ruby-7322a22816eb2f6c49cab8dd94c1b732a353bc62.tar.gz |
add backport commit detection
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/redmine-backporter.rb')
-rwxr-xr-x | tool/redmine-backporter.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb index 32ffec85ee..e60c57b438 100755 --- a/tool/redmine-backporter.rb +++ b/tool/redmine-backporter.rb @@ -199,6 +199,10 @@ def mergeinfo `svn propget svn:mergeinfo #{RUBY_REPO_PATH}` end +def find_svn_log(pattern) + `svn log --xml --stop-on-copy --search='#{pattern}' #{RUBY_REPO_PATH}` +end + def show_last_journal(http, uri) res = http.get("#{uri.path}?include=journals") res.value @@ -216,7 +220,7 @@ def show_last_journal(http, uri) end def backport_command_string - "backport --ticket=#{@issue} #{@changesets.join(',')}" + " backport --ticket=#{@issue} #{@changesets.join(',')}" end console = IO.console @@ -298,6 +302,7 @@ eom when /\Adone(?: +(\d+))?(?: -- +(.*))?\z/ notes = $2 + notes.strip! if notes if $1 i = $1.to_i i = @issues[i]["id"] if @issues && i < @issues.size @@ -308,6 +313,23 @@ eom next end + log = find_svn_log("##@issue]") + if log + rev = log[/revision="(\d+)/, 1] + str = log[/merge revision\(s\) ([^:]+)(?=:)/] + str.insert(5, "d") + str = "ruby_#{TARGET_VERSION.tr('.','_')} r#{rev} #{str}." + if notes + str << "\n" + str << notes + end + notes = str + else + puts "no commit is found whose log include ##@issue" + next + end + puts notes + uri = URI("#{REDMINE_BASE}/issues/#{@issue}.json") Net::HTTP.start(uri.host, uri.port, http_options) do |http| res = http.get(uri.path) |