mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Revert "vcs.rb support non-inplace build"
This reverts commit 22cd402734
.
It did not make sense due to a typo `@srcidr`.
This commit is contained in:
parent
aa8a8d8f6d
commit
542d69c894
1 changed files with 12 additions and 16 deletions
28
tool/vcs.rb
28
tool/vcs.rb
|
@ -403,7 +403,7 @@ class VCS
|
|||
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
|
|||
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
|
|||
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
|
|||
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
|
|||
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
|
|||
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
|
|||
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
|
|||
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
|
|||
|
||||
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"
|
||||
|
|
Loading…
Add table
Reference in a new issue