Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/modules/source_control/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zdd
l	Z	ddl
mZddlm
Z
d
efd��YZd�Zedkr�e�nd
S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�	
---
module: hg
short_description: Manages Mercurial (hg) repositories
description:
    - Manages Mercurial (hg) repositories. Supports SSH, HTTP/S and local address.
version_added: "1.0"
author: "Yeukhon Wong (@yeukhon)"
options:
    repo:
        description:
            - The repository address.
        required: yes
        aliases: [ name ]
    dest:
        description:
            - Absolute path of where the repository should be cloned to.
              This parameter is required, unless clone and update are set to no
        required: yes
    revision:
        description:
            - Equivalent C(-r) option in hg command which could be the changeset, revision number,
              branch name or even tag.
        aliases: [ version ]
    force:
        description:
            - Discards uncommitted changes. Runs C(hg update -C).  Prior to
              1.9, the default was `yes`.
        type: bool
        default: 'no'
    purge:
        description:
            - Deletes untracked files. Runs C(hg purge).
        type: bool
        default: 'no'
    update:
        description:
            - If C(no), do not retrieve new revisions from the origin repository
        type: bool
        default: 'yes'
        version_added: '2.0'
    clone:
        description:
            - If C(no), do not clone the repository if it does not exist locally.
        type: bool
        default: 'yes'
        version_added: '2.3'
    executable:
        description:
            - Path to hg executable to use. If not supplied,
              the normal mechanism for resolving binary paths will be used.
        version_added: '1.4'
notes:
    - This module does not support push capability. See U(https://github.com/ansible/ansible/issues/31156).
    - "If the task seems to be hanging, first verify remote host is in C(known_hosts).
      SSH will prompt user to authorize the first contact with a remote host.  To avoid this prompt,
      one solution is to add the remote host public key in C(/etc/ssh/ssh_known_hosts) before calling
      the hg module, with the following command: ssh-keyscan remote_host.com >> /etc/ssh/ssh_known_hosts."
    - As per 01 Dec 2018, Bitbucket has dropped support for TLSv1 and TLSv1.1 connections. As such,
      if the underlying system still uses a Python version below 2.7.9, you will have issues checking out
      bitbucket repositories. See U(https://bitbucket.org/blog/deprecating-tlsv1-tlsv1-1-2018-12-01).
s�
- name: Ensure the current working copy is inside the stable branch and deletes untracked files if any.
  hg:
    repo: https://bitbucket.org/user/repo1
    dest: /home/user/repo1
    revision: stable
    purge: yes

- name: Get information about the repository whether or not it has already been cloned locally.
  hg:
    repo: git://bitbucket.org/user/repo
    dest: /srv/checkout
    clone: no
    update: no
N(t
AnsibleModule(t	to_nativetHgcB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
ed��ZRS(
cC`s1||_||_||_||_||_dS(N(tmoduletdesttrepotrevisionthg_path(tselfRRR
RR((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyt__init__es
				cC`s2|jj|jg|�\}}}|||fS(N(Rtrun_commandR(Rt	args_listtrctoutterr((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyt_commandls%cC`s(dddd|jdg}|j|�S(Ntpurges--configsextensions.purge=s-Rs--print(RR(Rtargs((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyt_list_untrackedpscC`sf|jddddd|jg�\}}}|dkrO|jjd|�nt|�jd�Sd	S(
s[
        hg id -b -i -t returns a string in the format:
           "<changeset>[+] <branch_name> <tag>"
        This format lists the state of the current working copy,
        and indicates whether there are uncommitted changes by the
        plus sign. Otherwise, the sign is omitted.

        Read the full description via hg id --help
        tids-bs-is-ts-Ritmsgs
N(RRRt	fail_jsonR	tstrip(RRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pytget_revisionts
-cC`sZ|jd|jg�\}}}|dkrC|jjd|�nt|�jd�SdS(NRiRs
(RR
RRR	R(RRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pytget_remote_revision�s!cC`s$|j�}d|krtStSdS(Nt+(RtTruetFalse(Rtnow((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pythas_local_mods�scC`s�|j�}|stSddd|jddg}|j|�\}}}|dkrk|jjd|�n|j�}||kr�|r�tSdS(Ntupdates-Cs-Rs-rt.iR(R%R#RRRRR"(RtbeforeRRRRtafter((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pytdiscard�scC`s�|j�\}}}|dkr7|jjd|�n|dkr�dddd|jg}|j|�\}}}|dkr�|jjd|�ntStSdS(NiRtRs--configsextensions.purge=s-R(RRRRRR"R#(Rtrc1tout1terr1Rtrc2tout2terr2((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyR�scC`sNt}t}|r!|j�}n|r6|j�}n|sB|rFtStSdS(N(R#R*RR"(RtforceRt	discardedtpurged((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pytcleanup�scC`s|jdd|j|jg�S(Ntpulls-R(RRR
(R((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyR6�scC`sJ|jdk	r1|jdd|jd|jg�S|jdd|jg�S(NR&s-rs-R(RtNoneRR(R((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyR&�s"cC`sP|jdk	r4|jd|j|jd|jg�S|jd|j|jg�S(Ntclones-r(RR7RR
R(R((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyR8�s%cC`s�|jdks$t|j�dkr(tS|jdddd|jg�\}}}|dkrt|jjd|�n|j|j�r�t	StS(	s�
        There is no point in pulling from a potentially down/slow remote site
        if the desired changeset is already the current changeset.
        is--debugRs-is-RiRN(
RR7tlenR#RRRRt
startswithR"(RRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pytat_revision�s$*(t__name__t
__module__RRRRR R%R*RR5R6R&R8tpropertyR;(((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyR
ds									
			cC`s[tdtdtdddtddg�dtdd	�d
tddddddg�d
tdddt�dtdddt�dtdddt�dtdddt�dtdddd���}|jd}|jd}|jd
}|jd
}|jd}|jd}|jd}|jdp=|jdt�}|dk	rdtjj	|d�}	nd}
t}t}|r�|s�|r�|j
dd�nt|||||�}
|r�|r�|
j�}|j
d|dt�ntjj|	�sI|r6|
j�\}}}|dkrF|j
d|�qFq|j
dt�n�|s^|
j�}
n�|
jr�|
j�}
|
j||�}n�|
j�}
|
j||�}|
j�\}}}|dkr�|j
d|�n|
j�\}}}|dkr|j
d|�n|
j�}|
|ks,|r5t}n|j
d|
d|d|d|�dS(Nt
argument_specR
ttypetstrtrequiredtaliasestnameRtpathRtdefaulttversionR2tboolRR&R8t
executablethgs.hg/hgrcR+RsIthe destination directory must be specified unless clone=no and update=noR)tchangediR(tcleaned(RtdictR"R7R#tparamstget_bin_pathtosREtjoinRR
R t	exit_jsontexistsR8RR;R5R6R&(RR
RRR2RR&R8RthgrcR(RKRLRJRRRR)((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pytmain�sh






		t__main__(t
__future__RRRR@t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLESRPtansible.module_utils.basicRtansible.module_utils._textR	tobjectR
RUR<(((sE/usr/lib/python2.7/site-packages/ansible/modules/source_control/hg.pyt<module>s


?z	M

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]