Class: Capistrano::Deploy::SCM::Bzr

### Home Classes Methods

### In Files

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

### Parent

Capistrano::Deploy::SCM::Base

### Methods

- #checkout
- #diff
- #export
- #head
- #log
- #next_revision
- #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::Bzr

Implements the Capistrano SCM interface for the Bazaar-NG revision control system (bazaar-vcs.org/).

### 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/bzr.rb, line 23
    def checkout(revision, destination)
      scm :checkout, "--lightweight", revswitch(revision), repository, destination
    end

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

The bzr "diff" command doesn't accept a repository argument, so it must be run from within a working tree.

    # File lib/capistrano/recipes/deploy/scm/bzr.rb, line 43
    def diff(from, to=nil)
      switch = "-r#{from}"
      switch << "..#{to}" if to

      scm :diff, switch
    end

export(revision, destination) click to toggle source

The bzr 'export' does an export similar to other SCM systems

    # File lib/capistrano/recipes/deploy/scm/bzr.rb, line 37
    def export(revision, destination)
      scm :export, revswitch(revision), destination, repository
    end

head() click to toggle source

Bazaar-NG doesn't support any pseudo-id's, so we'll use the convention in this adapter that the :head symbol means the most recently committed revision.

    # File lib/capistrano/recipes/deploy/scm/bzr.rb, line 17
    def head
      :head
    end

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

Returns a log of changes between the two revisions (inclusive).

    # File lib/capistrano/recipes/deploy/scm/bzr.rb, line 51
    def log(from, to=nil)
      scm :log, "--short", "-r#{from}..#{to}", repository
    end

next_revision(revision) click to toggle source

Increments the given revision number and returns it.

    # File lib/capistrano/recipes/deploy/scm/bzr.rb, line 69
    def next_revision(revision)
      revision.to_i + 1
    end

query_revision(revision) click to toggle source

Attempts to translate the given revision identifier to a "real" revision. If the identifier is :head, the "bzr revno" command will be yielded, and the block must execute the command and return the output. The revision will be extracted from the output and returned. If the 'revision' argument, on the other hand, is not :head, it is simply returned.

    # File lib/capistrano/recipes/deploy/scm/bzr.rb, line 61
    def query_revision(revision)
      return revision unless :head == revision

      command = scm('revno', repository)
      result = yield(command)
    end

sync(revision, destination) click to toggle source

The bzr 'update' command does not support updating to a specific revision, so this just does update, followed by revert (unless updating to head).

    # File lib/capistrano/recipes/deploy/scm/bzr.rb, line 30
    def sync(revision, destination)
      commands = [scm(:update, destination)]
      commands << [scm(:revert, revswitch(revision), destination)] if revision != head
      commands.join(" && ")
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.