ruby-changes:48129
From: nobu <ko1@a...>
Date: Sat, 21 Oct 2017 17:57:04 +0900 (JST)
Subject: [ruby-changes:48129] nobu:r60243 (trunk): vcs.rb: try to extract revision number from tags
nobu 2017-10-21 17:56:58 +0900 (Sat, 21 Oct 2017) New Revision: 60243 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60243 Log: vcs.rb: try to extract revision number from tags Modified files: trunk/tool/vcs.rb Index: tool/vcs.rb =================================================================== --- tool/vcs.rb (revision 60242) +++ tool/vcs.rb (revision 60243) @@ -345,12 +345,16 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L345 def self.get_revisions(path, srcdir = nil) gitcmd = [COMMAND] + desc = cmd_read_at(srcdir, [gitcmd + %w[describe --tags --match REV_*]]) + if /\AREV_(\d+)(?:-(\d+)-g\h+)?\Z/ =~ desc + last = ($1.to_i + $2.to_i).to_s + end logcmd = gitcmd + %W[log -n1 --date=iso] - logcmd << "--grep=^ *git-svn-id: .*@[0-9][0-9]*" + logcmd << "--grep=^ *git-svn-id: .*@[0-9][0-9]*" unless last idpat = /git-svn-id: .*?@(\d+) \S+\Z/ log = cmd_read_at(srcdir, [logcmd]) commit = log[/\Acommit (\w+)/, 1] - last = log[idpat, 1] + last ||= log[idpat, 1] if path cmd = logcmd cmd += [path] unless path == '.' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/