ruby-changes:49153
From: usa <ko1@a...>
Date: Fri, 15 Dec 2017 12:22:55 +0900 (JST)
Subject: [ruby-changes:49153] usa:r61269 (trunk): add `removetag` command
usa 2017-12-15 12:22:51 +0900 (Fri, 15 Dec 2017) New Revision: 61269 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61269 Log: add `removetag` command * tool/merger.rb (remove_tag): add `removetag` command. Modified files: trunk/tool/merger.rb Index: tool/merger.rb =================================================================== --- tool/merger.rb (revision 61268) +++ tool/merger.rb (revision 61269) @@ -38,6 +38,9 @@ def help https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L38 \e[1mtagging preview/RC\e[0m ruby #$0 tag 2.2.0-preview1 +\e[1mremove tag\e[0m + ruby #$0 removetag 2.2.9 + \e[33;1m* all operations shall be applied to the working directory.\e[0m end end @@ -148,6 +151,7 @@ def tag intv_p = false, relname=nil https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L151 end if intv_p interactive "OK? svn cp -m \"add tag #{tagname}\" #{branch_url} #{tag_url}" do + # nothing to do here end end system(*%w'svn cp -m', "add tag #{tagname}", branch_url, tag_url) @@ -155,6 +159,33 @@ def tag intv_p = false, relname=nil https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L159 puts "git tag #{tagname} origin/tags/#{tagname} && git push ruby #{tagname}" end +def remove_tag intv_p = false, relname + # relname: + # * 2.2.0-preview1 + # * 2.2.0-rc1 + # * 2.2.0 + # * v2_2_0_preview1 + # * v2_2_0_rc1 + # * v2_2_0 + if !relname && !intv_p.is_a?(String) + 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(".-", "_") + else + tagname = relname + end + tag_url = $repos + 'tags/' + tagname + if intv_p + interactive "OK? svn rm -m \"remove tag #{tagname}\" #{tag_url}" do + # nothing to do here + end + end + system(*%w'svn rm -m', "remove tag #{tagname}", tag_url) +end + def default_merge_branch %r{^URL: .*/branches/ruby_1_8_} =~ `svn info` ? 'branches/ruby_1_8' : 'trunk' end @@ -168,6 +199,8 @@ when "up", /\A(ver|version|rev|revision| https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L199 system 'svn diff version.h' when "tag" tag :interactive, ARGV[1] +when "removetag" + remove_tag :interactive, ARGV[1] when nil, "-h", "--help" help exit -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/