Project

General

Profile

Bug #983 » ruby-file2lastrev-svn-info.diff

kou (Kouhei Sutou), 01/06/2009 08:33 PM

View differences:

tool/file2lastrev.rb (working copy)
#!/usr/bin/env ruby
ENV['LANG'] = ENV['LC_ALL'] = ENV['LC_MESSAGES'] = 'C'
ENV.delete('PWD')
require 'optparse'
......
info = case vcs
when :svn
`cd "#{SRCDIR}" && svn info "#{path}"`
info_xml = `cd "#{SRCDIR}" && svn info --xml "#{path}"`
_, last, _, changed, _ = info_xml.split(/revision="(\d+)"/)
"Revision: #{last}\nLast Changed Rev: #{changed}\n"
when :git_svn
`cd "#{SRCDIR}" && git svn info "#{path}"`
when :git
(2-2/2)