summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--tool/vcs.rb6
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e8c89dafac0..e37fe56fdc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Nov 25 15:26:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/vcs.rb (get_revisions): use Time.new instead of Time.mktime
+ which does not accept UTC offset, and offset manually for older
+ versions than 1.9.
+
Tue Nov 25 12:14:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (Init_process): initialize static IDs before constant
diff --git a/tool/vcs.rb b/tool/vcs.rb
index b3f3a316425..49c70648fde 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -62,7 +62,11 @@ class VCS
if modified
/\A(\d+)-(\d+)-(\d+)\D(\d+):(\d+):(\d+(?:\.\d+)?)\s*(?:Z|([-+]\d\d)(\d\d))\z/ =~ modified or
raise "unknown time format - #{modified}"
- modified = Time.mktime(*($~[1..6] + [$7 ? "#{$7}:#{$8}" : "+00:00"]))
+ begin
+ modified = Time.new(*$~[1..6].map(&:to_i), ($7 ? "#{$7}:#{$8}" : "+00:00"))
+ rescue ArgumentError
+ modified = Time.utc(*$~[1..6]) + $7.to_i * 3600 + $8.to_i * 60
+ end
end
return last, changed, modified, *rest
end