Class: Capistrano::Deploy::SCM::Cvs

### Home Classes Methods

### In Files

- lib/capistrano/recipes/deploy/scm/cvs.rb

### Parent

Capistrano::Deploy::SCM::Base

### Methods

- #checkout
- #diff
- #export
- #handle_data
- #head
- #log
- #query_revision
- #sync

### Files

- help.txt

### Class/Module Index

Quicksearch

- Capistrano
- Capistrano::CLI
- Capistrano::CLI::Execute
- Capistrano::CLI::Execute::ClassMethods
- Capistrano::CLI::Help
- Capistrano::CLI::Options
- Capistrano::CLI::Options::ClassMethods
- Capistrano::CLI::UI
- Capistrano::CLI::UI::ClassMethods
- Capistrano::Callback
- Capistrano::Command
- Capistrano::Command::Tree
- Capistrano::Command::Tree::Branch
- Capistrano::Command::Tree::ConditionBranch
- Capistrano::Command::Tree::ConditionBranch::Evaluator
- Capistrano::Command::Tree::ElseBranch
- Capistrano::Configuration
- Capistrano::Configuration::Actions
- Capistrano::Configuration::Actions::FileTransfer
- Capistrano::Configuration::Actions::Inspect
- Capistrano::Configuration::Actions::Invocation
- Capistrano::Configuration::Actions::Invocation::ClassMethods
- Capistrano::Configuration::AliasTask
- Capistrano::Configuration::Callbacks
- Capistrano::Configuration::Connections
- Capistrano::Configuration::Execution
- Capistrano::Configuration::Loading
- Capistrano::Configuration::Loading::ClassMethods
- Capistrano::Configuration::LogFormatters
- Capistrano::Configuration::Namespaces
- Capistrano::Configuration::Namespaces::Namespace
- Capistrano::Configuration::Roles
- Capistrano::Configuration::Servers
- Capistrano::Configuration::Variables
- Capistrano::Deploy
- Capistrano::Deploy::Dependencies
- Capistrano::Deploy::LocalDependency
- Capistrano::Deploy::RemoteDependency
- Capistrano::Deploy::SCM
- Capistrano::Deploy::SCM::Accurev
- Capistrano::Deploy::SCM::Accurev::InternalRevision
- Capistrano::Deploy::SCM::Base
- Capistrano::Deploy::SCM::Base::LocalProxy
- Capistrano::Deploy::SCM::Bzr
- Capistrano::Deploy::SCM::Cvs
- Capistrano::Deploy::SCM::Darcs
- Capistrano::Deploy::SCM::Git
- Capistrano::Deploy::SCM::Mercurial
- Capistrano::Deploy::SCM::None
- Capistrano::Deploy::SCM::Perforce
- Capistrano::Deploy::SCM::Subversion
- Capistrano::Deploy::Strategy
- Capistrano::Deploy::Strategy::Base
- Capistrano::Deploy::Strategy::Checkout
- Capistrano::Deploy::Strategy::Copy
- Capistrano::Deploy::Strategy::Export
- Capistrano::Deploy::Strategy::Remote
- Capistrano::Deploy::Strategy::RemoteCache
- Capistrano::Deploy::Strategy::UnsharedRemoteCache
- Capistrano::ProcCallback
- Capistrano::Processable
- Capistrano::Processable::SessionAssociation
- Capistrano::RemoteError
- Capistrano::Role
- Capistrano::Role::DynamicServerList
- Capistrano::SSH
- Capistrano::ServerDefinition
- Capistrano::Shell
- Capistrano::TaskCallback
- Capistrano::TaskDefinition
- Capistrano::Transfer
- Capistrano::Transfer::SFTPTransferWrapper
- Capistrano::Version
- Kernel
- Object
- String

No matching classes.

# Capistrano::Deploy::SCM::Cvs

Implements the Capistrano SCM interface for the CVS revision control system.

### Public Instance Methods

checkout(revision, destination) click to toggle source

Returns the command that will check out the given revision to the given destination.

    # File lib/capistrano/recipes/deploy/scm/cvs.rb, line 22
    def checkout(revision, destination)
      [ prep_destination(destination),
        scm(verbose, cvs_root, :checkout, cvs_revision(revision), cvs_destination(destination), variable(:scm_module))
      ].join(' && ')
    end

diff(from, to=nil) click to toggle source

Returns the command that will do an "cvs diff" for the two revisions.

    # File lib/capistrano/recipes/deploy/scm/cvs.rb, line 45
    def diff(from, to=nil)
      rev_type = revision_type(from)
      if rev_type == :date
        range_args = "-D '#{from}' -D '#{to || 'now'}'"
      else
        range_args = "-r '#{from}' -r '#{to || head}'"
      end
      scm cvs_root, :diff, range_args
    end

export(revision, destination) click to toggle source

Returns the command that will do an "cvs export" of the given revision to the given destination.

    # File lib/capistrano/recipes/deploy/scm/cvs.rb, line 38
    def export(revision, destination)
      [ prep_destination(destination),
        scm(verbose, cvs_root, :export, cvs_revision(revision), cvs_destination(destination), variable(:scm_module))
      ].join(' && ')
    end

handle_data(state, stream, text) click to toggle source

Determines what the response should be for a particular bit of text from the SCM. Password prompts, connection requests, passphrases, etc. are handled here.

    # File lib/capistrano/recipes/deploy/scm/cvs.rb, line 82
    def handle_data(state, stream, text)
      logger.info "[#{stream}] #{text}"
      case text
      when /\bpassword.*:/
        # prompting for a password
        %("#{variable(:scm_password) || variable(:password)}"\n)
      when %{\(yes/no\)}
        # let's be agreeable...
        "yes\n"
      end
    end

head() click to toggle source

CVS understands 'HEAD' to refer to the latest revision in the repository.

    # File lib/capistrano/recipes/deploy/scm/cvs.rb, line 16
    def head
      "HEAD"
    end

log(from, to=nil) click to toggle source

Returns an "cvs log" command for the two revisions.

    # File lib/capistrano/recipes/deploy/scm/cvs.rb, line 56
    def log(from, to=nil)
      rev_type = revision_type(from)
      if rev_type == :date
        range_arg = "-d '#{from}<#{to || 'now'}'"
      else
        range_arg = "-r '#{from}:#{to || head}'"
      end
      scm cvs_root, :log, range_arg
    end

query_revision(revision) click to toggle source

Unfortunately, cvs doesn't support the concept of a revision number like subversion and other SCM's do. For now, we'll rely on getting the timestamp of the latest checkin under the revision that's passed to us.

    # File lib/capistrano/recipes/deploy/scm/cvs.rb, line 69
    def query_revision(revision)
      return revision if revision_type(revision) == :date
      revision = yield(scm(cvs_root, :log, "-r#{revision}")).
                   split("\n").
                   select { |line| line =~ /^date:/ }.
                   map { |line| line[/^date: (.*?);/, 1] }.
                   sort.last + " UTC"
      return revision
    end

sync(revision, destination) click to toggle source

Returns the command that will do an "cvs update" to the given revision, for the working copy at the given destination.

    # File lib/capistrano/recipes/deploy/scm/cvs.rb, line 30
    def sync(revision, destination)
      [ prep_destination(destination),
        scm(verbose, cvs_root, :update, cvs_revision(revision), cvs_destination(destination))
      ].join(' && ')
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.