ruby-file2lastrev-svn-info.diff

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

Download (671 Bytes)

tool/file2lastrev.rb (working copy)
1 1
#!/usr/bin/env ruby
2 2

  
3
ENV['LANG'] = ENV['LC_ALL'] = ENV['LC_MESSAGES'] = 'C'
4 3
ENV.delete('PWD')
5 4

  
6 5
require 'optparse'
......
22 21

  
23 22
  info = case vcs
24 23
  when :svn
25
    `cd "#{SRCDIR}" && svn info "#{path}"`
24
    info_xml = `cd "#{SRCDIR}" && svn info --xml "#{path}"`
25
    _, last, _, changed, _ = info_xml.split(/revision="(\d+)"/)
26
    "Revision: #{last}\nLast Changed Rev: #{changed}\n"
26 27
  when :git_svn
27 28
    `cd "#{SRCDIR}" && git svn info "#{path}"`
28 29
  when :git