From 4be9734824b74ccaa199bd1a313c50e324885723 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 26 May 2011 05:07:55 +0000 Subject: [PATCH] scm: bazaar: refactor adapter cat to use scm_cmd(). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5919 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/bazaar_adapter.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/redmine/scm/adapters/bazaar_adapter.rb b/lib/redmine/scm/adapters/bazaar_adapter.rb index 0e98ebf77..46877ad43 100644 --- a/lib/redmine/scm/adapters/bazaar_adapter.rb +++ b/lib/redmine/scm/adapters/bazaar_adapter.rb @@ -186,16 +186,17 @@ module Redmine end def cat(path, identifier=nil) - cmd = "#{self.class.sq_bin} cat" - cmd << " -r#{identifier.to_i}" if identifier && identifier.to_i > 0 - cmd << " #{target(path)}" cat = nil - shellout(cmd) do |io| + cmd_args = %w|cat| + cmd_args << "-r#{identifier.to_i}" if identifier && identifier.to_i > 0 + cmd_args << bzr_target(path) + scm_cmd(*cmd_args) do |io| io.binmode cat = io.read end - return nil if $? && $?.exitstatus != 0 cat + rescue ScmCommandAborted + return nil end def annotate(path, identifier=nil) -- 2.39.5