aboutsummaryrefslogtreecommitdiffstats
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
commitc951868a96e532b5b6daaa52a993b96221965309 (patch)
treeaa3b1041d4c425e15739ec6ddffaf7a2e92bc42e
parent61ace38372f099805a71da9c1352101df5917ba5 (diff)
downloadruby-c951868a96e532b5b6daaa52a993b96221965309.tar.gz
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
-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