Method: Origen::RevisionControl::Base#changes

Defined in:
lib/origen/revision_control/base.rb

#changes(dir = nil, options = {}) ⇒ Object

Returns a hash containing the list of files that have changes compared to the given tag or compared to the latest version (on the server).

{
  :added => [],           # Paths to files that have been added since the previous tag
  :removed => [],         # Paths to files that have been removed since the previous tag
  :changed => [],         # Paths to files that have changed since the previous tag
  :present => true/false, # Convenience attribute for the caller to check if there are any changes, when
                          # true at least one of the other arrays will contain a value
}

The dir argument is optional and when not supplied the entire directory will be checked for changes.

Note that added files only refers to those files which have been checked into revision control since the compared to version, it does not refer to unmanaged files in the workspace. Use the unmanaged method to get a list of those.

Note also that while a file is considered added or removed depends on the chronological relationship between the current version (the user’s workspace) and the reference version. If the reference version is older than the current version (i.e. an earlier tag), then an added file means a file that the current version has and the reference (previous) version did not have.

However if the reference version is newer than the current version (e.g. when comparing to a newer tag or the latest version on the server), then an added file means a file that the current version does not have and which has been added in a newer version of the remote directory.

Parameters:

  • dir (String, Pathname) (defaults to: nil)

    The path to a sub-directory to check for changes, it can either be a relative path or an absolute path to either the local or remote locations.

  • options (Hash) (defaults to: {})

    Options to customize the operation

Options Hash (options):

  • :version (String) — default: nil

    A specific version to compare against, will compare to latest if not supplied

  • :verbose (Boolean) — default: false

    When true will show the command being executed and the raw output from the underlying revision control tool. When false will show nothing. False is the default as with this command the user is more concerned with seeing the organized summary that is returned from this method.


120
121
122
# File 'lib/origen/revision_control/base.rb', line 120

def changes(dir = nil, options = {})
  fail "The #{self.class} driver does not support the changes method!"
end