[前][次][番号順一覧][スレッド一覧]

ruby-changes:55572

From: Nobuyoshi <ko1@a...>
Date: Sun, 28 Apr 2019 12:18:23 +0900 (JST)
Subject: [ruby-changes:55572] Nobuyoshi Nakada:d72bd190a8 (trunk): Added VCS::SVN#branch_beginning

https://git.ruby-lang.org/ruby.git/commit/?id=d72bd190a8

From d72bd190a80e6b8258ca923b606175754a210b6d Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 28 Apr 2019 12:11:59 +0900
Subject: Added VCS::SVN#branch_beginning


diff --git a/tool/make-snapshot b/tool/make-snapshot
index 4cd47cf..6161335 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -339,7 +339,7 @@ def package(vcs, rev, destdir, tmp = nil) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L339
   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 5ba8ce2..7dadada 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -345,6 +345,15 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L345
       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 https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L474
       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])
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]