]> source.dussan.org Git - redmine.git/commitdiff
scm: bazaar: refactor adapter cat to use scm_cmd().
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 26 May 2011 05:07:55 +0000 (05:07 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 26 May 2011 05:07:55 +0000 (05:07 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5919 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/bazaar_adapter.rb

index 0e98ebf779c95c1f5801de0e8d73c4288f62324c..46877ad43df067e40a0b8c0b5f20f572438351eb 100644 (file)
@@ -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)