Class | RSCM::SubversionLogParser |
In: |
lib/rscm/scm/subversion_log_parser.rb
|
Parent: | Object |
# File lib/rscm/scm/subversion_log_parser.rb, line 10 10: def initialize(io, url, exclude_below_and_including=nil, exclude_above_and_including=nil, path=nil) 11: @io = io 12: @revision_parser = SubversionLogEntryParser.new(url, path) 13: @exclude_below_and_including = exclude_below_and_including 14: @exclude_above_and_including = exclude_above_and_including 15: end
# File lib/rscm/scm/subversion_log_parser.rb, line 17 17: def parse_revisions(&line_proc) 18: # skip over the first ------ 19: @revision_parser.parse(@io, true, &line_proc) 20: revisions = Revisions.new 21: while(!@io.eof?) 22: revision = @revision_parser.parse(@io, &line_proc) 23: unless(revision.nil?) 24: # Filter out the lower bound to avoid inclusiveness of the lower bound (see contract) 25: # We're doing this instead of increasing the from_identifer with 1, since that causes an error. 26: too_low = false 27: too_high = false 28: next if revision.time.nil? 29: if(@exclude_below_and_including.is_a? Time) 30: too_low = revision.time <= @exclude_below_and_including 31: elsif(@exclude_below_and_including.is_a? Numeric) 32: too_low = revision.identifier <= @exclude_below_and_including 33: end 34: 35: if(@exclude_above_and_including.is_a? Time) 36: too_high = revision.time >= @exclude_above_and_including 37: elsif(@exclude_above_and_including.is_a? Numeric) 38: too_high = revision.identifier >= @exclude_above_and_including 39: end 40: revisions.add(revision) unless too_low || too_high 41: end 42: end 43: revisions 44: end