From 717e2a0a9fd3093b2d3e7a106ec8848c34c3ac98 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 11 Apr 2011 06:30:07 +0000 Subject: [PATCH] scm: cvs: use scm_cmd() in cat. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5395 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/cvs_adapter.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb index de8f65e35..856f83818 100644 --- a/lib/redmine/scm/adapters/cvs_adapter.rb +++ b/lib/redmine/scm/adapters/cvs_adapter.rb @@ -294,16 +294,17 @@ module Redmine identifier = (identifier) ? identifier : "HEAD" logger.debug " 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)