mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
VCS#revision_header: Make arguments optional
This commit is contained in:
parent
f67ab7f30c
commit
462a8be511
3 changed files with 5 additions and 5 deletions
|
@ -76,7 +76,7 @@ exit unless vcs
|
|||
}
|
||||
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|
|
||||
|
|
|
@ -204,7 +204,7 @@ class VCS
|
|||
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
|
|||
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
|
||||
|
|
|
@ -309,7 +309,7 @@ def package(vcs, rev, destdir, tmp = nil)
|
|||
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)
|
|||
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 ||=
|
||||
|
|
Loading…
Reference in a new issue