ruby-changes:15049
From: nobu <ko1@a...>
Date: Mon, 15 Mar 2010 04:19:12 +0900 (JST)
Subject: [ruby-changes:15049] Ruby:r26925 (trunk): * tool/file2lastrev.rb (VCS::{SVN,GIT}#get_revisions):
nobu 2010-03-15 04:18:49 +0900 (Mon, 15 Mar 2010) New Revision: 26925 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26925 Log: * tool/file2lastrev.rb (VCS::{SVN,GIT}#get_revisions): use block argument 'path' to get the path given by super. Modified files: trunk/ChangeLog trunk/tool/file2lastrev.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 26924) +++ ChangeLog (revision 26925) @@ -1,3 +1,8 @@ +Mon Mar 15 04:18:31 2010 Nobuyoshi Nakada <nobu@r...> + + * tool/file2lastrev.rb (VCS::{SVN,GIT}#get_revisions): + use block argument 'path' to get the path given by super. + Mon Mar 15 02:43:59 2010 Tanaka Akira <akr@f...> * tool/transcode-tblgen.rb (Action#hash): defined. Index: tool/file2lastrev.rb =================================================================== --- tool/file2lastrev.rb (revision 26924) +++ tool/file2lastrev.rb (revision 26925) @@ -43,8 +43,8 @@ class SVN < self register(".svn") - def get_revisions(path) - super do + def get_revisions(*) + super do |path| info_xml = `svn info --xml "#{path}"` _, last, _, changed, _ = info_xml.split(/revision="(\d+)"/) [last, changed] @@ -55,7 +55,7 @@ class GIT_SVN < self register(".git/svn") - def get_revisions(path) + def get_revisions(*) super do |path| info = `git svn info "#{path}"` [info[/^Revision: (\d+)/, 1], info[/^Last Changed Rev: (\d+)/, 1]] @@ -66,10 +66,10 @@ class GIT < self register(".git") - def get_revisions(path) + def get_revisions(*) logcmd = %Q[git log -n1 --grep="^ *git-svn-id: .*@[0-9][0-9]* "] idpat = /git-svn-id: .*?@(\d+) \S+\Z/ - super do + super do |path| last = `#{logcmd}`[idpat, 1] changed = path ? `#{logcmd} "#{path}"`[idpat, 1] : last [last, changed] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/