Method: Autoproj::VCSDefinition#update

Defined in:
lib/autoproj/vcs_definition.rb

#update(spec, from: nil, raw: Array.new) ⇒ VCSDefinition

Update this VCS definition with new information / options and return the updated definition

Returns:



78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/autoproj/vcs_definition.rb', line 78

def update(spec, from: nil, raw: Array.new)
    new = self.class.normalize_vcs_hash(spec)
    new_raw = Array.new
    new_history = Array.new

    # If the type changed, we replace the old definition by the new one
    # completely. Otherwise, we append it to the current one
    if !new.has_key?(:type) || (type == new[:type])
        new = to_hash.merge(new)
        new_raw = self.raw + raw
        new_history = history
    end
    self.class.from_raw(new, from: from, history: new_history, raw: new_raw)
end