Module: Pullr::SCM::Mercurial

Includes:
CommandLine
Defined in:
lib/pullr/scm/mercurial.rb

Instance Method Summary collapse

Methods included from CommandLine

#cd, #sh

Instance Method Details

#scm_pull(uri, dest = nil) ⇒ Object

Pulls down a copy of a Mercurial repository.

Parameters:

  • uri (Addressable::URI)

    The URI of the Mercurial repository.

  • dest (String) (defaults to: nil)

    Optional destination to pull the repository down into.



17
18
19
20
21
22
23
# File 'lib/pullr/scm/mercurial.rb', line 17

def scm_pull(uri,dest=nil)
  if dest
    sh 'hg', 'clone', uri, dest
  else
    sh 'hg', 'clone', uri
  end
end

#scm_update(path, uri = nil) ⇒ Object

Updates a local Mercurial repository.

Parameters:

  • path (String)

    Path to the local repository to update.

  • uri (Addressable::URI) (defaults to: nil)

    Optional URI of the remote Mercurial repository to update from.



34
35
36
37
38
39
# File 'lib/pullr/scm/mercurial.rb', line 34

def scm_update(path,uri=nil)
  cd(path) do
    sh 'hg', 'pull'
    sh 'hg', 'update', '-C'
  end
end