# salt.modules.hg

Support for the Mercurial SCM

salt.modules.hg.archive(cwd, output, rev='tip', fmt=None, prefix=None, user=None)

  Export a tarball from the repository

  cwd

    The path to the Mercurial repository

  output

    The path to the archive tarball

  rev: tip

    The revision to create an archive from

  fmt: None

    Format of the resulting archive. Mercurial supports: tar, tbz2, tgz, zip, uzip, and files formats.

  prefixNone

    Prepend <prefix>/ to every filename in the archive

  userNone

    Run hg as a user other than what the minion runs as

  If `prefix` is not specified it defaults to the basename of the repo directory.

  CLI Example:

      salt '*' hg.archive /path/to/repo output=/tmp/archive.tgz fmt=tgz

salt.modules.hg.clone(cwd, repository, opts=None, user=None, identity=None)

  Clone a new repository

  cwd

    The path to the Mercurial repository

  repository

    The hg URI of the repository

  optsNone

    Any additional options to add to the command line

  userNone

    Run hg as a user other than what the minion runs as

  identityNone

    Private SSH key on the minion server for authentication (ssh://)

    Added in version 2015.5.0.

  CLI Example:

      salt '*' hg.clone /path/to/repo https://bitbucket.org/birkenfeld/sphinx

salt.modules.hg.describe(cwd, rev='tip', user=None)

  Mimic git describe and return an identifier for the given revision

  cwd

    The path to the Mercurial repository

  rev: tip

    The path to the archive tarball

  userNone

    Run hg as a user other than what the minion runs as

  CLI Example:

      salt '*' hg.describe /path/to/repo

salt.modules.hg.pull(cwd, opts=None, user=None, identity=None, repository=None)

  Perform a pull on the given repository

  cwd

    The path to the Mercurial repository

  repositoryNone

    Perform pull from the repository different from .hg/hgrc:[paths]:default

  optsNone

    Any additional options to add to the command line

  userNone

    Run hg as a user other than what the minion runs as

  identityNone

    Private SSH key on the minion server for authentication (ssh://)

    Added in version 2015.5.0.

  CLI Example:

      salt '*' hg.pull /path/to/repo opts=-u

salt.modules.hg.revision(cwd, rev='tip', short=False, user=None)

  Returns the long hash of a given identifier (hash, branch, tag, HEAD, etc)

  cwd

    The path to the Mercurial repository

  rev: tip

    The revision

  short: False

    Return an abbreviated commit hash

  userNone

    Run hg as a user other than what the minion runs as

  CLI Example:

      salt '*' hg.revision /path/to/repo mybranch

salt.modules.hg.status(cwd, opts=None, user=None)

  Show changed files of the given repository

  cwd

    The path to the Mercurial repository

  optsNone

    Any additional options to add to the command line

  userNone

    Run hg as a user other than what the minion runs as

  CLI Example:

      salt '*' hg.status /path/to/repo

salt.modules.hg.update(cwd, rev, force=False, user=None)

  Update to a given revision

  cwd

    The path to the Mercurial repository

  rev

    The revision to update to

  forceFalse

    Force an update

  userNone

    Run hg as a user other than what the minion runs as

  CLI Example:

      salt devserver1 hg.update /path/to/repo somebranch