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

lib/redmine/scm/adapters/bazaar_adapter.rb

index 2710899d7a0907af7e3820460ec17c606c58e73b..89cfa80c761b7e9786c512d938bd9b897ac9c76d 100644 (file)
@@ -199,12 +199,12 @@ module Redmine
         end
 
         def annotate(path, identifier=nil)
-          cmd = "#{self.class.sq_bin} annotate --all"
-          cmd << " -r#{identifier.to_i}" if identifier && identifier.to_i > 0
-          cmd << " #{target(path)}"
           blame = Annotate.new
-          shellout(cmd) do |io|
-            author = nil
+          cmd_args = %w|annotate --all|
+          cmd_args << "-r#{identifier.to_i}" if identifier && identifier.to_i > 0
+          cmd_args << bzr_target(path)
+          scm_cmd(*cmd_args) do |io|
+            author     = nil
             identifier = nil
             io.each_line do |line|
               next unless line =~ %r{^(\d+) ([^|]+)\| (.*)$}
@@ -217,8 +217,9 @@ module Redmine
                   ))
             end
           end
-          return nil if $? && $?.exitstatus != 0
           blame
+        rescue ScmCommandAborted
+          return nil
         end
 
         def self.branch_conf_path(path)