summaryrefslogtreecommitdiff
path: root/tool/redmine-backporter.rb
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2021-02-02 19:15:45 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-02-02 19:15:45 +0900
commitf92b7b7b97d57ad3f58034556224141d2f0e65c7 (patch)
tree84aa30ad3bf1a9dbce4c7b34906861162204f594 /tool/redmine-backporter.rb
parentd29cb56bfa40f8c077518623b63bb26988fbe60e (diff)
downloadruby-f92b7b7b97d57ad3f58034556224141d2f0e65c7.tar.gz
Pass revision by hand if the commit message lacks the ticket number
Diffstat (limited to 'tool/redmine-backporter.rb')
-rwxr-xr-xtool/redmine-backporter.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb
index 06c37ab811..df54c7eb26 100755
--- a/tool/redmine-backporter.rb
+++ b/tool/redmine-backporter.rb
@@ -422,9 +422,10 @@ eom
},
"done" => proc{|args|
- raise CommandSyntaxError unless /\A(\d+)?(?:\s*-- +(.*))?\z/ =~ args
- notes = $2
+ raise CommandSyntaxError unless /\A(\d+)?(?: by (\h+))?(?:\s*-- +(.*))?\z/ =~ args
+ notes = $3
notes.strip! if notes
+ rev = $2
if $1
i = $1.to_i
i = @issues[i]["id"] if @issues && i < @issues.size
@@ -435,7 +436,8 @@ eom
next
end
- if system("svn info #{RUBY_REPO_PATH&.shellescape}", %i(out err) => IO::NULL) # SVN
+ if rev
+ elsif system("svn info #{RUBY_REPO_PATH&.shellescape}", %i(out err) => IO::NULL) # SVN
if (log = find_svn_log("##@issue]")) && (/revision="(?<rev>\d+)/ =~ log)
rev = "r#{rev}"
end
@@ -457,6 +459,10 @@ eom
str << notes
end
notes = str
+ elsif rev && has_commit(rev, "ruby_#{TARGET_VERSION.tr('.','_')}")
+ # Backport commit's log doesn't have the issue number.
+ # Instead of that manually it's provided.
+ notes = "ruby_#{TARGET_VERSION.tr('.','_')} commit:#{rev}."
else
puts "no commit is found whose log include ##@issue"
next