From 6b2a1085d1d3b5f839ba916bbcf9fcb27ffc529b Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 26 May 2011 07:13:10 +0000 Subject: [PATCH] scm: bazaar: refactor adapter entries to use scm_cmd(). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5926 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/bazaar_adapter.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/redmine/scm/adapters/bazaar_adapter.rb b/lib/redmine/scm/adapters/bazaar_adapter.rb index 97c1e322d..de196a11b 100644 --- a/lib/redmine/scm/adapters/bazaar_adapter.rb +++ b/lib/redmine/scm/adapters/bazaar_adapter.rb @@ -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={}) -- 2.39.5