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