Class | RSCM::HistoricFile |
In: |
lib/rscm/historic_file.rb
|
Parent: | Object |
Represents the full history of a single file or directory.
relative_path | [R] |
# File lib/rscm/historic_file.rb, line 6 6: def initialize(relative_path, directory, scm) 7: raise "Not a String: '#{relative_path}' (#{relative_path.class.name})" unless relative_path.is_a? String 8: @relative_path, @directory, @scm = relative_path, directory, scm 9: end
# File lib/rscm/historic_file.rb, line 29 29: def children 30: raise "Not a directory" unless directory? 31: @scm.ls(@relative_path) 32: end
Returns an Array of RevisionFile - from Time.epoch until Time.infinity (now)
# File lib/rscm/historic_file.rb, line 16 16: def revision_files 17: @scm.revisions(Time.epoch, Time.infinity, @relative_path).collect do |revision| 18: if revision.files.length != 1 19: files_s = revision.files.collect{|f| f.to_s}.join("\n") 20: raise "The file-specific revision didn't have exactly one file, but #{revision.files.length}:\n#{files_s}" 21: end 22: if(!revision.files[0].path.eql?(@relative_path)) 23: raise "The file-specific revision didn't have expected path '#{@relative_path}', but '#{revision.files[0].path}'" 24: end 25: revision.files[0] 26: end 27: end