class Drupid::DownloadStrategy::Mercurial

Public Class Methods

new(url, dest, name, download_specs = {}) click to toggle source
Calls superclass method Drupid::DownloadStrategy::Base::new
    # File lib/drupid/download_strategy.rb
460 def initialize  url, dest, name, download_specs = {}
461   super
462   @clone = @dest + @name
463 end

Public Instance Methods

fetch() click to toggle source
    # File lib/drupid/download_strategy.rb
465 def fetch
466   blah "Cloning #{@url}"
467 
468   unless @clone.exist?
469     url=@url.sub(%r[^hg://], '')
470     hg 'clone', url, @clone
471   else
472     blah "Updating #{@clone}"
473     Dir.chdir(@clone) do
474       hg 'pull'
475       hg 'update'
476     end
477   end
478 end
stage(wd = @dest) click to toggle source
    # File lib/drupid/download_strategy.rb
480 def stage wd = @dest
481   fetch unless @co.exist?
482   dont_debug { wd.mkpath }
483   debug "Staging into #{wd}"
484   dst = wd + @co.basename
485   Dir.chdir @clone do
486     #if @spec and @ref
487     # blah "Checking out #{@spec} #{@ref}"
488     # Dir.chdir @clone do
489     #   safe_system 'hg', 'archive', '-y', '-r', @ref, '-t', 'files', dst
490     # end
491     #else
492       hg 'archive', '-y', '-t', 'files', dst
493     #end
494   end
495 end