Represents a file within a Revision, and also information about how this file was modified compared with the previous revision.
The native SCM's revision for this file. For non-transactional SCMs this is different from the parent Revision's
# File lib/rscm/revision_file.rb, line 34 def initialize(path=nil, status=nil, developer=nil, message=nil, native_revision_identifier=nil, time=nil) @path, @developer, @message, @native_revision_identifier, @time, @status = path, developer, message, native_revision_identifier, time, status end
# File lib/rscm/revision_file.rb, line 74 def ==(other) return false if !other.is_a?(self.class) self.status == other.status && self.path == other.path && self.developer == other.developer && self.message == other.message && self.native_revision_identifier == other.native_revision_identifier && self.time == other.time end
Accepts a visitor that must respond to +visit_file(revision_file)+
# File lib/rscm/revision_file.rb, line 65 def accept(visitor) visitor.visit_file(self) end
Yields the diff as an IO for this file
# File lib/rscm/revision_file.rb, line 54 def diff(scm, options={}, &block) from_to = case status when /#{RevisionFile::MODIFIED}/; [previous_native_revision_identifier, native_revision_identifier] when /#{RevisionFile::DELETED}/; [previous_native_revision_identifier, nil] when /#{RevisionFile::ADDED}/; [nil, native_revision_identifier] end scm.diff(path, from_to[0], from_to[1], options, &block) end
Generated with the Darkfish Rdoc Generator 2.