scm: bazaar: refactor adapter cat to use scm_cmd().
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5919 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a01bd88379
commit
4be9734824
|
@ -186,16 +186,17 @@ module Redmine
|
||||||
end
|
end
|
||||||
|
|
||||||
def cat(path, identifier=nil)
|
def cat(path, identifier=nil)
|
||||||
cmd = "#{self.class.sq_bin} cat"
|
|
||||||
cmd << " -r#{identifier.to_i}" if identifier && identifier.to_i > 0
|
|
||||||
cmd << " #{target(path)}"
|
|
||||||
cat = nil
|
cat = nil
|
||||||
shellout(cmd) do |io|
|
cmd_args = %w|cat|
|
||||||
|
cmd_args << "-r#{identifier.to_i}" if identifier && identifier.to_i > 0
|
||||||
|
cmd_args << bzr_target(path)
|
||||||
|
scm_cmd(*cmd_args) do |io|
|
||||||
io.binmode
|
io.binmode
|
||||||
cat = io.read
|
cat = io.read
|
||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
|
||||||
cat
|
cat
|
||||||
|
rescue ScmCommandAborted
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def annotate(path, identifier=nil)
|
def annotate(path, identifier=nil)
|
||||||
|
|
Loading…
Reference in New Issue