mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added VCS::SVN#branch_beginning
This commit is contained in:
parent
b766970527
commit
d72bd190a8
2 changed files with 11 additions and 2 deletions
|
@ -339,7 +339,7 @@ def package(vcs, rev, destdir, tmp = nil)
|
|||
Dir.chdir(v) do
|
||||
unless File.exist?("ChangeLog")
|
||||
# get the beginning revision from matz's commit
|
||||
unless beginning = vcs.branch_beginning
|
||||
unless beginning = vcs.branch_beginning(url)
|
||||
abort "#{File.basename $0}: Cannot find revision from '#{last_ChangeLog}'"
|
||||
end
|
||||
vcs.export_changelog(url, beginning, revision, "ChangeLog")
|
||||
|
|
11
tool/vcs.rb
11
tool/vcs.rb
|
@ -345,6 +345,15 @@ class VCS
|
|||
FileUtils.rm_rf(dir+"/.svn")
|
||||
end
|
||||
|
||||
def branch_beginning(url)
|
||||
# `--limit` of svn-log is useless in this case, because it is
|
||||
# applied before `--search`.
|
||||
rev = IO.pread(%W[ #{COMMAND} log --xml
|
||||
--search=matz --search-and=has\ started
|
||||
-- #{url}/version.h])[/<logentry\s+revision="(\d+)"/m, 1]
|
||||
rev.to_i if rev
|
||||
end
|
||||
|
||||
def export_changelog(url, from, to, path)
|
||||
range = [to, (from+1 if from)].compact.join(':')
|
||||
IO.popen({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'},
|
||||
|
@ -465,7 +474,7 @@ class VCS
|
|||
FileUtils.rm_rf(Dir.glob("#{dir}/.git*"))
|
||||
end
|
||||
|
||||
def branch_beginning
|
||||
def branch_beginning(url)
|
||||
cmd_read(%W[ #{COMMAND} log -n1 --format=format:%H
|
||||
--author=matz --committer=matz --grep=has\ started
|
||||
-- version.h include/ruby/version.h])
|
||||
|
|
Loading…
Reference in a new issue