mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
89cf0ec1a6
commit
30f3c8c70b
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Jan 1 15:08:46 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* 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@fsij.org>
|
||||
|
||||
* ext/socket/mkconstants.rb: generate init_constants function.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue