[前][次][番号順一覧][スレッド一覧]

ruby-changes:23083

From: nobu <ko1@a...>
Date: Mon, 26 Mar 2012 12:57:17 +0900 (JST)
Subject: [ruby-changes:23083] nobu:r35133 (trunk): * tool/merger.rb (interactive): allow editing commit message.

nobu	2012-03-26 12:57:07 +0900 (Mon, 26 Mar 2012)

  New Revision: 35133

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35133

  Log:
    * tool/merger.rb (interactive): allow editing commit message.

  Modified files:
    trunk/tool/merger.rb

Index: tool/merger.rb
===================================================================
--- tool/merger.rb	(revision 35132)
+++ tool/merger.rb	(revision 35133)
@@ -44,14 +44,15 @@
   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
@@ -105,7 +106,7 @@
   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]
@@ -181,14 +182,14 @@
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]