diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-26 13:34:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-26 13:34:09 +0000 |
commit | eab10990ac482798b03e47c9c6085384ed0a47fb (patch) | |
tree | f2c4d1cda97f05f6d912470567e2ce8331ec59ac | |
parent | e168963d8ac8172941976255b653dc53044c3f0b (diff) | |
download | ruby-eab10990ac482798b03e47c9c6085384ed0a47fb.tar.gz |
vcs.rb: dcommit for each commit
svn to git bridge on ci.ruby-lang.org sometimes stalls when
dcommitting some commits at once.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | tool/vcs.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb index 629d521320..a7cfa08d52 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -479,16 +479,18 @@ class VCS 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 break unless old.include?(cmd_read(%W"#{COMMAND} log -1 --format=%H").chomp) end end - ret + true end end end |