%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/hg.pyc

�
���^c@@s�dZddlmZmZmZddlZddlmZddlZ	ddl
Z	eje�Z
d�Zd�Zdedd�Zddd	�Zddddd
�Zddddd�Zedd�Zdddd
�Zddd�ZdS(u
Support for the Mercurial SCM
i(tabsolute_importtprint_functiontunicode_literalsN(tCommandExecutionErrorcC@s-tjjjd�dkr%tdfStSdS(u&
    Only load if hg is installed
    uhgu9The hg execution module cannot be loaded: hg unavailable.N(tsalttutilstpathtwhichtNonetFalsetTrue(((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pyt__virtual__scC@sddj|�gS(Nu--sshu
ssh -i {0}(tformat(t
identity_path((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pyt	_ssh_flagsutipcC@soddd|sdndddj|�g}td|d	|d
|dt�}|dd
krg|dSdSdS(u�
    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

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

    CLI Example:

    .. code-block:: bash

        salt '*' hg.revision /path/to/repo mybranch
    uhguidu-iu--debuguu-ru{0}ucmd.run_alltcwdtrunastpython_shelluretcodeiustdoutN(Rt__salt__R	(Rtrevtshorttusertcmdtresult((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pytrevision!s	cC@s\ddddj|�ddg}td|d|d	|d
t�}|p[t||dt�S(u]
    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

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

    CLI Example:

    .. code-block:: bash

        salt '*' hg.describe /path/to/repo
    uhgulogu-ru{0}u
--templateu4'{{latesttag}}-{{latesttagdistance}}-{{node|short}}'ucmd.run_stdoutRRRR(RRR	RR
(RRRRtdesc((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pytdescribeKs		cC@s�dddj|�ddj|�g}|rS|jd�|jdj|��n|r|jd�|jdj|��ntd|d	|d
|dt�S(u�
    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.

    prefix : None
        Prepend <prefix>/ to every filename in the archive

    user : None
        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:

    .. code-block:: bash

        salt '*' hg.archive /path/to/repo output=/tmp/archive.tgz fmt=tgz
    uhguarchiveu{0}u--revu--typeu--prefixu"{0}"ucmd.runRRR(RtappendRR	(RtoutputRtfmttprefixRR((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pytarchiveos!

cC@s�ddg}|r(|jt|��n|rUx$|j�D]}|j|�q;Wn|dk	rq|j|�ntd|d|d|dt�}|ddkr�td	j|j	d
|d����n|dS(
uD
    Perform a pull on the given repository

    cwd
        The path to the Mercurial repository

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

    opts : None
        Any additional options to add to the command line

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

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

        .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' hg.pull /path/to/repo opts=-u
    uhgupullucmd.run_allRRRuretcodeiuHg command failed: {0}ustderrustdoutN(
textendRtsplitRRRR	RRtget(RtoptsRtidentityt
repositoryRtopttret((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pytpull�s"%cC@s�dddj|�g}|r.|jd�ntd|d|d|dt�}|d	d
kr�tdj|jd|d
����n|d
S(ue
    Update to a given revision

    cwd
        The path to the Mercurial repository

    rev
        The revision to update to

    force : False
        Force an update

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

    CLI Example:

    .. code-block:: bash

        salt devserver1 hg.update /path/to/repo somebranch
    uhguupdateu{0}u-Cucmd.run_allRRRuretcodeiuHg command failed: {0}ustderrustdout(RRRR	RR"(RRtforceRRR'((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pytupdate�s"%cC@s�dddj|�dj|�g}|rZx-|j�D]}|jdj|��q7Wn|rv|jt|��ntd|d|dt�}|ddkr�td	j|jd
|d����n|dS(u"
    Clone a new repository

    cwd
        The path to the Mercurial repository

    repository
        The hg URI of the repository

    opts : None
        Any additional options to add to the command line

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

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

        .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' hg.clone /path/to/repo https://bitbucket.org/birkenfeld/sphinx
    uhgucloneu{0}ucmd.run_allRRuretcodeiuHg command failed: {0}ustderrustdout(	RR!RR RRR	RR"(RR%R#RR$RR&R'((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pytclone�s$%c@sO��fd��tjjj|�rAt�fd�|D��S�|�SdS(uX
    Show changed files of the given repository

    cwd
        The path to the Mercurial repository

    opts : None
        Any additional options to add to the command line

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

    CLI Example:

    .. code-block:: bash

        salt '*' hg.status /path/to/repo
    c	@sddg}�rBx-�j�D]}|jdj|��qWntd|d|d�dt�}idd	6d
d6dd
6dd6dd6dd6dd6dd6}i}xW|j�D]I}||d|d}}||kr�g||<n||j|�q�W|S(Nuhgustatusu{0}ucmd.run_stdoutRRRumodifieduMuaddeduAuremoveduRucleanuCumissingu!unot trackedu?uignoreduIuorigin of the previous fileu ii(R!RRRR	t
splitlines(	RRR&toutttypesR'tlinetttf(R#R(s3/usr/lib/python2.7/site-packages/salt/modules/hg.pyt_status-s,

c3@s!|]}|�|�fVqdS(N((t.0R(R2(s3/usr/lib/python2.7/site-packages/salt/modules/hg.pys	<genexpr>GsN(RRtdatatis_itertdict(RR#R((R2R#Rs3/usr/lib/python2.7/site-packages/salt/modules/hg.pytstatuss(t__doc__t
__future__RRRtloggingtsalt.exceptionsRtsalt.utils.dataRtsalt.utils.patht	getLoggert__name__tlogRRR	RRRRR(R*R+R7(((s3/usr/lib/python2.7/site-packages/salt/modules/hg.pyt<module>s		*$0-#+

Zerion Mini Shell 1.0