Pass revision by hand if the commit message lacks the ticket number

This commit is contained in:
NARUSE, Yui 2021-02-02 19:15:45 +09:00
Родитель d29cb56bfa
Коммит f92b7b7b97
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -422,9 +422,10 @@ eom
}, },
"done" => proc{|args| "done" => proc{|args|
raise CommandSyntaxError unless /\A(\d+)?(?:\s*-- +(.*))?\z/ =~ args raise CommandSyntaxError unless /\A(\d+)?(?: by (\h+))?(?:\s*-- +(.*))?\z/ =~ args
notes = $2 notes = $3
notes.strip! if notes notes.strip! if notes
rev = $2
if $1 if $1
i = $1.to_i i = $1.to_i
i = @issues[i]["id"] if @issues && i < @issues.size i = @issues[i]["id"] if @issues && i < @issues.size
@ -435,7 +436,8 @@ eom
next next
end 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) if (log = find_svn_log("##@issue]")) && (/revision="(?<rev>\d+)/ =~ log)
rev = "r#{rev}" rev = "r#{rev}"
end end
@ -457,6 +459,10 @@ eom
str << notes str << notes
end end
notes = str 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 else
puts "no commit is found whose log include ##@issue" puts "no commit is found whose log include ##@issue"
next next