lib/autobuild/importer.rb in autobuild-1.9.6 vs lib/autobuild/importer.rb in autobuild-1.10.0.b1
- old
+ new
@@ -80,22 +80,20 @@
# This can be used to check whether two importers are pointing to the same
# repository, regardless of e.g. the access protocol used. For instance,
# two git importers that point to the same repository but different branches
# would have the same repository_id but different source_id
#
- # @return [String]
# @see source_id
attr_reader :repository_id
# Returns a string that identifies the remote source uniquely
#
# This can be used to check whether two importers are pointing to the same
# code base inside the same repository. For instance, two git importers that
# point to the same repository but different branches would have the same
# repository_id but different source_id
#
- # @return [String]
# @see repository_id
attr_reader :source_id
# The number of times update / checkout should be retried before giving up.
# The default is 0 (do not retry)
@@ -267,15 +265,17 @@
end
options = Kernel.validate_options options,
only_local: false,
reset: false,
- checkout_only: false
+ checkout_only: false,
+ ignore_errors: false
+ ignore_errors = options.delete(:ignore_errors)
importdir = package.importdir
if File.directory?(importdir)
- package.isolate_errors(false) do
+ package.isolate_errors(mark_as_failed: false, ignore_errors: ignore_errors) do
if !options[:checkout_only] && package.update?
perform_update(package, options)
else
if Autobuild.verbose
package.message "%s: not updating"
@@ -285,10 +285,12 @@
end
elsif File.exist?(importdir)
raise ConfigException.new(package, 'import'), "#{importdir} exists but is not a directory"
else
- perform_checkout(package)
+ package.isolate_errors(mark_as_failed: true, ignore_errors: ignore_errors) do
+ perform_checkout(package)
+ end
end
end
# Tries to find a fallback importer because of the given error.
def fallback(error, package, *args, &block)