ruby-changes:9698
From: yugui <ko1@a...>
Date: Thu, 1 Jan 2009 16:14:39 +0900 (JST)
Subject: [ruby-changes:9698] Ruby:r21239 (trunk): * tool/flie2lastrev.rb: supports git repositories which are cloned
yugui 2009-01-01 16:13:24 +0900 (Thu, 01 Jan 2009) New Revision: 21239 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21239 Log: * tool/flie2lastrev.rb: supports git repositories which are cloned from a git-svn gateway. Patch by Hongli Lai. [ruby-core:21020] Modified files: trunk/ChangeLog trunk/tool/file2lastrev.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 21238) +++ ChangeLog (revision 21239) @@ -1,3 +1,9 @@ +Thu Jan 1 15:08:46 2009 Yuki Sonoda (Yugui) <yugui@y...> + + * tool/flie2lastrev.rb: supports git repositories which are cloned + from a git-svn gateway. + Patch by Hongli Lai. [ruby-core:21020] + Thu Jan 1 16:08:11 2009 Tanaka Akira <akr@f...> * ext/socket/mkconstants.rb: generate init_constants function. Index: tool/file2lastrev.rb =================================================================== --- tool/file2lastrev.rb (revision 21238) +++ tool/file2lastrev.rb (revision 21239) @@ -12,6 +12,7 @@ def detect_vcs(path) path = SRCDIR return :svn, path.relative_path_from(SRCDIR) if File.directory?("#{path}/.svn") + return :git_svn, path.relative_path_from(SRCDIR) if File.directory?("#{path}/.git/svn") return :git, path.relative_path_from(SRCDIR) if File.directory?("#{path}/.git") raise VCSNotFoundError, "does not seem to be under a vcs" end @@ -22,8 +23,12 @@ info = case vcs when :svn `cd "#{SRCDIR}" && svn info "#{path}"` + when :git_svn + `cd "#{SRCDIR}" && git svn info "#{path}"` when :git - `cd "#{SRCDIR}" && git svn info "#{path}"` + git_log = `cd "#{SRCDIR}" && git log HEAD~1..HEAD "#{path}"` + git_log =~ /git-svn-id: .*?@(\d+)/ + "Revision: #{$1}\nLast Changed Rev: #{$1}\n" end if /^Revision: (\d+)/ =~ info -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/