summaryrefslogtreecommitdiffstats
path: root/lib/redmine/scm/adapters/bazaar_adapter.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-05-26 07:13:10 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-05-26 07:13:10 +0000
commit6b2a1085d1d3b5f839ba916bbcf9fcb27ffc529b (patch)
tree8bc9ddac0f7380dde9593e37d4adbe6fcc4d9ff0 /lib/redmine/scm/adapters/bazaar_adapter.rb
parent80e997ca222b5fb81ba4c8814437034284346b09 (diff)
downloadredmine-6b2a1085d1d3b5f839ba916bbcf9fcb27ffc529b.tar.gz
redmine-6b2a1085d1d3b5f839ba916bbcf9fcb27ffc529b.zip
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
Diffstat (limited to 'lib/redmine/scm/adapters/bazaar_adapter.rb')
-rw-r--r--lib/redmine/scm/adapters/bazaar_adapter.rb15
1 files 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={})