scm: bazaar: refactor adapter info() to use scm_cmd().

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5908 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-05-25 23:51:44 +00:00
parent e23f319a4c
commit 39a245e9ee
1 changed files with 4 additions and 4 deletions

View File

@ -59,9 +59,10 @@ module Redmine
# Get info about the repository # Get info about the repository
def info def info
cmd = "#{self.class.sq_bin} revno #{target('')}" cmd_args = %w|revno|
cmd_args << bzr_target('')
info = nil info = nil
shellout(cmd) do |io| scm_cmd(*cmd_args) do |io|
if io.read =~ %r{^(\d+)\r?$} if io.read =~ %r{^(\d+)\r?$}
info = Info.new({:root_url => url, info = Info.new({:root_url => url,
:lastrev => Revision.new({ :lastrev => Revision.new({
@ -70,9 +71,8 @@ module Redmine
}) })
end end
end end
return nil if $? && $?.exitstatus != 0
info info
rescue CommandFailed rescue ScmCommandAborted
return nil return nil
end end