Skip to content

Commit

Permalink
* tool/merger.rb (interactive): allow editing commit message.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Mar 26, 2012
1 parent 1b2a607 commit 06fba52
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tool/merger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ def version
return v, p
end

def interactive str
def interactive str, editfile = nil
loop do
yield
STDERR.puts str
STDERR.puts "#{str} ([y]es|[a]bort|[r]etry#{'|[e]dit' if editfile})"
case STDIN.gets
when /\Aa/i then exit
when /\Ar/i then redo
when /\Ay/i then break
when /\Ae/i then system(ENV["EDITOR"], editfile)
else exit
end
end
Expand Down Expand Up @@ -105,7 +106,7 @@ def tag intv_p = false
z = 'v' + x + '_' + p
w = $repos + 'tags/' + z
if intv_p
interactive "OK? svn cp -m \"add tag #{z}\" #{y} #{w} ([y]es|[a]bort|[r]etry)" do
interactive "OK? svn cp -m \"add tag #{z}\" #{y} #{w}" do
end
end
system *%w'svn cp -m' + ["add tag #{z}"] + [y, w]
Expand Down Expand Up @@ -181,14 +182,14 @@ def default_merge_branch
f.write log_svn
f.flush
f.close
f.open # avoid gc

interactive 'conflicts resolved? (y:yes, a:abort, r:retry, otherwise abort)' do
f.rewind
interactive 'conflicts resolved?', f.path do
IO.popen(ENV["PAGER"] || "less", "w") do |g|
g << `svn stat`
g << "\n\n"
f.open
g << f.read
f.close
g << "\n\n"
g << `svn diff --diff-cmd=diff -x -upw`
end
Expand Down

0 comments on commit 06fba52

Please sign in to comment.