ruby-changes:10005
From: yugui <ko1@a...>
Date: Fri, 16 Jan 2009 00:37:32 +0900 (JST)
Subject: [ruby-changes:10005] Ruby:r21547 (ruby_1_9_1): merges r21486 from trunk into ruby_1_9_1.
yugui 2009-01-16 00:37:06 +0900 (Fri, 16 Jan 2009) New Revision: 21547 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21547 Log: merges r21486 from trunk into ruby_1_9_1. * tool/file2lastrev.rb (get_revisions): fixes problem with svn on cygwin. [ruby-dev:37702]. Patch by Kouhei Sutou. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/tool/file2lastrev.rb Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21546) +++ ruby_1_9_1/ChangeLog (revision 21547) @@ -1,3 +1,9 @@ +Tue Jan 13 12:31:54 2009 Yuki Sonoda (Yugui) <yugui@y...> + + * 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@y...> * lib/irb/input-method.rb: IRB did not prompt for MSwin32. Index: ruby_1_9_1/tool/file2lastrev.rb =================================================================== --- ruby_1_9_1/tool/file2lastrev.rb (revision 21546) +++ ruby_1_9_1/tool/file2lastrev.rb (revision 21547) @@ -1,6 +1,5 @@ #!/usr/bin/env ruby -ENV['LANG'] = ENV['LC_ALL'] = ENV['LC_MESSAGES'] = 'C' ENV.delete('PWD') require 'optparse' @@ -17,18 +16,22 @@ raise VCSNotFoundError, "does not seem to be under a vcs" end +# return a pair of strings, the last revision and the last revision in which +# +path+ was modified. def get_revisions(path) vcs, path = detect_vcs(path) 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+)"/) + return last, changed 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" + return $1, $1 end if /^Revision: (\d+)/ =~ info -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/