summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-26 13:34:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-26 13:34:09 +0000
commiteab10990ac482798b03e47c9c6085384ed0a47fb (patch)
treef2c4d1cda97f05f6d912470567e2ce8331ec59ac /tool
parente168963d8ac8172941976255b653dc53044c3f0b (diff)
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
Diffstat (limited to 'tool')
-rw-r--r--tool/vcs.rb20
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