ruby-changes:56016
From: Nobuyoshi <ko1@a...>
Date: Wed, 5 Jun 2019 12:04:42 +0900 (JST)
Subject: [ruby-changes:56016] Nobuyoshi Nakada: 542d69c894 (trunk): Revert "vcs.rb support non-inplace build"
https://git.ruby-lang.org/ruby.git/commit/?id=542d69c894 From 542d69c894f86cd9a395fdd5296981c998e4a6bf Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 5 Jun 2019 11:53:24 +0900 Subject: Revert "vcs.rb support non-inplace build" This reverts commit 22cd4027349f803efc7ede284376b7a7013f8dfe. It did not make sense due to a typo `@srcidr`. diff --git a/tool/vcs.rb b/tool/vcs.rb index 8735d08..618a788 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -403,7 +403,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L403 end def self.get_revisions(path, srcdir = nil) - gitcmd = [COMMAND, '-C', srcdir || '.'] + gitcmd = [COMMAND] last = cmd_read_at(srcdir, [[*gitcmd, 'rev-parse', 'HEAD']]).rstrip log = cmd_read_at(srcdir, [[*gitcmd, 'log', '-n1', '--date=iso', '--pretty=fuller', *path]]) changed = log[/\Acommit (\h+)/, 1] @@ -460,10 +460,6 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L460 self.class.cmd_read_at(@srcdir, cmds) end - def gitcmd - [COMMAND, '-C', @srcidr||"."] - end - Branch = Struct.new(:to_str) def branch(name) @@ -477,12 +473,12 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L473 end def stable - cmd = gitcmd + %W"for-each-ref --format=\%(refname:short) refs/heads/ruby_[0-9]*" + cmd = %W"#{COMMAND} for-each-ref --format=\%(refname:short) refs/heads/ruby_[0-9]*" branch(cmd_read(cmd)[/.*^(ruby_\d+_\d+)$/m, 1]) end def branch_list(pat) - cmd = gitcmd + %W"for-each-ref --format=\%(refname:short) refs/heads/#{pat}" + cmd = %W"#{COMMAND} for-each-ref --format=\%(refname:short) refs/heads/#{pat}" cmd_pipe(cmd) {|f| f.each {|line| line.chomp! @@ -492,7 +488,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L488 end def grep(pat, tag, *files, &block) - cmd = gitcmd + %W[grep -h --perl-regexp #{tag} --] + cmd = %W[#{COMMAND} grep -h --perl-regexp #{tag} --] set = block.binding.eval("proc {|match| $~ = match}") cmd_pipe(cmd+files) do |f| f.grep(pat) do |s| @@ -503,7 +499,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L499 end def export(revision, url, dir, keep_temp = false) - ret = system(*gitcmd, "clone", "-s", (@srcdir || '.').to_s, "-b", url, dir) + ret = system(COMMAND, "clone", "-s", (@srcdir || '.').to_s, "-b", url, dir) ret end @@ -512,7 +508,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L508 end def branch_beginning(url) - cmd_read(gitcmd + %W[log -n1 --format=format:%H + cmd_read(%W[ #{COMMAND} log -n1 --format=format:%H --author=matz --committer=matz --grep=has\ started -- version.h include/ruby/version.h]) end @@ -522,7 +518,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L518 rev or next if Integer === rev rev = cmd_read({'LANG' => 'C', 'LC_ALL' => 'C'}, - gitcmd << %W"log -n1 --format=format:%H" << + %W"#{COMMAND} log -n1 --format=format:%H" << "--grep=^ *git-svn-id: .*@#{rev} ") end rev unless rev.empty? @@ -532,7 +528,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L528 end range = [from, (to || 'HEAD')].join('^..') cmd_pipe({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'}, - gitcmd + %W"log --format=medium --no-notes --date=iso-local --topo-order #{range}", "rb") do |r| + %W"#{COMMAND} log --format=medium --no-notes --date=iso-local --topo-order #{range}", "rb") do |r| format_changelog(r, path) end end @@ -543,12 +539,12 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L539 def commit(opts = {}) dryrun = opts.fetch(:dryrun) {$DEBUG} if opts - args = [*gitcmd, "push"] + args = [COMMAND, "push"] args << "-n" if dryrun - (branch = cmd_read(gitcmd + %W"symbolic-ref --short HEAD")).chomp! - (upstream = cmd_read(gitcmd + %W"branch --list --format=%(upstream) #{branch}")).chomp! + (branch = cmd_read(%W"#{COMMAND} symbolic-ref --short HEAD")).chomp! + (upstream = cmd_read(%W"#{COMMAND} branch --list --format=%(upstream) #{branch}")).chomp! while ref = upstream[%r"\Arefs/heads/(.*)", 1] - upstream = cmd_read(gitcmd + %W"branch --list --format=%(upstream) #{ref}") + upstream = cmd_read(%W"#{COMMAND} branch --list --format=%(upstream) #{ref}") end unless %r"\Arefs/remotes/([^/]+)/(.*)" =~ upstream raise "Upstream not found" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/