Sha256: dde150652f3ebf2cf052c1c0c5bd1c541c32fa47dd705b187af88f18dcbe9bc8

Contents?: true

Size: 656 Bytes

Versions: 34

Compression:

Stored size: 656 Bytes

Contents

module OhlohScm::Adapters
	class HgAdapter < AbstractAdapter

		def pull(from, &block)
			raise ArgumentError.new("Cannot pull from #{from.inspect}") unless from.is_a?(HgAdapter)
			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 "hg clone -U '#{from.url}' '#{self.url}'"
			else
        branch_opts = "-r #{ from.branch_name }" if branch_name
				run "cd '#{self.url}' && hg revert --all && hg pull #{ branch_opts } -u -y '#{from.url}'"
			end

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

	end
end

Version data entries

34 entries across 34 versions & 1 rubygems

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