[前][次][番号順一覧][スレッド一覧]

ruby-changes:37745

From: naruse <ko1@a...>
Date: Tue, 3 Mar 2015 17:56:04 +0900 (JST)
Subject: [ruby-changes:37745] naruse:r49826 (trunk): add teenyup

naruse	2015-03-03 17:55:52 +0900 (Tue, 03 Mar 2015)

  New Revision: 49826

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49826

  Log:
    add teenyup

  Modified files:
    trunk/tool/merger.rb
Index: tool/merger.rb
===================================================================
--- tool/merger.rb	(revision 49825)
+++ tool/merger.rb	(revision 49826)
@@ -5,7 +5,6 @@ exec "${RUBY-ruby}" "-x" "$0" "$@" && [ https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L5
 # This needs ruby 1.9 and subversion.
 # run this in a repository to commit.
 
-require 'date'
 require 'tempfile'
 
 $repos = 'svn+ssh://svn@c.../ruby/'
@@ -25,6 +24,9 @@ def help https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L24
 \e[1mrevision increment\e[0m
   ruby #$0 revisionup
 
+\e[1mteeny increment\e[0m
+  ruby #$0 teenyup
+
 \e[1mtagging major release\e[0m
   ruby #$0 tag 2.2.0
 
@@ -67,11 +69,19 @@ def interactive str, editfile = nil https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L69
   end
 end
 
-def version_up
-  d = DateTime.now
-  d = d.new_offset(Rational(9,24)) # we need server locale (i.e. japanese) time
+def version_up(inc=nil)
+  d = Time.now
+  d = d.localtime(9*60*60) # server is Japan Standard Time +09:00
   system(*%w'svn revert version.h')
-  v, p = version
+  v, pl = version
+
+  if inc == :teeny
+    v[2].succ!
+  else # patchlevel
+    if pl != "-1"
+      pl.succ!
+    end
+  end
 
   teeny = v[2]
   case v
@@ -79,11 +89,6 @@ def version_up https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L89
     teeny = 1
   end
 
-  p = p.to_i
-  if p != -1
-    p += 1
-  end
-
   str = open 'version.h', 'rb' do |f| f.read end
   [%W[RUBY_VERSION      "#{v.join '.'}"],
    %W[RUBY_VERSION_CODE  #{v.join ''}],
@@ -92,7 +97,7 @@ def version_up https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L97
    %W[RUBY_VERSION_TEENY #{teeny}],
    %W[RUBY_RELEASE_DATE "#{d.strftime '%Y-%m-%d'}"],
    %W[RUBY_RELEASE_CODE  #{d.strftime '%Y%m%d'}],
-   %W[RUBY_PATCHLEVEL    #{p}],
+   %W[RUBY_PATCHLEVEL    #{pl}],
    %W[RUBY_RELEASE_YEAR  #{d.year}],
    %W[RUBY_RELEASE_MONTH #{d.month}],
    %W[RUBY_RELEASE_DAY   #{d.day}],
@@ -151,6 +156,9 @@ def default_merge_branch https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L156
 end
 
 case ARGV[0]
+when "teenyup"
+  version_up(:teeny)
+  system 'svn diff version.h'
 when "up", /\A(ver|version|rev|revision|lv|level|patch\s*level)\s*up/
   version_up
   system 'svn diff version.h'

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]