diff options
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/make-snapshot | 2 | ||||
-rw-r--r-- | tool/vcs.rb | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot index 4cd47cf29c..6161335eeb 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -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") diff --git a/tool/vcs.rb b/tool/vcs.rb index 5ba8ce2606..7dadada494 100644 --- a/tool/vcs.rb +++ b/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]) |