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

ruby-changes:73361

From: Nobuyoshi <ko1@a...>
Date: Thu, 1 Sep 2022 20:58:35 +0900 (JST)
Subject: [ruby-changes:73361] 462a8be511 (master): VCS#revision_header: Make arguments optional

https://git.ruby-lang.org/ruby.git/commit/?id=462a8be511

From 462a8be5112f8c4e621d106304ac617ebcf39eb0 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 1 Sep 2022 19:54:46 +0900
Subject: VCS#revision_header: Make arguments optional

---
 tool/file2lastrev.rb | 2 +-
 tool/lib/vcs.rb      | 4 ++--
 tool/make-snapshot   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb
index ba65db0f96..008e4b55e5 100755
--- a/tool/file2lastrev.rb
+++ b/tool/file2lastrev.rb
@@ -76,7 +76,7 @@ exit unless vcs https://github.com/ruby/ruby/blob/trunk/tool/file2lastrev.rb#L76
     }
   when :revision_h
     Proc.new {|last, changed, modified, branch, title|
-      vcs.revision_header(last, changed, modified, branch, title, limit: @limit)
+      vcs.revision_header(last, modified, branch, title, limit: @limit)
     }
   when :doxygen
     Proc.new {|last, changed|
diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb
index db3a6f436f..65ab3d4eec 100644
--- a/tool/lib/vcs.rb
+++ b/tool/lib/vcs.rb
@@ -204,7 +204,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L204
     revision_handler(rev).short_revision(rev)
   end
 
-  def revision_header(last, changed, modified, branch, title, limit: 20, time: true)
+  def revision_header(last, modified = nil, branch = nil, title = nil, limit: 20)
     short = short_revision(last)
     if /[^\x00-\x7f]/ =~ title and title.respond_to?(:force_encoding)
       title = title.dup.force_encoding("US-ASCII")
@@ -225,7 +225,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L225
       title = title.dump.sub(/\\#/, '#')
       code << "#define RUBY_LAST_COMMIT_TITLE #{title}"
     end
-    if modified and time
+    if modified
       t = modified.utc
       code << t.strftime('#define RUBY_RELEASE_DATETIME "%FT%TZ"')
     end
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 2c15a52dbb..5d0ec7a3fb 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -309,7 +309,7 @@ def package(vcs, rev, destdir, tmp = nil) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L309
       warn "#{$0}: #{rev} not found"
       return
     end
-    revision = (info = vcs.get_revisions(url))[1]
+    revision = vcs.get_revisions(url)[1]
   end
 
   v = "ruby"
@@ -346,7 +346,7 @@ def package(vcs, rev, destdir, tmp = nil) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L346
   end
 
   File.open("#{v}/revision.h", "wb") {|f|
-    f.puts vcs.revision_header(*info, time: false)
+    f.puts vcs.revision_header(revision)
   }
   version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1]
   version ||=
-- 
cgit v1.2.1


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

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