Module: Amp::Repositories::CommonVersionedFileMethods
- Included in:
- AbstractVersionedFile
- Defined in:
- lib/amp/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.
27 28 29 30 |
# File 'lib/amp/repository/abstract/common_methods/versioned_file.rb', line 27 def ===(other) self.path == other.path && self.data == other.data end |
#branch ⇒ String
The branch this tracked file belongs to
64 |
# File 'lib/amp/repository/abstract/common_methods/versioned_file.rb', line 64 def branch; changeset.branch; end |
#children ⇒ Object
Working directory has no children!
68 |
# File 'lib/amp/repository/abstract/common_methods/versioned_file.rb', line 68 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.
37 38 39 |
# File 'lib/amp/repository/abstract/common_methods/versioned_file.rb', line 37 def clean? self === parents.first end |
#date ⇒ DateTime
Date this revision to this file was committed
52 |
# File 'lib/amp/repository/abstract/common_methods/versioned_file.rb', line 52 def date; changeset.date; end |
#description ⇒ String
The description of the commit that contained this file revision
58 |
# File 'lib/amp/repository/abstract/common_methods/versioned_file.rb', line 58 def description; changeset.description; end |
#unified_diff_with(other_vf, opts = {}) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/amp/repository/abstract/common_methods/versioned_file.rb', line 15 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
46 |
# File 'lib/amp/repository/abstract/common_methods/versioned_file.rb', line 46 def user; changeset.user; end |