Class: PuppetFixtures::Repository::Mercurial

Inherits:
Base
  • Object
show all
Defined in:
lib/puppet_fixtures.rb

Instance Method Summary collapse

Methods inherited from Base

#download, #initialize

Constructor Details

This class inherits a constructor from PuppetFixtures::Repository::Base

Instance Method Details

#clone(flags = nil) ⇒ Object



558
559
560
561
562
563
564
565
# File 'lib/puppet_fixtures.rb', line 558

def clone(flags = nil)
  command = %w[hg clone]
  command.push('-b', @branch) if @branch
  command.push(flags) if flags
  command.push(@remote, @target)

  run_command(command)
end

#remote_url_changed?Boolean

Returns:

  • (Boolean)


581
582
583
584
# File 'lib/puppet_fixtures.rb', line 581

def remote_url_changed?
  # Not implemented
  false
end

#revisionObject



571
572
573
574
575
576
577
578
579
# File 'lib/puppet_fixtures.rb', line 571

def revision
  return true unless @ref

  command = ['hg', 'update', '--clean', '-r', @ref]
  result = run_command(command, chdir: @target)
  raise "Invalid ref #{@ref} for #{@target}" unless result

  result
end

#updateObject



567
568
569
# File 'lib/puppet_fixtures.rb', line 567

def update
  run_command(%w[hg pull])
end