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

tool/merger.rb: normalize the merged revision string

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2014-02-27 04:10:03 +00:00
parent 295e4bfd04
commit 1ebf8916b2

View file

@ -170,19 +170,25 @@ else
end
q = $repos + (ARGV[1] || default_merge_branch)
revs = ARGV[0].split(/,\s*/)
revstr = ARGV[0].delete('^, :\-0-9')
revs = revstr.split(/[,\s]+/)
log = ''
log_svn = ''
revs.each do |rev|
case rev
when /\Ar?\d+:r?\d+\z/
when /\A\d+:\d+\z/
r = ['-r', rev]
when /\Ar?\d+\z/
when /\A(\d+)-(\d+)\z/
r = ['-r', rev]
when /\A\d+\z/
r = ['-c', rev]
when nil then
puts "#$0 revision"
exit
else
puts "invalid revision part '#{rev}' in '#{ARGV[0]}'"
exit
end
l = IO.popen %w'svn diff' + r + %w'--diff-cmd=diff -x -pU0' + [File.join(q, 'ChangeLog')] do |f|
@ -224,7 +230,7 @@ else
version_up
f = Tempfile.new 'merger.rb'
f.printf "merge revision(s) %s:%s\n", ARGV[0], tickets.join
f.printf "merge revision(s) %s:%s\n", revstr, tickets.join
f.write log_svn
f.flush
f.close