Bug #919: tool/file2lastrev.rbでエラー
http://redmine.ruby-lang.org/issues/show/919

起票者: Tadashi Saito
ステータス: Open, 優先度: Normal
担当者: Yuki Sonoda, Target version: 1.9.x

ソースと違うディレクトリでtrunkをmakeしようとすると、
tool/file2lastrev.rbでエラーが出てmakeできません。

$ make
ruby ../tool/file2lastrev.rb --revision.h ".." > "../revision.h.tmp"
svn: '.' is not a working copy
../tool/file2lastrev.rb:34:in `get_revisions': last revision not found (RuntimeError)
	from ../tool/file2lastrev.rb:70
make: *** [../revision.h] エラー 1

一応下ので直りましたが、汎用性があるのか正直自信がありません。

Index: tool/file2lastrev.rb
===================================================================
--- tool/file2lastrev.rb        (revision 20922)
+++ tool/file2lastrev.rb        (working copy)
@@ -10,8 +10,8 @@
 
   path = target_path.directory? ? target_path : target_path.parent  
   begin
-    return :svn, target_path.relative_path_from(path) if File.directory?("#{path}/.svn")
-    return :git, target_path.relative_path_from(path) if File.directory?("#{path}/.git")
+    return :svn, target_path.relative_path_from(Pathname.pwd) if File.directory?("#{path}/.svn")
+    return :git, target_path.relative_path_from(Pathname.pwd) if File.directory?("#{path}/.git")
     path, orig = path.parent, path
   end until path == orig
   raise VCSNotFoundError, "does not seem to be under a vcs"


----------------------------------------
http://redmine.ruby-lang.org