diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-15 15:37:06 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-15 15:37:06 +0000 |
commit | d3fd773b7f929b0d2a20ad979ff8c48400055bd1 (patch) | |
tree | 3113d8ef4f1c9fa437849f3bebeb0ba8f41e8846 /tool | |
parent | df47c880feadee3ff5c40c5650e9b4a1e247d93b (diff) | |
download | ruby-d3fd773b7f929b0d2a20ad979ff8c48400055bd1.tar.gz ruby-d3fd773b7f929b0d2a20ad979ff8c48400055bd1.tar.xz ruby-d3fd773b7f929b0d2a20ad979ff8c48400055bd1.zip |
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.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r-- | tool/file2lastrev.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb index cacd76eb6..ea1130470 100644 --- a/tool/file2lastrev.rb +++ b/tool/file2lastrev.rb @@ -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 @@ def detect_vcs(path) 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 |