Class: BuildTool::VCS::GitSvnConfiguration

Inherits:
GitConfiguration show all
Defined in:
lib/build-tool/vcs/git-svn.rb

Instance Attribute Summary collapse

Attributes inherited from GitConfiguration

#global_options, #options, #remote

Attributes inherited from BaseConfiguration

#module

Instance Method Summary collapse

Methods inherited from GitConfiguration

#merged_global_options, #merged_options, #merged_remote, #track_branch, #track_remote

Methods included from MJ::Mixins::InheritedAttributes

included

Methods inherited from BaseConfiguration

#local_path

Constructor Details

#initializeGitSvnConfiguration

Returns a new instance of GitSvnConfiguration.



17
18
19
20
21
22
# File 'lib/build-tool/vcs/git-svn.rb', line 17

def initialize
    super
    @externals = {}
    @repository = nil
    @remote_path = nil
end

Instance Attribute Details

#externalsObject (readonly)

Returns the value of attribute externals.



15
16
17
# File 'lib/build-tool/vcs/git-svn.rb', line 15

def externals
  @externals
end

#remote_pathObject



52
53
54
55
56
# File 'lib/build-tool/vcs/git-svn.rb', line 52

def remote_path
    return @remote_path if @remote_path
    return parent.remote_path if @parent
    return @module.name
end

#repositoryObject

Raises:



45
46
47
48
49
# File 'lib/build-tool/vcs/git-svn.rb', line 45

def repository
    return @repository if @repository             # Our repository
    return parent.repository if @parent       # Our parents repository
    raise ConfigurationError, "No repository configured for module #{self.module ? self.module.name : 'unknown' }."
end

Instance Method Details

#add_external(local, target) ⇒ Object



35
36
37
# File 'lib/build-tool/vcs/git-svn.rb', line 35

def add_external( local, target )
    @externals[local] = target
end

#copy_configuration(other) ⇒ Object



39
40
41
42
# File 'lib/build-tool/vcs/git-svn.rb', line 39

def copy_configuration( other )
    super
    @externals = {}     # Do not copy the externals
end

#merged_externalsObject



24
25
26
27
# File 'lib/build-tool/vcs/git-svn.rb', line 24

def merged_externals
    return parent.merged_externals.merge( @externals ) if @parent         # We have a parent. Merge with it
    return @externals                                                     # No parent, no global. Just us
end

#nameObject



11
12
13
# File 'lib/build-tool/vcs/git-svn.rb', line 11

def name
    "git-svn"
end

#trackObject



58
59
60
61
62
# File 'lib/build-tool/vcs/git-svn.rb', line 58

def track
    return @track if @track             # Our track
    return parent.track if @parent      # Out parents track
    "remotes/git-svn"
end

#vcs(mod) ⇒ Object

Raises:

  • (StandardError)


29
30
31
32
33
# File 'lib/build-tool/vcs/git-svn.rb', line 29

def vcs( mod )
    raise StandardError if @module and ! mod.equal?( @module )
    @module = mod
    GitSvn.new( self )
end