diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-04-28 12:11:59 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-04-28 12:11:59 +0900 |
commit | d72bd190a80e6b8258ca923b606175754a210b6d (patch) | |
tree | 84fa961efa89c39a4aa73909f58a2aa0e1c5df7d /tool | |
parent | b7669705270478f14d02f15b51b74eeec52a49da (diff) | |
download | ruby-d72bd190a80e6b8258ca923b606175754a210b6d.tar.gz |
Added VCS::SVN#branch_beginning
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]) |