def shellout(cmd, &block)
logger.debug "Shelling out: #{cmd}" if logger && logger.debug?
- IO.popen(cmd, "r+") do |io|
- io.close_write
- block.call(io) if block_given?
+ begin
+ IO.popen(cmd, "r+") do |io|
+ io.close_write
+ block.call(io) if block_given?
+ end
+ rescue Errno::ENOENT => e
+ # The command failed, log it and re-raise
+ log.error("SCM command failed: #{cmd}\n with: #{e.message}")
+ raise CommandFailed
end
end
end
end
return nil if $? && $?.exitstatus != 0
info
- rescue Errno::ENOENT => e
+ rescue CommandFailed
return nil
end
return nil if $? && $?.exitstatus != 0
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
entries.sort_by_name
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
end
return nil if $? && $?.exitstatus != 0
revisions
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
end
end
#return nil if $? && $?.exitstatus != 0
- DiffTableList.new diff, type
- rescue Errno::ENOENT => e
- raise CommandFailed
+ DiffTableList.new diff, type
end
def cat(path, identifier=nil)
end
return nil if $? && $?.exitstatus != 0
cat
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def annotate(path, identifier=nil)
end
return nil if $? && $?.exitstatus != 0
blame
- rescue Errno::ENOENT => e
- raise CommandFailed
end
end
end
end
return nil if $? && $?.exitstatus != 0
entries.sort_by_name
- rescue Errno::ENOENT => e
- raise CommandFailed
end
STARTLOG="----------------------------"
end
end
end
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
end
return nil if $? && $?.exitstatus != 0
DiffTableList.new diff, type
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def cat(path, identifier=nil)
end
return nil if $? && $?.exitstatus != 0
cat
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def annotate(path, identifier=nil)
end
return nil if $? && $?.exitstatus != 0
blame
- rescue Errno::ENOENT => e
- raise CommandFailed
end
private
end
return nil if $? && $?.exitstatus != 0
entries.sort_by_name
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
end
return nil if $? && $?.exitstatus != 0
revisions
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
end
return nil if $? && $?.exitstatus != 0
DiffTableList.new diff, type
- rescue Errno::ENOENT => e
- raise CommandFailed
end
private
end
end
paths
- rescue Errno::ENOENT => e
+ rescue CommandFailed
paths
end
end
:lastrev => revisions(nil,nil,nil,{:limit => 1}).last
})
info
- rescue Errno::ENOENT => e
+ rescue CommandFailed
return nil
end
end
return nil if $? && $?.exitstatus != 0
entries.sort_by_name
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def entry(path=nil, identifier=nil)
end
return nil if $? && $?.exitstatus != 0
revisions
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
end
return nil if $? && $?.exitstatus != 0
DiffTableList.new diff, type
-
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def cat(path, identifier=nil)
end
return nil if $? && $?.exitstatus != 0
cat
- rescue Errno::ENOENT => e
- raise CommandFailed
end
def annotate(path, identifier=nil)
end
return nil if $? && $?.exitstatus != 0
blame
- rescue Errno::ENOENT => e
- raise CommandFailed
end
end
end
end\r
return nil if $? && $?.exitstatus != 0\r
info\r
- rescue Errno::ENOENT => e\r
+ rescue CommandFailed\r
return nil\r
end\r
\r
return nil if $? && $?.exitstatus != 0\r
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?\r
entries.sort_by_name\r
- rescue Errno::ENOENT => e\r
- raise CommandFailed\r
end\r
\r
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})\r
end\r
return nil if $? && $?.exitstatus != 0\r
revisions\r
- rescue Errno::ENOENT => e\r
- raise CommandFailed \r
end\r
\r
def diff(path, identifier_from, identifier_to=nil, type="inline")\r
end\r
return nil if $? && $?.exitstatus != 0\r
DiffTableList.new diff, type \r
- rescue Errno::ENOENT => e\r
- raise CommandFailed \r
end\r
\r
def cat(path, identifier=nil)\r
end\r
return nil if $? && $?.exitstatus != 0\r
cat\r
- rescue Errno::ENOENT => e\r
- raise CommandFailed \r
end\r
\r
def annotate(path, identifier=nil)\r
end\r
return nil if $? && $?.exitstatus != 0\r
blame\r
- rescue Errno::ENOENT => e\r
- raise CommandFailed\r
end\r
\r
private\r