community.general.hg (8.5.0) — module

Manages Mercurial (hg) repositories

Authors: Yeukhon Wong (@yeukhon)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manages Mercurial (hg) repositories. Supports SSH, HTTP/S and local address.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the current working copy is inside the stable branch and deletes untracked files if any.
  community.general.hg:
    repo: https://bitbucket.org/user/repo1
    dest: /home/user/repo1
    revision: stable
    purge: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get information about the repository whether or not it has already been cloned locally.
  community.general.hg:
    repo: git://bitbucket.org/user/repo
    dest: /srv/checkout
    clone: false
    update: false

Inputs

    
dest:
    description:
    - Absolute path of where the repository should be cloned to. This parameter is required,
      unless clone and update are set to no
    type: path

repo:
    aliases:
    - name
    description:
    - The repository address.
    required: true
    type: str

clone:
    default: true
    description:
    - If V(false), do not clone the repository if it does not exist locally.
    type: bool

force:
    default: false
    description:
    - Discards uncommitted changes. Runs C(hg update -C).
    type: bool

purge:
    default: false
    description:
    - Deletes untracked files. Runs C(hg purge).
    type: bool

update:
    default: true
    description:
    - If V(false), do not retrieve new revisions from the origin repository
    type: bool

revision:
    aliases:
    - version
    description:
    - Equivalent C(-r) option in hg command which could be the changeset, revision number,
      branch name or even tag.
    type: str

executable:
    description:
    - Path to hg executable to use. If not supplied, the normal mechanism for resolving
      binary paths will be used.
    type: str