aboutsummaryrefslogtreecommitdiffstats
path: root/tool/file2lastrev.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 07:13:24 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 07:13:24 +0000
commit30f3c8c70bbfab845ea8db868e961f9482bf637f (patch)
tree6e438723a91fadeb80b0d3de38652d4aaa150871 /tool/file2lastrev.rb
parent89cf0ec1a611494f15076d590fd6af214d4ff5ad (diff)
downloadruby-30f3c8c70bbfab845ea8db868e961f9482bf637f.tar.gz
* tool/flie2lastrev.rb: supports git repositories which are cloned
from a git-svn gateway. Patch by Hongli Lai. [ruby-core:21020] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/file2lastrev.rb')
-rw-r--r--tool/file2lastrev.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb
index 37b27b2b88..cacd76eb60 100644
--- a/tool/file2lastrev.rb
+++ b/tool/file2lastrev.rb
@@ -12,6 +12,7 @@ class VCSNotFoundError < RuntimeError; end
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 @@ def get_revisions(path)
info = case vcs
when :svn
`cd "#{SRCDIR}" && svn info "#{path}"`
- when :git
+ when :git_svn
`cd "#{SRCDIR}" && git svn info "#{path}"`
+ when :git
+ 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