Class: Redmine::Scm::Adapters::CvsRevisionHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/scm/adapters/cvs_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(complete_rev) ⇒ CvsRevisionHelper

Returns a new instance of CvsRevisionHelper.



409
410
411
412
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 409

def initialize(complete_rev)
  @complete_rev = complete_rev
  parseRevision()
end

Instance Attribute Details

#baseObject

Returns the value of attribute base.



407
408
409
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 407

def base
  @base
end

#branchidObject

Returns the value of attribute branchid.



407
408
409
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 407

def branchid
  @branchid
end

#complete_revObject

Returns the value of attribute complete_rev.



407
408
409
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 407

def complete_rev
  @complete_rev
end

#revisionObject

Returns the value of attribute revision.



407
408
409
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 407

def revision
  @revision
end

Instance Method Details

#branchVersionObject



414
415
416
417
418
419
420
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 414

def branchVersion
  if isBranchRevision
    return @base + "." + @branchid
  end

  @base
end

#is_in_branch_with_symbol(branch_symbol) ⇒ Object



434
435
436
437
438
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 434

def is_in_branch_with_symbol(branch_symbol)
  bpieces = branch_symbol.split(".")
  branch_start = "#{bpieces[0..-3].join(".")}.#{bpieces[-1]}"
  (branchVersion == branch_start)
end

#isBranchRevisionObject



422
423
424
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 422

def isBranchRevision
  !@branchid.nil?
end

#prevRevObject



426
427
428
429
430
431
432
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 426

def prevRev
  unless @revision == 0
    return buildRevision(@revision - 1)
  end

  buildRevision(@revision)
end