ruby-changes:49941
From: nobu <ko1@a...>
Date: Fri, 26 Jan 2018 22:34:14 +0900 (JST)
Subject: [ruby-changes:49941] nobu:r62059 (trunk): vcs.rb: dcommit for each commit
nobu 2018-01-26 22:34:09 +0900 (Fri, 26 Jan 2018) New Revision: 62059 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62059 Log: vcs.rb: dcommit for each commit svn to git bridge on ci.ruby-lang.org sometimes stalls when dcommitting some commits at once. Modified files: trunk/tool/vcs.rb Index: tool/vcs.rb =================================================================== --- tool/vcs.rb (revision 62058) +++ tool/vcs.rb (revision 62059) @@ -479,16 +479,18 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L479 rev = cmd_read(%W"#{COMMAND} svn info"+[STDERR=>[:child, :out]])[/^Last Changed Rev: (\d+)/, 1] com = cmd_read(%W"#{COMMAND} svn find-rev r#{rev}").chomp - # TODO: dcommit necessary commits only with --add-author-from - same = true - cmd_pipe([COMMAND, "log", "--format=%ae %ce", "#{com}..@"], "rb") do |r| - r.each do |l| - same &&= /^(\S+) +\1$/ =~ l - end + commits = cmd_read([COMMAND, "log", "--reverse", "--format=%H %ae %ce", "#{com}..@"], "rb").split("\n") + commits.each_with_index do |l, i| + r, a, c = l.split + dcommit = [COMMAND, "svn", "dcommit"] + dcommit.insert(-2, "-n") if $DEBUG + dcommit << "--add-author-from" unless a == c + dcommit << r + system(*dcommit) or return false + system(COMMAND, "rebase") or return false end - ret = system(COMMAND, "svn", "dcommit", *(["--add-author-from"] unless same)) - if ret and rev + if rev old = [cmd_read(%W"#{COMMAND} log -1 --format=%H").chomp] old << cmd_read(%W"#{COMMAND} svn reset -r#{rev}")[/^r#{rev} = (\h+)/, 1] 3.times do @@ -497,7 +499,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L499 break unless old.include?(cmd_read(%W"#{COMMAND} log -1 --format=%H").chomp) end end - ret + true end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/