Sha256: 167057c787278554f0f1e189bee08810e92ecf66132a9d41960a7868601debfa

Contents?: true

Size: 578 Bytes

Versions: 37

Compression:

Stored size: 578 Bytes

Contents

module OhlohScm::Adapters
	class BzrAdapter < AbstractAdapter

		def pull(from, &block)
			raise ArgumentError.new("Cannot pull from #{from.inspect}") unless from.is_a?(BzrAdapter)
			logger.info { "Pulling #{from.url}" }

			yield(0,1) if block_given? # Progress bar callback

			unless self.exist?
				run "mkdir -p '#{self.url}'"
				run "rm -rf '#{self.url}'"
				run "bzr branch '#{from.url}' '#{self.url}'"
			else
				run "cd '#{self.url}' && bzr revert && bzr pull --overwrite '#{from.url}'"
			end

			yield(1,1) if block_given? # Progress bar callback
		end

	end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ohloh_scm-2.5.1 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.14 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.13 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.12 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.11 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.10 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.9 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.8 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.7 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.6 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.5 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.4 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.3 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.1 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.4.0 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.3.5 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.3.4 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.3.2 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.3.1 lib/ohloh_scm/adapters/bzr/pull.rb
ohloh_scm-2.3.0 lib/ohloh_scm/adapters/bzr/pull.rb