ruby-changes:55932
From: Nobuyoshi <ko1@a...>
Date: Fri, 31 May 2019 10:56:25 +0900 (JST)
Subject: [ruby-changes:55932] Nobuyoshi Nakada: fd658ec821 (trunk): Define RUBY_FULL_REVISION
https://git.ruby-lang.org/ruby.git/commit/?id=fd658ec821 From fd658ec821f07e0a2254fcd62ce29cc644d61302 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 31 May 2019 02:28:38 +0900 Subject: Define RUBY_FULL_REVISION Only if the short revision differs from the full revision. diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb index 24fbaeb..1e2a6fc 100755 --- a/tool/file2lastrev.rb +++ b/tool/file2lastrev.rb @@ -54,9 +54,10 @@ vcs = nil https://github.com/ruby/ruby/blob/trunk/tool/file2lastrev.rb#L54 } when :revision_h Proc.new {|last, changed, modified, branch, title| + short = vcs.short_revision(last) [ - "#define RUBY_REVISION #{vcs.short_revision(last).dump}", - "#define RUBY_FULL_REVISION #{last.dump}", + "#define RUBY_REVISION #{short.inspect}", + ("#define RUBY_FULL_REVISION #{last.inspect}" unless short == last), if branch e = '..' limit = 16 diff --git a/tool/make-snapshot b/tool/make-snapshot index 57eb195..3e90adb 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -291,7 +291,13 @@ def package(vcs, rev, destdir, tmp = nil) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L291 v = v[0] end - open("#{v}/revision.h", "wb") {|f| f.puts "#define RUBY_REVISION #{revision.dump}"} + open("#{v}/revision.h", "wb") {|f| + short = vcs.short_revision(revision) + f.puts "#define RUBY_REVISION #{short.inspect}" + unless short == revision + f.puts "#define RUBY_FULL_REVISION #{revision.inspect}" + end + } version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1] version ||= begin -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/