[前][次][番号順一覧][スレッド一覧]

ruby-changes:9695

From: yugui <ko1@a...>
Date: Thu, 1 Jan 2009 15:44:01 +0900 (JST)
Subject: [ruby-changes:9695] Ruby:r21236 (ruby_1_9_1): * tool/flie2lastrev.rb: supports git repositories which are cloned

yugui	2009-01-01 15:43:34 +0900 (Thu, 01 Jan 2009)

  New Revision: 21236

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21236

  Log:
    * tool/flie2lastrev.rb: supports git repositories which are cloned
      from a git-svn gateway.
      Patch by Hongli Lai. [ruby-core:21020]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/tool/file2lastrev.rb

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 21235)
+++ ruby_1_9_1/ChangeLog	(revision 21236)
@@ -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 07:42:36 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/singleton.rb: fix indentation of RDoc text.  [ruby-core:21029]
Index: ruby_1_9_1/tool/file2lastrev.rb
===================================================================
--- ruby_1_9_1/tool/file2lastrev.rb	(revision 21235)
+++ ruby_1_9_1/tool/file2lastrev.rb	(revision 21236)
@@ -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/

[前][次][番号順一覧][スレッド一覧]