diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-05-26 07:15:05 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-05-26 07:15:05 +0000 |
commit | dc9011467ae6ed530c94d0f86e4631c29994fdc7 (patch) | |
tree | ff856b9cab053204bddd9d69811c3fb3be5cf5d7 /lib | |
parent | b4edeb80cddcdd0cb966c865b96cc987b75f41d6 (diff) | |
download | redmine-dc9011467ae6ed530c94d0f86e4631c29994fdc7.tar.gz redmine-dc9011467ae6ed530c94d0f86e4631c29994fdc7.zip |
scm: bazaar: refactor adapter revisions to use scm_cmd().
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5929 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/scm/adapters/bazaar_adapter.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/redmine/scm/adapters/bazaar_adapter.rb b/lib/redmine/scm/adapters/bazaar_adapter.rb index de196a11b..53f4d79e9 100644 --- a/lib/redmine/scm/adapters/bazaar_adapter.rb +++ b/lib/redmine/scm/adapters/bazaar_adapter.rb @@ -112,10 +112,12 @@ module Redmine identifier_from = (identifier_from and identifier_from.to_i > 0) ? identifier_from.to_i : 'last:1' identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : 1 revisions = Revisions.new - cmd = "#{self.class.sq_bin} log -v --show-ids -r#{identifier_to}..#{identifier_from} #{target(path)}" - shellout(cmd) do |io| + cmd_args = %w|log -v --show-ids| + cmd_args << "-r#{identifier_to}..#{identifier_from}" + cmd_args << bzr_target(path) + scm_cmd(*cmd_args) do |io| revision = nil - parsing = nil + parsing = nil io.each_line do |line| if line =~ /^----/ revisions << revision if revision @@ -163,8 +165,9 @@ module Redmine end revisions << revision if revision end - return nil if $? && $?.exitstatus != 0 revisions + rescue ScmCommandAborted + return nil end def diff(path, identifier_from, identifier_to=nil) |