summaryrefslogtreecommitdiff
path: root/tool/vcs.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-14 08:25:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-14 08:25:56 +0000
commit72c1b322c7ff86c4ddc6370cb6e405032ff21545 (patch)
treeaa3b1041d4c425e15739ec6ddffaf7a2e92bc42e /tool/vcs.rb
parent1407e52ba4915ed7f251dec548b5e68f2a5a6a6e (diff)
vcs.rb: no ext/date in vcs.rb
* tool/vcs.rb (VCS::GIT#export_changelog): do not require date extension library so that miniruby can run. [ruby-core:78641] [Bug #13032] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/vcs.rb')
-rw-r--r--tool/vcs.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 95cb0da7a6..7d1ecd4a88 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -1,6 +1,5 @@
# vcs
require 'fileutils'
-require 'time'
# This library is used by several other tools/ scripts to detect the current
# VCS in use (e.g. SVN, Git) or to interact with that VCS.
@@ -446,7 +445,9 @@ class VCS
s.sub!(/^git-svn-id: .*@(\d+) .*\n+\z/, '')
rev = $1
s.gsub!(/^ {8}/, '') if /^(?! {8}|$)/ !~ s
- date = Time.strptime(time, "%Y-%m-%d %T %z").strftime("%a, %d %b %y")
+ if /\A(\d+)-(\d+)-(\d+)/ =~ time
+ date = Time.new($1.to_i, $2.to_i, $3.to_i).strftime("%a, %d %b %Y")
+ end
w.puts "r#{rev} | #{author} | #{time} (#{date}) | #{s.count("\n")} lines\n\n"
w.puts s, sep
end