1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vcs: --add-author-from

* tool/vcs.rb (VCS::GIT#commit): no --add-author-from option if
  author equals committer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-12-19 03:17:37 +00:00
parent 5590ec8a8e
commit 92bfddff92

View file

@ -469,7 +469,17 @@ class VCS
def commit
rev = cmd_read(%W"#{COMMAND} svn info"+[STDERR=>[:child, :out]])[/^Last Changed Rev: (\d+)/, 1]
ret = system(COMMAND, "svn", "dcommit", "--add-author-from")
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
end
ret = system(COMMAND, "svn", "dcommit", *(["--add-author-from"] unless same))
if ret and rev
old = [cmd_read(%W"#{COMMAND} log -1 --format=%H").chomp]
old << cmd_read(%W"#{COMMAND} svn reset -r#{rev}")[/^r#{rev} = (\h+)/, 1]