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

lib/redmine/scm/adapters/bazaar_adapter.rb

index 97c1e322d34e7abf282c63b533227fc67045408b..de196a11b0b4914fea147000fc945360cb631613 100644 (file)
@@ -81,11 +81,11 @@ module Redmine
         def entries(path=nil, identifier=nil, options={})
           path ||= ''
           entries = Entries.new
-          cmd = "#{self.class.sq_bin} ls -v --show-ids"
           identifier = -1 unless identifier && identifier.to_i > 0
-          cmd << " -r#{identifier.to_i}"
-          cmd << " #{target(path)}"
-          shellout(cmd) do |io|
+          cmd_args = %w|ls -v --show-ids|
+          cmd_args << "-r#{identifier.to_i}"
+          cmd_args << bzr_target(path)
+          scm_cmd(*cmd_args) do |io|
             prefix = "#{url}/#{path}".gsub('\\', '/')
             logger.debug "PREFIX: #{prefix}"
             re = %r{^V\s+(#{Regexp.escape(prefix)})?(\/?)([^\/]+)(\/?)\s+(\S+)\r?$}
@@ -99,9 +99,12 @@ module Redmine
                                   })
             end
           end
-          return nil if $? && $?.exitstatus != 0
-          logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
+          if logger && logger.debug?
+            logger.debug("Found #{entries.size} entries in the repository for #{target(path)}")
+          end
           entries.sort_by_name
+        rescue ScmCommandAborted
+          return nil
         end
 
         def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})