1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Support tool/merger.rb removetag under Git

repository.
This commit is contained in:
Takashi Kokubun 2019-04-29 00:53:06 +09:00
parent bbad0d05b3
commit 2dddd370a1
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -151,7 +151,7 @@ module Merger
end
end
def remove_tag intv_p = false, relname
def remove_tag(relname)
# relname:
# * 2.2.0-preview1
# * 2.2.0-rc1
@ -159,24 +159,23 @@ def remove_tag intv_p = false, relname
# * v2_2_0_preview1
# * v2_2_0_rc1
# * v2_2_0
if !relname && !intv_p.is_a?(String)
raise ArgumentError, "relname is not specified"
unless relname
raise ArgumentError, 'relname is not specified'
end
intv_p, relname = false, intv_p if !relname && intv_p.is_a?(String)
if /^v/ !~ relname
tagname = 'v' + relname.tr(".-", "_")
tagname = "v#{relname.gsub(/[.-]/, '_')}"
else
tagname = relname
end
if svn_mode?
tag_url = "#{REPOS}tags/#{tagname}"
if intv_p
interactive "OK? svn rm -m \"remove tag #{tagname}\" #{tag_url}" do
# nothing to do here
execute('svn', 'rm', '-m', "remove tag #{tagname}", tag_url, interactive: true)
else
execute('git', 'tag', '-d', tagname)
execute('git', 'push', 'origin', ":#{tagname}", interactive: true)
end
end
system(*%w'svn rm -m', "remove tag #{tagname}", tag_url)
end
def diff(file)
if svn_mode?
@ -243,7 +242,7 @@ when "up", /\A(ver|version|rev|revision|lv|level|patch\s*level)\s*up\z/
when "tag"
Merger.tag(ARGV[1])
when /\A(?:remove|rm|del)_?tag\z/
Merger.remove_tag :interactive, ARGV[1]
Merger.remove_tag(ARGV[1])
when nil, "-h", "--help"
Merger.help
exit