ruby-changes:36758
From: nobu <ko1@a...>
Date: Mon, 15 Dec 2014 10:02:55 +0900 (JST)
Subject: [ruby-changes:36758] nobu:r48839 (trunk): vcs.rb: non-string path
nobu 2014-12-15 10:02:46 +0900 (Mon, 15 Dec 2014) New Revision: 48839 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48839 Log: vcs.rb: non-string path * tool/vcs.rb (VCS#get_revisions, VCS::SVN.get_revisions): allow path to be other than a string. Modified files: trunk/tool/vcs.rb Index: tool/vcs.rb =================================================================== --- tool/vcs.rb (revision 48838) +++ tool/vcs.rb (revision 48839) @@ -71,7 +71,9 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L71 # return a pair of strings, the last revision and the last revision in which # +path+ was modified. def get_revisions(path) - path = relative_to(path) + if String === path or path.respond_to?(:to_path) + path = relative_to(path) + end last, changed, modified, *rest = ( begin if NullDevice @@ -103,7 +105,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L105 def relative_to(path) if path srcdir = File.realpath(@srcdir) - path = File.realpath(path) + path = File.realdirpath(path) list1 = srcdir.split(%r{/}) list2 = path.split(%r{/}) while !list1.empty? && !list2.empty? && list1.first == list2.first @@ -124,7 +126,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L126 register(".svn") def self.get_revisions(path, srcdir = nil) - if srcdir and %r'\A(?:[^/]+:|/)' !~ path + if srcdir and (String === path or path.respond_to?(:to_path)) path = File.join(srcdir, path) end info_xml = IO.pread(%W"svn info --xml #{path}") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/