]> source.dussan.org Git - redmine.git/commitdiff
scm: cvs: use scm_cmd() in cat.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 11 Apr 2011 06:30:07 +0000 (06:30 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 11 Apr 2011 06:30:07 +0000 (06:30 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5395 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/cvs_adapter.rb

index de8f65e351941496f3a54b8436058e0291852996..856f83818935ccca114363177d66d67286d929a7 100644 (file)
@@ -294,16 +294,17 @@ module Redmine
           identifier = (identifier) ? identifier : "HEAD"
           logger.debug "<cvs> cat path:'#{path}',identifier #{identifier}"
           path_with_project="#{url}#{with_leading_slash(path)}"
-          cmd = "#{self.class.sq_bin} -d #{shell_quote root_url} co"
-          cmd << " -D \"#{time_to_cvstime(identifier)}\"" if identifier
-          cmd << " -p #{shell_quote path_with_project}"
+          cmd_args = %w|co|
+          cmd_args << "-D" << "#{time_to_cvstime(identifier)}" if identifier
+          cmd_args << "-p" << path_with_project
           cat = nil
-          shellout(cmd) do |io|
+          scm_cmd(*cmd_args) do |io|
             io.binmode
             cat = io.read
           end
-          return nil if $? && $?.exitstatus != 0
           cat
+        rescue ScmCommandAborted
+          nil
         end
 
         def annotate(path, identifier=nil)