Sha256: 4dd5f540aa216e04e669d01b77e657150bbffff389cab6374754c426779c90be

Contents?: true

Size: 1.52 KB

Versions: 6

Compression:

Stored size: 1.52 KB

Contents

require 'build-tool/application'
require 'build-tool/commands'

module BuildTool; module Commands;

    class CtagsError < BuildTool::Error; end
    #
    # BuildCommand
    #
    class Fetch < ModuleBasedCommand

        include MJ::Tools::SubProcess

        name        "fetch"
        description "fetch remote changes (if applicable)"
        long_description [ "Invoke the fetch phase for the given modules. It depends on the modules",
                           "VCS if this command has any effect." ]


        # Log this command if $noop is not active
        def log?
            ! $noop
        end

        def applicable?
            BuildTool::Application.instance.name != "build-tool"
        end

        def initialize_options
            @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULES..."
            super
        end

        def is_module_ready?( mod )
            isready = true
            isready &= mod.prepare_for_vcs_access
            if !mod.vcs.fetching_supported?
                logger.warn "#{mod.name}: fetching not support by #{mod.vcs.name} -> implicit rebase."
            end
            return isready
        end

        def do_execute_module( mod )

            if mod.checkedout?
                fetch( mod )
            else
                clone( mod )
            end

        end

        def do_execute( args )
            rc = super(args)
            MJ::Tools::SSH::cleanup()
            return rc
        end

    end # class Build

end; end # module BuildTool::Commands


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
build-tool-0.4.1 lib/build-tool/commands/fetch.rb
build-tool-0.4.0 lib/build-tool/commands/fetch.rb
build-tool-0.3.3 lib/build-tool/commands/fetch.rb
build-tool-0.3.2 lib/build-tool/commands/fetch.rb
build-tool-0.3.1 lib/build-tool/commands/fetch.rb
build-tool-0.3 lib/build-tool/commands/fetch.rb