Merge pull request #2727 from reitermarkus/refactor-formula-versions
Refactor `FormulaVersions`.
This commit is contained in:
commit
515411707a
@ -17,6 +17,7 @@ class FormulaVersions
|
|||||||
@repository = formula.tap.path
|
@repository = formula.tap.path
|
||||||
@entry_name = @path.relative_path_from(repository).to_s
|
@entry_name = @path.relative_path_from(repository).to_s
|
||||||
@current_formula = formula
|
@current_formula = formula
|
||||||
|
@formula_at_revision = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
def rev_list(branch)
|
def rev_list(branch)
|
||||||
@ -32,20 +33,20 @@ class FormulaVersions
|
|||||||
end
|
end
|
||||||
|
|
||||||
def formula_at_revision(rev)
|
def formula_at_revision(rev)
|
||||||
contents = file_contents_at_revision(rev)
|
Homebrew.raise_deprecation_exceptions = true
|
||||||
|
|
||||||
begin
|
yield @formula_at_revision[rev] ||= begin
|
||||||
Homebrew.raise_deprecation_exceptions = true
|
contents = file_contents_at_revision(rev)
|
||||||
yield nostdout { Formulary.from_contents(name, path, contents) }
|
nostdout { Formulary.from_contents(name, path, contents) }
|
||||||
rescue *IGNORED_EXCEPTIONS => e
|
|
||||||
# We rescue these so that we can skip bad versions and
|
|
||||||
# continue walking the history
|
|
||||||
ohai "#{e} in #{name} at revision #{rev}", e.backtrace if ARGV.debug?
|
|
||||||
rescue FormulaUnavailableError
|
|
||||||
# Suppress this error
|
|
||||||
ensure
|
|
||||||
Homebrew.raise_deprecation_exceptions = false
|
|
||||||
end
|
end
|
||||||
|
rescue *IGNORED_EXCEPTIONS => e
|
||||||
|
# We rescue these so that we can skip bad versions and
|
||||||
|
# continue walking the history
|
||||||
|
ohai "#{e} in #{name} at revision #{rev}", e.backtrace if ARGV.debug?
|
||||||
|
rescue FormulaUnavailableError
|
||||||
|
# Suppress this error
|
||||||
|
ensure
|
||||||
|
Homebrew.raise_deprecation_exceptions = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def bottle_version_map(branch)
|
def bottle_version_map(branch)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user