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

ruby-changes:50227

From: nobu <ko1@a...>
Date: Sat, 10 Feb 2018 15:42:40 +0900 (JST)
Subject: [ruby-changes:50227] nobu:r62345 (trunk): vcs.rb: dryrun: option of GIT::SVN#commit

nobu	2018-02-10 15:42:35 +0900 (Sat, 10 Feb 2018)

  New Revision: 62345

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62345

  Log:
    vcs.rb: dryrun: option of GIT::SVN#commit

  Modified files:
    trunk/tool/vcs.rb
Index: tool/vcs.rb
===================================================================
--- tool/vcs.rb	(revision 62344)
+++ tool/vcs.rb	(revision 62345)
@@ -491,16 +491,22 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L491
       end
     end
 
-    def commit
+    def last_changed_revision
       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
+      return rev, com
+    end
+
+    def commit(opts = {})
+      dryrun = opts.fetch(:dryrun) {$DEBUG} if opts
+      rev, com = last_changed_revision
       head = cmd_read(%W"#{COMMAND} symbolic-ref --short HEAD").chomp
 
       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.insert(-2, "-n") if dryrun
         dcommit << "--add-author-from" unless a == c
         dcommit << r
         system(*dcommit) or return false

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

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