Module: Amp::Core::Repositories::CommonVersionedFileMethods
- Included in:
- AbstractVersionedFile
- Defined in:
- lib/amp-core/repository/abstract/common_methods/versioned_file.rb
Overview
CommonVersionedFileMethods
These methods are common to all repositories, and this module is mixed into the AbstractLocalRepository class. This guarantees that all repositories will have these methods.
No methods should be placed into this module unless it relies on methods in the general API for repositories.
Instance Method Summary collapse
-
#===(other) ⇒ Boolean
Compares two versioned files - namely, their data.
-
#branch ⇒ String
The branch this tracked file belongs to.
-
#children ⇒ Object
Working directory has no children!.
-
#clean? ⇒ Boolean
Returns if the file has been changed since its parent.
-
#date ⇒ DateTime
Date this revision to this file was committed.
-
#description ⇒ String
The description of the commit that contained this file revision.
- #unified_diff_with(other_vf, opts = {}) ⇒ Object
-
#user ⇒ String
User who committed this revision to this file.
Instance Method Details
#===(other) ⇒ Boolean
Compares two versioned files - namely, their data.
42 43 44 45 |
# File 'lib/amp-core/repository/abstract/common_methods/versioned_file.rb', line 42 def ===(other) self.path == other.path && self.data == other.data end |
#branch ⇒ String
The branch this tracked file belongs to
79 |
# File 'lib/amp-core/repository/abstract/common_methods/versioned_file.rb', line 79 def branch; changeset.branch; end |
#children ⇒ Object
Working directory has no children!
83 |
# File 'lib/amp-core/repository/abstract/common_methods/versioned_file.rb', line 83 def children; []; end |
#clean? ⇒ Boolean
Returns if the file has been changed since its parent. Slow. If your implementation has a fast way of doing this, we recommend you override this method.
52 53 54 |
# File 'lib/amp-core/repository/abstract/common_methods/versioned_file.rb', line 52 def clean? self === parents.first end |
#date ⇒ DateTime
Date this revision to this file was committed
67 |
# File 'lib/amp-core/repository/abstract/common_methods/versioned_file.rb', line 67 def date; changeset.date; end |
#description ⇒ String
The description of the commit that contained this file revision
73 |
# File 'lib/amp-core/repository/abstract/common_methods/versioned_file.rb', line 73 def description; changeset.description; end |
#unified_diff_with(other_vf, opts = {}) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/amp-core/repository/abstract/common_methods/versioned_file.rb', line 30 def unified_diff_with(other_vf, opts = {}) Diffs::Mercurial::MercurialDiff.unified_diff(self.data, self.changeset.easy_date, other_vf.data, other_vf.changeset.easy_date, self.path, other_vf.path || "/dev/null", false, opts) end |
#user ⇒ String
User who committed this revision to this file
61 |
# File 'lib/amp-core/repository/abstract/common_methods/versioned_file.rb', line 61 def user; changeset.user; end |