* tool/file2lastrev.rb (get_revisions): fixes problem with
svn on cygwin. [ruby-dev:37702]. Patch by Kouhei Sutou. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a5fdc9de34
commit
e41bd61822
@ -1,3 +1,9 @@
|
|||||||
|
Tue Jan 13 12:31:54 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||||
|
|
||||||
|
* tool/file2lastrev.rb (get_revisions): fixes problem with
|
||||||
|
svn on cygwin. [ruby-dev:37702].
|
||||||
|
Patch by Kouhei Sutou.
|
||||||
|
|
||||||
Tue Jan 13 11:58:04 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
Tue Jan 13 11:58:04 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||||
|
|
||||||
* lib/irb/input-method.rb: IRB did not prompt for MSwin32.
|
* lib/irb/input-method.rb: IRB did not prompt for MSwin32.
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
ENV['LANG'] = ENV['LC_ALL'] = ENV['LC_MESSAGES'] = 'C'
|
|
||||||
ENV.delete('PWD')
|
ENV.delete('PWD')
|
||||||
|
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
@ -17,18 +16,22 @@ def detect_vcs(path)
|
|||||||
raise VCSNotFoundError, "does not seem to be under a vcs"
|
raise VCSNotFoundError, "does not seem to be under a vcs"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# return a pair of strings, the last revision and the last revision in which
|
||||||
|
# +path+ was modified.
|
||||||
def get_revisions(path)
|
def get_revisions(path)
|
||||||
vcs, path = detect_vcs(path)
|
vcs, path = detect_vcs(path)
|
||||||
|
|
||||||
info = case vcs
|
info = case vcs
|
||||||
when :svn
|
when :svn
|
||||||
`cd "#{SRCDIR}" && svn info "#{path}"`
|
info_xml = `cd "#{SRCDIR}" && svn info --xml "#{path}"`
|
||||||
|
_, last, _, changed, _ = info_xml.split(/revision="(\d+)"/)
|
||||||
|
return last, changed
|
||||||
when :git_svn
|
when :git_svn
|
||||||
`cd "#{SRCDIR}" && git svn info "#{path}"`
|
`cd "#{SRCDIR}" && git svn info "#{path}"`
|
||||||
when :git
|
when :git
|
||||||
git_log = `cd "#{SRCDIR}" && git log HEAD~1..HEAD "#{path}"`
|
git_log = `cd "#{SRCDIR}" && git log HEAD~1..HEAD "#{path}"`
|
||||||
git_log =~ /git-svn-id: .*?@(\d+)/
|
git_log =~ /git-svn-id: .*?@(\d+)/
|
||||||
"Revision: #{$1}\nLast Changed Rev: #{$1}\n"
|
return $1, $1
|
||||||
end
|
end
|
||||||
|
|
||||||
if /^Revision: (\d+)/ =~ info
|
if /^Revision: (\d+)/ =~ info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user