ruby-changes:55777
From: Nobuyoshi <ko1@a...>
Date: Wed, 22 May 2019 23:53:53 +0900 (JST)
Subject: [ruby-changes:55777] Nobuyoshi Nakada: d819d97cf0 (trunk): Default to the current branch
https://git.ruby-lang.org/ruby.git/commit/?id=d819d97cf0 From d819d97cf02fd0a5b5b1f6ee69c9fdb83276e6c2 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 22 May 2019 23:18:09 +0900 Subject: Default to the current branch * tool/make-snapshot: default to the current branch if no branch but srcdir is given. diff --git a/tool/make-snapshot b/tool/make-snapshot index cac32d3..423a4a4 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -143,7 +143,7 @@ end https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L143 unless destdir = ARGV.shift abort usage end -revisions = ARGV.empty? ? ["trunk"] : ARGV +revisions = ARGV.empty? ? [nil] : ARGV unless tmp = $exported FileUtils.mkpath(destdir) destdir = File.expand_path(destdir) @@ -201,10 +201,12 @@ end https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L201 def package(vcs, rev, destdir, tmp = nil) patchlevel = false prerelease = false - if revision = rev[/@(\d+)\z/, 1] + if rev and revision = rev[/@(\d+)\z/, 1] rev = $` end case rev + when nil + url = nil when /\Atrunk\z/ url = vcs.trunk when /\Abranches\// @@ -234,7 +236,10 @@ def package(vcs, rev, destdir, tmp = nil) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L236 warn "#{$0}: unknown version - #{rev}" return end - revision ||= vcs.get_revisions(url)[0] + if !revision and revision = vcs.get_revisions(url) + url ||= vcs.branch(revision[3]) + revision = revision[0] + end version = nil unless revision url = vcs.trunk diff --git a/tool/vcs.rb b/tool/vcs.rb index 3f0a331..f251c96 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -278,6 +278,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L278 end def branch(name) + return trunk if name == "trunk" url + "branches/#{name}" end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/