scm: cvs: use scm_cmd() in cat.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5395 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-11 06:30:07 +00:00
parent 51242b967d
commit 717e2a0a9f
1 changed files with 6 additions and 5 deletions

View File

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