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



579
580
581
582
583
584
585
586
# File 'lib/puppet_fixtures.rb', line 579

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)


602
603
604
605
# File 'lib/puppet_fixtures.rb', line 602

def remote_url_changed?
  # Not implemented
  false
end

#revisionObject



592
593
594
595
596
597
598
599
600
# File 'lib/puppet_fixtures.rb', line 592

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



588
589
590
# File 'lib/puppet_fixtures.rb', line 588

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