diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2021-02-02 19:15:45 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2021-02-02 19:15:45 +0900 |
commit | f92b7b7b97d57ad3f58034556224141d2f0e65c7 (patch) | |
tree | 84aa30ad3bf1a9dbce4c7b34906861162204f594 | |
parent | d29cb56bfa40f8c077518623b63bb26988fbe60e (diff) |
Pass revision by hand if the commit message lacks the ticket number
-rwxr-xr-x | tool/redmine-backporter.rb | 12 |
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 |