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


374
375
376
377
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 374

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

Instance Attribute Details

#baseObject

Returns the value of attribute base


372
373
374
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 372

def base
  @base
end

#branchidObject

Returns the value of attribute branchid


372
373
374
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 372

def branchid
  @branchid
end

#complete_revObject

Returns the value of attribute complete_rev


372
373
374
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 372

def complete_rev
  @complete_rev
end

#revisionObject

Returns the value of attribute revision


372
373
374
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 372

def revision
  @revision
end

Instance Method Details

#branchPointObject


379
380
381
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 379

def branchPoint
  return @base
end

#branchVersionObject


383
384
385
386
387
388
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 383

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

#is_in_branch_with_symbol(branch_symbol) ⇒ Object


401
402
403
404
405
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 401

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

#isBranchRevisionObject


390
391
392
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 390

def isBranchRevision
  !@branchid.nil?
end

#prevRevObject


394
395
396
397
398
399
# File 'lib/redmine/scm/adapters/cvs_adapter.rb', line 394

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