https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/subrepo.cpython-310.pyc
o

�]Lb��@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Zddlm
Z
ddlmZmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z"ddl#m$Z$m%Z%m&Z&m'Z'da(ej)Z)ej*Z*ej+Z+e j,Z,dd	�Z-d
d�Z.Gdd
�d
ej/�Z0dd�Z1dd�Z2dd�Z3dd�Z4dddd�Z5dd�Z6d(dd�Z7dd�Z8Gdd �d e9�Z:Gd!d"�d"e:�Z;Gd#d$�d$e:�Z<Gd%d&�d&e:�Z=e;e<e=d'�Z>dS))�)�absolute_importN�)�_)�bin�hex�short)�cmdutil�encoding�error�exchange�
logcmdutil�match�merge�pathutil�phases�pycompat�scmutil�subrepoutil�util�vfs)�dateutil�hashutil�procutil�urlutilcCs6t�t�|��}t�|�}|jst�t�|j��}|S)zU
    get a path or url and if it is a path expand it and return an absolute path
    )	r�urllocalpathr�
expandpath�url�scheme�normpath�abspath�path)r �expandedpath�u�r#�3/usr/lib/python3/dist-packages/mercurial/subrepo.py�_expandedabspath8s

r%cCstt�t|�����dd�S)zEget a unique filename for the store hash cache of a remote repositoryr�)rr�sha1r%�digest)�
remotepathr#r#r$�_getstorehashcachenameCsr*c@seZdZdZdd�ZdS)�SubrepoAbortzEException class used to avoid handling a subrepo error more than oncecOs:|�dd�|_|�dd�|_tjj|g|�Ri|��dS)N�subrepo�cause)�popr,r-r
�Abort�__init__)�self�args�kwr#r#r$r0KszSubrepoAbort.__init__N)�__name__�
__module__�__qualname__�__doc__r0r#r#r#r$r+Hsr+cs�fdd�}|S)Nc
s�z�|g|�Ri|��}W|Sty}z|�d}~wtjyB}zt|�}|jdtd�|}t||j|t��d��d}~ww)N� s(in subrepository "%s"))�hintr,r-)	r+r
r/�
subrelpath�messagerr9�sys�exc_info)r1r2�kargs�res�exr,�errormsg��funcr#r$�decoratedmethodRs
������z-annotatesubrepoerror.<locals>.decoratedmethodr#)rCrDr#rBr$�annotatesubrepoerrorQsrEcCs>|rtd�t|�||f}ntd�t|�||f}|�|d�S)Ns� subrepository sources for %s differ
you can use (l)ocal source (%s) or (r)emote source (%s).
what do you want to do?$$ &Local $$ &Remotes� subrepository sources for %s differ (in checked out version)
you can use (l)ocal source (%s) or (r)emote source (%s).
what do you want to do?$$ &Local $$ &Remoter)rr:�promptchoice)�ui�sub�dirty�local�remote�msgr#r#r$�
_updatepromptfs����rMc	Cs�|��D]C\}}}t|�D]\}}|��|kr||=nq
|�|���dkr'q|D]}|��dkrF|�td�|�|��|�|�||��q)qdS)Ns.hg�hgrcs5warning: removing potentially hostile 'hgrc' in '%s'
)	�walk�	enumerate�lower�basename�warnr�join�unlink�reljoin)	rGr�ignore�dirname�dirs�names�i�d�fr#r#r$�	_sanitizeys*�������r^cCsd|�d�sd|vst�|�|krt�td�|��t�|j�|�|j	�
|�r0t�td�|��dS)N�~�$�+subrepo path contains illegal component: %ss$subrepo '%s' traverses symbolic link)�
startswithrrr
r/rr�pathauditor�root�wvfs�islink)�repor r#r#r$�_auditsubrepopath�s 
��rhTF)�hg�git�svncCsz|�ddd�stjtd�td�d��t�|d�}|�dd||�s.tjtd	�|td�d��|tvr;t�td
�|��dS)N�subrepossallowedTssubrepos not enableds)see 'hg help config.subrepos' for details�r9Fs
%s:alloweds%s subrepos not allowedsunknown subrepo type %s)�
configboolr
r/r�SUBREPO_ALLOWED_DEFAULTS�get�types)rG�kind�defaultr#r#r$�
_checktype�s�
��rtcCsvddlm}|a|��}t||�|j|}t|j|d�|r,|d|�|�|df}t|d|||dd�|�S)z>return instance of the right subrepo class for subrepo in pathr��hg�rN)	�rvrgrh�substatertrG�subrevrq)�ctxr �	allowwdir�allowcreate�hrg�stater#r#r$r,�s

r,cCsnddlm}|a|��}t||�|j|}t|j|d�d}|ddkr(d}t|d|||d|fd�S)	z=return an empty subrepo in pctx for the extant subrepo in ctxrrurw�ris(0000000000000000000000000000000000000000rT)rxrvrgrhryrtrGrq)r{r �pctxr~rgrrzr#r#r$�nullsubrepo�s

r�c@sBeZdZdd�Zdd�Zdd�ZdLdd	�ZdLd
d�ZdMd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dNdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�ZdOd3d4�Zd5d6�ZdPd8d9�Zd:d;�Zd<d=�Zd>d?�Z d@dA�Z!dBdC�Z"dDdE�Z#dNdFdG�Z$e%dHdI��Z&e%dJdK��Z'dS)Q�abstractsubrepocCs|��j|_||_||_dS)z�Initialize abstractsubrepo part

        ``ctx`` is the context referring this subrepository in the
        parent repository.

        ``path`` is the path to this subrepository as seen from
        innermost repository.
        N)rgrG�_ctx�_path)r1r{r r#r#r$r0�s	
zabstractsubrepo.__init__cC�dS)z�Add the hgwebdir entries for this subrepo, and any of its subrepos.

        ``serverpath`` is the path component of the URL for this repo.

        ``webconf`` is the dictionary of hgwebdir entries.
        Nr#�r1�
serverpath�webconfr#r#r$�
addwebdirpath�szabstractsubrepo.addwebdirpathcCr�)z�
        returns true if the repository has not changed since it was last
        cloned from or pushed to a given repository.
        Fr#�r1r r#r#r$�
storeclean��zabstractsubrepo.storecleanFcC�t�)areturns true if the dirstate of the subrepo is dirty or does not
        match current stored state. If ignoreupdate is true, only check
        whether the subrepo has uncommitted changes in its dirstate.  If missing
        is true, check for deleted files.
        ��NotImplementedError�r1�ignoreupdate�missingr#r#r$rI��zabstractsubrepo.dirtycCs"|j||d�rtd�t|�SdS)z�return reason string if it is ``dirty()``

        Returned string should have enough information for the message
        of exception.

        This returns None, otherwise.
        �r�r�s)uncommitted changes in subrepository "%s"N)rIrr:r�r#r#r$�dirtyreasons
��zabstractsubrepo.dirtyreasonNcCs$|j|dd�}|rtj||d��dS)z+raise Abort if subrepository is ``dirty()``Tr�rmN)r�r
r/)r1r�r9r�r#r#r$�
bailifchangeds�zabstractsubrepo.bailifchangedcCr�)zpcurrent working directory base state, disregarding .hgsubstate
        state and working directory modificationsr��r1r#r#r$�	basestateszabstractsubrepo.basestatecCr�)z7check if path is a subrepository within this repositoryFr#r�r#r#r$�checknested�zabstractsubrepo.checknestedcCr�)z�commit the current changes to the subrepo with the given
        log message. Use given user and date if possible. Return the
        new state of the subrepo.
        r�)r1�text�user�dater#r#r$�commit"r�zabstractsubrepo.commitcCstjS)z6returns phase of specified state in the subrepository.)r�public�r1rr#r#r$�phase)szabstractsubrepo.phasecCr�)zTremove the subrepo

        (should verify the dirstate is not dirty first)
        r�r�r#r#r$�remove-r�zabstractsubrepo.removecCr�)zTrun whatever commands are needed to put the subrepo into
        this state
        r�)r1r�	overwriter#r#r$rp4szabstractsubrepo.getcCr�)z/merge currently-saved state with the new state.r�r�r#r#r$r:r�zabstractsubrepo.mergecCr�)zhperform whatever action is analogous to 'hg push'

        This may be a no-op on some systems.
        r��r1�optsr#r#r$�push>r�zabstractsubrepo.pushcKsgS�Nr#�r1rGr
�prefix�uipathfn�explicitonlyr�r#r#r$�addE�zabstractsubrepo.addcCs|j�d|td�f�dS)Ns%s: %ssaddremove is not supportedr�rGrSr)r1�matcherr�r�r�r#r#r$�	addremoveHszabstractsubrepo.addremovecKr��Nrr#)r1r
�fm�
fntemplater�r�r#r#r$�catLr�zabstractsubrepo.catc	Kst�ggggggg�Sr�)r�status)r1�rev2r�r#r#r$r�Oszabstractsubrepo.statuscKsdSr�r#)r1rG�diffopts�node2r
r�r�r#r#r$�diffRr�zabstractsubrepo.diffcCr�r�r#)r1rG�destr�r#r#r$�outgoingUr�zabstractsubrepo.outgoingcCr�r�r#)r1rG�sourcer�r#r#r$�incomingXr�zabstractsubrepo.incomingcCr�)zreturn filename iteratorr�r�r#r#r$�files[r�zabstractsubrepo.filescCr�)z9return file data, optionally passed through repo decodersr��r1�name�decoder#r#r$�filedata_r�zabstractsubrepo.filedatacCr�)zreturn file flagsr�r#)r1r�r#r#r$�	fileflagscr�zabstractsubrepo.fileflagscCstj|d�S)z,Resolve the fileset expression for this repo��badfn)�matchmod�never)r1�cwd�exprr�r#r#r$�matchfilesetgszabstractsubrepo.matchfilesetcCr�)z)handle the files command for this subreporr#)r1rG�mr�r��fmt�subreposr#r#r$�
printfileskr�zabstractsubrepo.printfilesTc

s��dur�fdd�|��D�}n|��}t|�}t|�}|jjtd�|td�|d�}|�d�|D]%}	|�|	�}
d|
vr?dp@d	}d
|
v}|�||	|||�	|	|��|�
�q2|��|S)Nc�g|]}�|�r|�qSr#r#��.0r]�r
r#r$�
<listcomp>q�z+abstractsubrepo.archive.<locals>.<listcomp>�archiving (%s)�files)�unit�totalr�xi�i��l)r��lenr:rG�makeprogressr�updater��addfiler��	increment�complete)
r1�archiverr�r
r�r�r��relpath�progressr��flags�mode�symlinkr#r�r$�archiveos&�

�
zabstractsubrepo.archivecCr�)zv
        walk recursively through the directory tree, finding all files
        matched by the match function
        Nr#)r1r
r#r#r$rO��zabstractsubrepo.walkcCsggfSr�r#�r1r
r�r��dryrun�interactiver#r#r$�forget��zabstractsubrepo.forgetc		Cs|�td�|j�dS)z�remove the matched files from the subrepository and the filesystem,
        possibly by force and/or after the file has been removed from the
        filesystem.  Return 0 on success, 1 on any warning.
        s)warning: removefiles not implemented (%s)r)�appendrr��	r1r�r�r��after�forcer�r��warningsr#r#r$�removefiles�s�zabstractsubrepo.removefilescOs$|j�td�|d|df�gS)Ns)%s: reverting %s subrepos is unsupported
rrwr��r1ry�patsr�r#r#r$�revert�s��zabstractsubrepo.revertcCs|Sr�r#�r1�revidr#r#r$�shortid�r�zabstractsubrepo.shortidcCr�)zH
        convert this repository from shared to normal storage.
        Nr#r�r#r#r$�unshare�r�zabstractsubrepo.unsharecCr�)a1verify the revision of this repository that is held in `_state` is
        present and not hidden.  Return 0 on success or warning, 1 on any
        error.  In the case of ``onpush``, warnings or errors will raise an
        exception if the result of pushing would be a broken remote repository.
        rr#)r1�onpushr#r#r$�verify�r�zabstractsubrepo.verifycCst�|j��j�|j��S)z@return vfs to access the working directory of this subrepository)�vfsmodrr�rgrerTr�r�r#r#r$re��zabstractsubrepo.wvfscCs|j�t|j���|j�S�zCreturn path to this subrepository as seen from outermost repository)rerV�reporelpathr�rgr�r�r#r#r$�_relpath�r�zabstractsubrepo._relpath�FF)FN�Fr��NT)(r4r5r6r0r�r�rIr�r�r�r�r�r�r�rprr�r�r�r�r�r�r�r�r�r�r�r�r�r�rOr�r�r�r�r�r��
propertycachererr#r#r#r$r��sN
	








r�cs�eZdZ�fdd�Zedd��Zdd�Zdd�Zd	d
�Ze	dd��Z
d
d�Zdd�Zdd�Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��ZedZd!d"��Zed[d$d%��Zd&d'�Zd(d)�Zed*d+��Zed,d-��Zed.d/��Zd0d1�Zed\d2d3��Zed4d5��Zed6d7��Zed8d9��Zed:d;��Z ed<d=��Z!d>d?�Z"d@dA�Z#edBdC��Z$ed]dDdE��Z%dFdG�Z&edHdI��Z'edJdK��Z(edLdM��Z)dNdO�Z*dPdQ�Z+edRdS��Z,d\dTdU�Z-e	dVdW��Z.e	dXdY��Z/�Z0S)^�	hgsubrepoc
sHtt|��||�||_|��}|�t�|��}|o"|j�	d|�}t
j�|�}t
j�t
j�
t�|���}	|	|krCt�td�|��tj|j||d�|_t
j�|jj�t
j�|�krft�d||jjf��||��urr|j��|_|jj|_dD]\}
}|j�|
|�}|r�|j�|
||d�qy|j�ddd	d�|�||d
|�dS)Ns%s/.hgra��creates9failed to reject unsafe subrepo path: %s (expanded to %s)))�uiscommitsubrepos�subrepor
s_usedassubreposTruer)�superrr0�_staterg�wjoinr�	localpathre�exists�osr �normcase�realpathrr
r/rrv�
repository�baseui�_repord�ProgrammingError�
unfilteredrG�config�	setconfig�	_initrepo)
r1r{r rr}�rrdr	�	norm_root�	real_root�s�k�v��	__class__r#r$r0�s8
�
��
�zhgsubrepo.__init__cCst�|jt|�|�dSr�)rr�rr:r�r#r#r$r��szhgsubrepo.addwebdirpathcCs8|j���
|�|�Wd�S1swYdSr�)r�lock�_storecleanr�r#r#r$r��s$�zhgsubrepo.storecleancCsJd}|�|�}|�|�D]
}|t|d�krd}nq|r#t|d�du}|S)NTF)�_calcstorehash�_readstorehashcache�next)r1r �clean�	itercache�filehashr#r#r$r%�s
�zhgsubrepo._storecleanccsP�d}dt|�V|jj}|D]}tt�|�|�����}d||fVqdS)z�calculate a unique "store hash"

        This method is used to to detect when there are changes that may
        require a push to a given remote path.)s	bookmarkssstore/phaserootssstore/00changelog.is# %s
�%s = %s
N)r%rrrrr'�tryreadr()r1r)�filelistr�relnamer+r#r#r$r&�s��zhgsubrepo._calcstorehashcCst�|jj�d��S)Nscache/storehash)r�rrrTr�r#r#r$�_cachestorehashvfs	szhgsubrepo._cachestorehashvfscCst|�}|j�|d�S)z7read the store hash cache for a given remote repository�r)r*r0�tryreadlines)r1r)�	cachefiler#r#r$r'
szhgsubrepo._readstorehashcachecCs^t|�}|j���t|�|��}|j}|j||ddd�Wd�dS1s(wYdS)z�cache the current store hash

        Each remote repo requires its own store hash cache, because a subrepo
        store may be "clean" versus a given remote repo, but not versus another
        swbT)r��
notindexedN)r*rr$�listr&r0�
writelines)r1r)r3�	storehashrr#r#r$�_cachestorehashs"�zhgsubrepo._cachestorehashcCs,|j��dur|jdS|jd}|j|S)zBfetch the context for this subrepo revision, possibly a workingctxNr)r��revrr
)r1r9r#r#r$�_getctxs


zhgsubrepo._getctxcs�|�j_|�j_|rAdg���fdd�}t�jdd�}t�jddd�}|d|�||kr1|d|��jj�d	t�d
�����dSdS)Ns[paths]
cs0|r��d||f��j�d||d�dSdS)Nr,spathsr)r�rGr)�key�value��linesr1r#r$�
addpathconfig.s�z*hgsubrepo._initrepo.<locals>.addpathconfigF)�abortTsdefaultsdefault-pushrNr�)	r�
_subparent�
_subsource�
_abssourcer�writer�tonativeeolrT)r1�
parentrepor�r	r?�defpath�defpushpathr#r=r$r&s

 �zhgsubrepo._initrepocKstj||j||||fi|��Sr�)rr�rr�r#r#r$r�;s
��z
hgsubrepo.addcCs&t�|�}d|d<t�|j||||�S)NTrl)�copyrr�r)r1r�r�r�r�r#r#r$r�As
zhgsubrepo.addremovecKs6|jd}|j|}tj|j|j|||||fi|��Sr�)r
rrr�rG)r1r
r�r�r�r�r9r{r#r#r$r�Js

��z
hgsubrepo.catcKs�z|jd}|j|}|j|}|jj||fi|��WStjyG}z|j�td�|t|�f�t	�ggggggg�WYd}~Sd}~ww)Nr�*warning: error "%s" in subrepository "%s"
)
r
rr�r
�RepoLookupErrorrGrSrr:r)r1r�r��rev1�ctx1�ctx2�instr#r#r$r�Rs



��"��zhgsubrepo.statusc	
Ks�z*t|jd�}|durt|�}tj||j||j||j||f|dd�|��WdStjyL}z|j�t	d�|t
|�f�WYd}~dSd}~ww)NrT)r��listsubreposrJ)rr
r�diffordiffstatrr
rKrGrSrr:)	r1rGr�r�r
r�r��node1rOr#r#r$r�`s2��	�
����zhgsubrepo.diffNTc
s�|�|jd�|��}�r�fdd�|D�}|jd}|j|}t�|j|��t�|j|�fg�t�	|||��}|j
D]}	t||	d�}
t�
|	��}||	d}||
�	||||�7}q=|S)N)ricr�r#r#r�r�r#r$r�~r�z%hgsubrepo.archive.<locals>.<listcomp>rT�/)�_getr
r�rr�
prefetchfilesr9�
matchfilesr�r�ryr,r��
subdirmatcher)
r1r�r�r
r�r�r9r{r��subpathr�submatch�	subprefixr#r�r$r�ys 

�
zhgsubrepo.archiveFcCsH|jd}|dkr
|s
dS|jd}||����kr|sdS|j|d�S)Nrr�T)r�)r
r�p1rrI)r1r�r�r�wr#r#r$rI�s

zhgsubrepo.dirtycCs|jd��S�N�.)rrr�r#r#r$r���zhgsubrepo.basestatecCs|j�|j�|��Sr�)r�_checknestedrr�r#r#r$r���zhgsubrepo.checknestedcCsV|�d�s|jd��S|j�dt|��|j�|||�}|s'|jd��St|�S)NTr^scommitting subrepo %s
)rIrrrG�debugr:r�)r1r�r�r��nr#r#r$r��s
zhgsubrepo.commitcCs|j|pd��Sr])rr�r�r#r#r$r��szhgsubrepo.phasecCs0|j�td�t|��t�|j|jjd�dS)N�removing subrepo %s
F)rG�noterr:rvr)r�nullidr�r#r#r$r��szhgsubrepo.removecs |\}}}�jj}|�j��vrt�j�dks|��sdS|�j_t�j����fdd�}t�j�dkrڈjj��|��rut	�
��ru�j�t
d�t���f�|�}zt	j�jjj|�jjddd�}W|��n|��w|���_nV|��r��j�dd	�}	|	r�t�|	�}	|	�j�dd
�d�}
ni}
�j�t
d�t��t���f�|�}zt	j�jjji|�jjd|
d
�\}}W|��n|��w|���_�j||dd�����dS�j�t
d�t��t���f�����}
|�}z
t��j|�W|��n|��w|
�r����dS)NrTcst��ji��Sr�)rv�peerrr#�r1�srcurlr#r$�<lambda>�sz hgsubrepo._get.<locals>.<lambda>ssharing subrepo %s from %s
F)r��	bookmarkssshare�pools
poolnaming)rlsmode�cloning subrepo %s from %s
)r��	shareoptsr�pulling subrepo %s from %s
)rrArr��sharedrBrCr�rmtreerv�islocalrGr�rr:�sharerrd�closerJrrrr�hidepassword�clonerr8r�r�pull)r1rr��revisionrrrF�getpeerrgrp�poolrn�other�cloned�cleansubr#rhr$rT�s�


���
����	

���

zhgsubrepo._getc
Cs�|�|�}|\}}}|j}|j�d|j�|r7|��}||}	|	��r7|j�td�|dd�|jf�|}|rBt	�
||�dSt	�||�dS)Nsgetting subrepo %s
s,revision %s in subrepository "%s" is hidden
rr&)rTrrGrbr�r�hiddenrSrr�clean_updater�)
r1rr��inrepor�rxrrrg�urepor{r#r#r$rps"

��z
hgsubrepo.getcs������jd��j�d�����������fdd�}�jd}���rD��kr?t�j�|�����r=|�dSdS|�dS|�dS)Nr^rcs���kr!������kr!�j�dt���t��j�d�dS��kr1�j�dt���dS�j�dt���tj�dd�dS)Nsupdating subrepository "%s"
rsskipping subrepository "%s"
smerging subrepository "%s"
F)�remind)�branchrGrbr:rvr�rrr#��anc�cur�dstr1rr#r$�	mergefunc*s
�
�
�z"hgsubrepo.merge.<locals>.mergefunc)rTr�ancestorrIrMrG)r1rr��wctxr#r�r$r#s




�

zhgsubrepo.mergecCs|�d�}|�d�}|�d�}|jd}|j}t|�D]}|�|��|�dkr*dSqt|jd�}|sK|�|�rK|j�	t
d�t|�t�
|�f�dS|j�	t
d	�t|�t�
|�f�t�|jd|i|�}	ztj|j|	||d
�}
W|	��n|	��w|�|�|
jS)N�forces
new_branchssshr^rFTs4no changes made to subrepo %s since last push to %s
spushing subrepo %s to %s
)�	newbranch)rprry�sortedrHr�rCr�rGr�rr:rrurvrgrrtr8�cgresult)r1r�r�r��ssh�c�subsr�dsturlr{r?r#r#r$r�Ds:



�
����
zhgsubrepo.pushcC�Td|vsd|vrt�|�}|�dd�|�dd�t�|j�}tj||j|||d�S�Nsrevsbranch)rX)rIr.r�repo_rel_or_abs_sourcerrvr�)r1rGr�r�rXr#r#r$r�g�
zhgsubrepo.outgoingcCr�r�)rIr.rr�rrvr�)r1rGr�r�rXr#r#r$r�pr�zhgsubrepo.incomingcCs |jd}|j|}|����Sr�)r
r�manifest�keys)r1r9r{r#r#r$r�ys

zhgsubrepo.filescCs2|jd}|j||��}|r|j�||�}|Sr�)r
r�data�
wwritedata)r1r�r�r9r�r#r#r$r�s

zhgsubrepo.filedatacCs|jd}|j|}|�|�Sr�)r
rr�)r1r�r9r{r#r#r$r��s


zhgsubrepo.fileflagsc		CsD|j��dur
|jd}n
|jd}|j|}t�|||||||�Sr�)r�r9rr
rr�)	r1rGr�r�r�r�r�r{r9r#r#r$r��s


zhgsubrepo.printfilescCs�|j��dur
|jd}n
|jd}|j|}|j|||d�g}|jD]9}|�|�}z|j|||d�}	tj||	|d�}
|�	|
�Wq#t
jy\|j�
td�|j�t|�|��Yq#wt|�dkrg|dSt�|�S)Nrr�s#skipping missing subrepository: %s
r)r�r9rr
r�ryrHr��prefixdirmatcherr�r
�LookupErrorrGr�rrerVrr��unionmatcher)r1r�r�r�r{r9�matchersrXrH�sm�pmr#r#r$r��s*



���
zhgsubrepo.matchfilesetcCs|jd}|�|�Sr�)rrO)r1r
r{r#r#r$rO�s

zhgsubrepo.walkc
Cstj|j|j|||d||d�S)NT)r�r�)rr�rGrr�r#r#r$r��s�zhgsubrepo.forgetc		Cst�|j|j|||||||�	Sr�)rr�rGrr�r#r#r$r��s�zhgsubrepo.removefilescOsn|j�td�|d�|�d�s'|��}d|d<|d|d<|j|i|��|�d�s5|j|dd	�dSdS)
N�reverting subrepo %s
r�	no_backupr�rr9�dry_runT�r�)rGr�rrprI�
filerevertr�r#r#r$r��s

�zhgsubrepo.revertcOsH|j|d}|�d�rdg}ng}tj|j|j|g|�Ri|��dS)Nr9�allsset:modified())rrprr�rG)r1r�r�r{r#r#r$r��s

$zhgsubrepo.filerevertcC�|dd�S)Nr&r#r�r#r#r$r���zhgsubrepo.shortidcCsDddlm}|a|j��r|j�td�|j�t�|j|j�dS)Nrrusunsharing subrepo '%s'
)	rxrvrrprGr�rrr�)r1r~r#r#r$r��s

zhgsubrepo.unsharecCs�z1|jd}|j��|}|��r/td�|jt|j���f}|r&t	�
|��|jj�d|�WdSt	j
yZtd�|jt|j���f}|rNt	�
|��|jj�d|�YdSw)Nrs%subrepo '%s' is hidden in revision %ss%s
rs%subrepo '%s' not found in revision %s)r
rrr~rrrr��noder
r/rGrSrK)r1r�r9r{rLr#r#r$r�
s,
�
�
�zhgsubrepo.verifycCs|jjS)z.return own wvfs for efficiency and consistency)rrer�r#r#r$re,szhgsubrepo.wvfscCs
t|j�Sr)rrr�r#r#r$r1s
zhgsubrepo._relpathrrrr�)1r4r5r6r0rEr�r�r%r&rr0r'r8r:rr�r�r�r�r�r�rIr�r�r�r�r�rTrprr�r�r�r�r�r�r�r�rOr�r�r�r�r�r�r�rer�
__classcell__r#r#r"r$r�s�"












[
 
"










rcs�eZdZ�fdd�Zd#dd�Zedd��Zd	d
�Zdd�Zd
d�Z	dd�Z
ed$dd��Zdd�Z
edd��Zedd��Zed%dd��Zedd��Zdd�Zedd ��Zd!d"�Z�ZS)&�
svnsubrepocsBtt|��||�||_t�d�|_|jst�t	d�|j
��dS)Nrks+'svn' executable not found for subrepo '%s')rr�r0r
r�findexe�_exer
r/rr��r1r{r rr}r"r#r$r09s��zsvnsubrepo.__init__r�Fc	Cs$|jg}i}|j��stj|d<|ddvr|�d�|�|�|dur6|j�|j	�
�j|j|�}|�|�t
tj�}|�d�}|rI||d<|d=d|d<tjt�tj|�fd	tjtjtjt�|�d
�|��}	ttj|	���\}
}|��}|s�|	jr�t�|p�d|	j��|r�|j� |d�|
|fS)
N�stdinr)�update�checkout�commits--non-interactive�LC_ALLsLANG�CsLC_MESSAGES���)�bufsize�	close_fds�stdout�stderr�envsexited with code %d�
)!r�rGr��
subprocess�PIPEr��extendrerVr�rg�origrootr��dictr	�environrp�Popenr�rapplyr�tonativestr�closefds�tonativeenv�mapr�
fromnativeeol�communicate�strip�
returncoder
r/rS)r1�commands�filename�failok�cmd�extrakwr r��lc_all�pr�r�r#r#r$�_svncommandBsN



�


���	�zsvnsubrepo._svncommandcCsP|jddgdd�\}}t�d|�}|st�td���t|�d��t|�d��fS)N�	--version�--quiet)r�s
^(\d+)\.(\d+)s cannot retrieve svn tool versionrrw)r��re�searchr
r/r�int�group)r1�output�errr�r#r#r$�_svnversionps
�zsvnsubrepo._svnversioncC�|j�d�S)N�.svn�rerr�r#r#r$�_svnmissingzr_zsvnsubrepo._svnmissingcCs�|�ddg�\}}tjj�|�}|�d�}d\}}|r<t�|d�d��p&d}|d�d�}|r<t�|d�d��p;d}||fS)	Nsinfo�--xml�entry)�0r�rrxr�r�)	r��xml�dom�minidom�parseString�getElementsByTagNamer�bytestr�getAttribute)r1r�r��doc�entries�lastrevr9�commitsr#r#r$�_wcrevs}s
�zsvnsubrepo._wcrevscCs|��dS)Nr)r�r�r#r#r$�_wcrev�r�zsvnsubrepo._wcrevc
Cs|�ddg�\}}ggg}}}tjj�|�}|�d�D]@}|�d�}|s'q|d�d�}	|d�d�}
|�d��d	�}|	d
krG|�|�n	|	dkrP|�|�|	dvsX|
d
vr]|�|�q|D]}|D]}||ksr|�	|t
j�r}ddt|�fSqdq`t|�dt|�fS)z�Return (changes, extchanges, missing) where changes is True
        if the working directory was changed, extchanges is
        True if any of these changes concern an external entry and missing
        is True if any change is a missing entry.
        �statusr�r�z	wc-statusr�item�propsr �utf8�externalr�)rx�normal�unversionedr�)rx�noner�TF)
r�r�r�r�r�r�r��encoder�rbr�ossep�bool)
r1r�r��	externals�changesr�r��err�r�r �extr#r#r$�
_wcchanged�s6

�
���zsvnsubrepo._wcchangedcCsT|��r|jddkS|��}|dp|o|d}|s(|jd|��vs&|r(dSdS)Nrr�rrwFT)r�r
rr�)r1r�r��	wcchanged�changedr#r#r$rI�szsvnsubrepo.dirtycCsR|��\}}||kr'z|�dd|jd|fg�|WStjy&Y|Sw|S)N�list�%s@%sr)r�r�r
r
r/)r1r�r9r#r#r$r��s��zsvnsubrepo.basestatec
Cs�|��\}}}|s
|��S|rt�td���|rt�td���|�dd|g�\}}|j�|�t�	d|�}	|	sK|�
�sBt�td���t�|��d��|	��d}	|j�|�d	d
|	g�d�|	S)Nscannot commit svn externalss!cannot commit missing svn entriesr��-msCommitted revision ([0-9]+).sfailed to commit svn changesr�rr��-r)
rr�r
r/rr�rGr�r�r�r��
splitlines�groups)
r1r�r�r�r�
extchangedr��
commitinfor��newrevr#r#r$r��s"zsvnsubrepo.commitcCs�|��r|j�td�|j�dS|j�td�|j�|jjdd�z|j�	�j}|�
|�|j��WdSty?YdSw)N�-not removing repo %s because it has changes.
rdT)�forcibly)
rIrGrSrr�rererqr�rg�
removedirsrX�OSError)r1�pwvfsr#r#r$r��s���zsvnsubrepo.removecCs�|r	|�ddg�dg}|jdkr|�d�|�d|d|df�t�|d�|j|d	d
�\}}t|j|jd�t�	d|�sgd
|vr\|�
�dd�dkr\|��|j|dd�dSt
�|pa|��d��|j�|�dS)Nsrevert�--recursiver�)r��--forcerrrT)r�r�sChecked out revision [0-9]+.s-is already a working copy for a different URLrwrFr�r�)r�r�r�r�checksafesshr^rGrer�r�rr�rpr
r/rr�)r1rr�r2r�r�r#r#r$rp�s"

zsvnsubrepo.getcCs`|jd}|d}|��}||kr,||kp|��d}t|j||||�r.|�|d�dSdSdS)NrrF)r
r�rrMrGrp)r1r�old�new�wcrevrIr#r#r$rs
�zsvnsubrepo.mergecCr�rr#r�r#r#r$r�$r�zsvnsubrepo.pushcCs�|�gd��d}tjj�|�}g}|�d�D]'}t�|�d��}|dkr&qd�	dd�|�d	�dj
D��}|�|�d
��q|S)N)rrr�rr�rrsfilerxcss"�|]}|j|jkr|jVqdSr�)�nodeType�	TEXT_NODEr�)r�r�r#r#r$�	<genexpr>1s���z#svnsubrepo.files.<locals>.<genexpr>r�r�)
r�r�r�r�r�r�rr�r�rT�
childNodesr�r�)r1r�r��pathsr�rrr�r#r#r$r�(s
�zsvnsubrepo.filescCs|�dg|�dS)Nscatr)r�r�r#r#r$r�9�zsvnsubrepo.filedata)r�Frr)r4r5r6r0r�rr�r�r�r�rrErIr�r�r�rprr�r�r�r�r#r#r"r$r�8s0
	.
	%



	
r�cs\eZdZ�fdd�Zdd�Zedd��Zedd��ZdFdd�ZdFd
d�Z	dGdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZedHd)d*��Zd+d,�ZedId-d.��Zed/d0��Zed1d2��Zed3d4��Zed5d6��Zed7d8��ZdJd:d;�Z ed<d=��Z!ed>d?��Z"ed@dA��Z#edBdC��Z$dDdE�Z%�Z&S)K�
gitsubrepocs>tt|��||�||_|���|�|_|��|_|��dSr�)	rrr0r
rgr�_abspathrA�
_ensuregitr�r"r#r$r0>s

zgitsubrepo.__init__c
Csfz
d|_|�dg�\}}Wnwty�}zktd�}td�}|jtjkr1t�||jt	�
|j�f��tj
rnz
d|_|�dg�\}}Wn8tym}z |jtjkr[tjtd�|j|d��t�||jt	�
|j�f��d}~wwtjtd�|j|d��WYd}~nd}~ww|�|�}|d	kr�|j�td
��dS|dkr�t�td���|d
kr�|j�td��dSdS)Nrjr�s(error executing git for subrepo '%s': %ss'check git is installed and in your PATHsgit.cmds1couldn't find 'git' or 'git.cmd' for subrepo '%s'rms"couldn't find git for subrepo '%s'�unknownscannot retrieve git version
�aborts,git subrepo requires at least 1.6.0 or later�warnings-git subrepo requires at least 1.6.0 or later
)�_gitexecutable�	_gitnodirrr�errno�ENOENTr
r/r�r	�
strtolocal�strerrorr�	iswindows�
_checkversionrGrS)r1�outr�r��genericerror�notfoundhint�e2�
versionstatusr#r#r$r Es`����	��������
��zgitsubrepo._ensuregitcCsjt�d|�}|rt|�d��t|�d��t|�d��fSt�d|�}|r3t|�d��t|�d��dfSdS)Ns ^git version (\d+)\.(\d+)\.(\d+)rrw�s^git version (\d+)\.(\d+)rr�)r�r�r�r�)r,r�r#r#r$�_gitversionrs(zgitsubrepo._gitversioncCs2t�|�}|dkrdS|dkrdS|dkrdSdS)a�ensure git version is new enough

        >>> _checkversion = gitsubrepo._checkversion
        >>> _checkversion(b'git version 1.6.0')
        'ok'
        >>> _checkversion(b'git version 1.8.5')
        'ok'
        >>> _checkversion(b'git version 1.4.0')
        'abort'
        >>> _checkversion(b'git version 1.5.0')
        'warning'
        >>> _checkversion(b'git version 1.9-rc0')
        'ok'
        >>> _checkversion(b'git version 1.9.0.265.g81cdec2')
        'ok'
        >>> _checkversion(b'git version 1.9.0.GIT')
        'ok'
        >>> _checkversion(b'git version 12345')
        'unknown'
        >>> _checkversion(b'no')
        'unknown'
        r�r!)rrrr")r�rr#sok)rr2)r,�versionr#r#r$r+~s
zgitsubrepo._checkversionNFcCs|j|||d�dS)N)r��streamr��_gitdir�r1r�r�r5r#r#r$�_gitcommand�razgitsubrepo._gitcommandcCs|j||||jd�S)N)r�r5r�)r%rr8r#r#r$r7�s
�zgitsubrepo._gitdirc		Cs>|j�d|jd�|�f�|durtj��}d|d<d|vr#d|d<d}|jjr0t�	t
jd�}|jjrDt
|�rD|d	d
krD|�dd�tjt�tj|jg|�d
t�tj|�t�|�tjtj|d�}|rj|jdfS|j����}|��|jd	kr�|jdkr�|d	}|dvr�||jfSt�td�||j|jf��||jfS)z�Calls the git command

        The methods tries to call the git command. versions prior to 1.6.0
        are not supported and very probably fail.
        s%s: git %s
r8Nr�r�sGIT_ALLOW_PROTOCOLsfile:git:http:https:ssh�wr�diffrs--colorr�)r�r�r�r�r�r�)�cat-file�symbolic-refsgit %s error %d in %s) rGrbrrTr	r�rI�quietr�openr�devnull�
_colormoder��insertr�r�r�rr�r$r�r�r�r��readr��waitr�r
r/r)	r1r�r�r5r��errpiper��retdata�commandr#r#r$r%�sH
��

��
zgitsubrepo._gitnodircCr�)N�.gitr�r�r#r#r$�_gitmissing�r_zgitsubrepo._gitmissingcCs|�ddg�S)Ns	rev-parse�HEAD�r9r�r#r#r$�	_gitstate�r_zgitsubrepo._gitstatecCs|�gd��\}}|r
d}|S)N)r=rJr�r6)r1�currentr�r#r#r$�_gitcurrentbranch�szgitsubrepo._gitcurrentbranchcCs>|�ddd|g�}|�d�d}|�d�td�}||d�S)Nsremote�shows-nr�rsURL: )r9�split�indexr�)r1rKr,�liner[r#r#r$�
_gitremote�szgitsubrepo._gitremotecCs|�dd|g�\}}|dkS)Nr<s-err6)r1rxr,�coder#r#r$�_githavelocally�szgitsubrepo._githavelocallycCs|�d||g�}||kS)N�
merge-baserK)r1�r1�r2�baser#r#r$�_gitisancestor�szgitsubrepo._gitisancestorcCs|�gd��dkS)N)�configs--bool�	core.bare�truerKr�r#r#r$�
_gitisbare�rzgitsubrepo._gitisbarecCs|�gd��dS)z�This must be run before git diff-index.
        diff-index only looks at changes to file stat;
        this command looks at file contents and updates the stat.)supdate-index�-qs	--refreshNrKr�r#r#r$�_gitupdatestat�szgitsubrepo._gitupdatestatcCs�i}i}|�gd��}|�d�D],}|�d�\}}|�d�s$|�d�s$q|�d�r/|�d�r/q|||<|�|g��|�q||fS)zcreturns 2 things:
        a map from git branch to revision
        a map from revision to branches)sfor-each-refs--formats%(objectname) %(refname)r�r8srefs/heads/�
refs/remotes/s/HEAD)r9rPrb�endswith�
setdefaultr�)r1�
branch2rev�
rev2branchr,rRrx�refr#r#r$�
_gitbranchmaps ��zgitsubrepo._gitbranchmapc	Csri}|D]2}|�d�rq|�dd�d}|�dd|g�}|r6|�dd|g�}||d||�dd�df<q|S)z4return map of remote branch to local tracking branchrarSrwr[sbranch.%s.remotesbranch.%s.mergesrefs/remotes/%s/%s)rbrPr9)r1�branches�tracking�b�bnamerKrfr#r#r$�_gittrackings
���zgitsubrepo._gittrackingcCs<d|vr|�d�}|dkrd|d|�vr|S||_t|�S)Ns://�:r�rS)�findrBrC)r1r��colonr#r#r$rC)s
zgitsubrepo._abssourcecCs�|��r$t�|�|�|�}|j�td�|j|f�|�d||j	g�|�
|�r+dS|j�td�|j|�d�f�|�dg�|�
|�sRt
�td�||jf��dS)Nrmsclonero�originsfetchs1revision %s does not exist in subrepository "%s"
)rIrrrCrGr�rrr%rrUrSr9r
r/)r1r�rxr#r#r$�_fetch2s,

�
��
���zgitsubrepo._fetchcCs^|��r|jddkS|��rdS|s|jd|��krdS|��|�gd��\}}|dkS)Nrr�T��
diff-indexr�rJ)rIr
r^rLr`r7)r1r�r�r,rTr#r#r$rIJszgitsubrepo.dirtycCs|��Sr�)rLr�r#r#r$r�Xr�zgitsubrepo.basestatecs�|\}�}�s
���dS��|�����r.��gd������kr-��gd��dSn����krF�rD��ddg���gd��dS���\}}��fdd�����fdd�}�|vrd|�dS|�}d}	|D]}
|
d	krz�d	g�dS|	s�|
�d
�s�|
}	ql|	r��|	g�dS��|���}|d}||vr�|D]
}
|
|vr�|
}nq�||vr�|�	dd
�d
}
�d|
|g�dS��
||||�r�||���kr׈||g���dd|g�t�j
�jd�dS|�dS)N)r[r\sfalse)�resets--hardrJrtrJcsDdg}�r��ddg�|�d���||�t�j�jd�dS)Nr�rtrJ�-frH)r9r�r^rGre)r2r�)r�r1r#r$�checkoutrs
z gitsubrepo.get.<locals>.checkoutcs6�j�td��j��j�td���d�g�dS)Ns1checking out detached HEAD in subrepository "%s"
s5check out a git branch if you intend to make changes
r_)rGrSrrr#)rvrxr1r#r$�rawcheckout}s���z#gitsubrepo.get.<locals>.rawcheckoutsrefs/heads/masterrarrSr1s-b�merges--ffrH)r�rqr^r9rLrgrbrlr�rPrZrNr^rGre)r1rr�r�rrrdrerwrh�firstlocalbranchrjrirKrJr#)rvr�rxr1r$rp[sf
�
�
�
zgitsubrepo.getcCsl|��rt�td�|j��ddd|g}tj��}|r!|d|g7}|r+t�	|d�|d<|j
||d�|��S)	N�subrepo %s is missingr�s-ars--authors%Y-%m-%dT%H:%M:%S %1%2sGIT_AUTHOR_DATE)r�)rIr
r/rrr	r�rIr�datestrr9rL)r1r�r�r�r�r�r#r#r$r��s
�zgitsubrepo.commitcs��\}�}��|����d��jdg�������gd��\}}����fdd�}���r`����kr\����jdkpB|dk}t�j�|�jddd��dd��r^|�dSdSdS|�dS)NrVrrrcsF��kr
����n��jdkr��dd�g�t�j�jd�dS)Nrrxs--no-commitrH)rpr
r9r^rGrer#�rYrxr1rr#r$r��s
z#gitsubrepo.merge.<locals>.mergefuncr�)	rqr9r
r`r7rIrLrMrG)r1rr�rrr,rTr�rIr#r|r$r�s 
"�
�
zgitsubrepo.mergec
Cs\|�d�}|jdsdS|��rt�td�|j��|��\}}|jd|vr9||jdD]
}|�d�r8dSq.t	�
|�D]\}}|�d�rS|�|jd|�rSdSq>dg}|r^|�d�|�
�}|r�|�|jd|�sz|j�td�|j�d	S|j�td
�|�dd�d|jf�|�|d
|g�}	|	ddkS|j�td�|j|jdf�d	S)Nr�rTrzsrefs/remotes/origin/spushrs7unrelated git branch checked out in subrepository "%s"
Fs(pushing branch %s of subrepository "%s"
rSrwrprsDno branch checked out in subrepository "%s"
cannot push revision %s
)rpr
rIr
r/rrrgrbr�	iteritemsrZr�rNrGrSr�rPr7)
r1r�r�rdrerjrxr�rM�retr#r#r$r��sZ


�
�
��������zgitsubrepo.pushcs|��rgS|jdddd�}t�}|j|j|j|jfD]}	|�|	�q|j}
|
�	��
��g}�fdd�tt|
��D�}
|
D]:}��|�}
dg}|
rO|�
d�|jsT|
s_|�td�||��||vrk|
rj|�
|�q>|�d�sx|�||g�q>|D]
}|�td	�||��q{|S)
NT)�unknownr)cr�r#r#r�r�r#r$r�%r�z"gitsubrepo.add.<locals>.<listcomp>saddrus
adding %s
r�s%s already tracked!
)rIr��set�modified�added�deletedr)r�r�r�r�r��exactr��verboserrpr9rS)r1rGr
r�r�r�r�r�tracked�lr��rejectedr]r�rGr#r�r$r�s6




�zgitsubrepo.addcCs�|��rdS|��r|j�td�|j�dS|j�td�|j�|�gd��|j�	�D]\}}|dkr7q.|t
jkrC|j�|�q.|j�
|�q.dS)Nrrd)r[r\r]rH)rIrIrGrSrrrer9re�readdir�stat�S_IFDIRrqrU)r1r]rrr#r#r$r�:s$��
�zgitsubrepo.removeTcCsd}|j\}}|s|S|�||�|jd|gdd�}tj|dd�}	t|�}
|jjtd�|
td�d	�}|�	d�|	D]H}|�
�rAq:t�|j
�}
|rN||
�sNq:|��rV|j}n|	�|�}|rb|��}n|j�td
�|
�q:|�||
|j|��|�|d7}|��q:|��|S)NrsarchiveT)r5zr|)�fileobjr�r�r�)r�sskipping "%s" (unknown type)r)r
rqr9�tarfiler?r:rGr�rr��isdirr�fsencoder��issym�linkname�extractfilerCrSr�r�r�r�)r1r�r�r
r�r�r�rx�	tarstream�tarr�r��inforkr�r]r#r#r$r�Ps<
�



zgitsubrepo.archivec
Ksx|jd}|��rdS|��sdS|��D]$}|�dd||fg�}tj|j||j�||�d�}	|	�	|�|	�
�qdS)NrrOs%s:%s)�pathnamer)r
�anypatsr�r9r�makefileobjr�rerVrDrt)
r1r
r�r�r�r�r9r]r��fpr#r#r$r�vs
�

zgitsubrepo.catc	KsH|jd}|��s|st�ggggggg�Sggg}}}|��|r,ddd||g}ndd|g}|�|�}|�d�D]:}	|	�d�}
|
dkrGq;|	|
d|
�|	|
dd�}}|d	krb|�|�q;|d
krl|�|�q;|dkru|�|�q;ggggf\}
}}}gd�}|�	d
�r�|dg7}|�	d�r�|dg7}|�|�}t
�}|�|�|�|�|�|�|�d�D]E}	|	s�q�|	dd�}|	�d�dkr�|	dd��d�\}}n|	dd�}d}|�|�|r�|�|�|dkr�|�|�q�|dkr�|�|�q�|�	d��r|�dg�}|�d�D]
}||v�r|�|��qt�||||
|||�S)Nrs	diff-tree�--no-renamesrrsr��	r��M�A�D)r�s--porcelains-zr�s--untracked-files=all�ignoreds	--ignored�rrwr1s??s!!r)sls-files)
r
rIrr�r`r9rPrnr�rpr�r�r�)r1r�r�rLr�r��removedrGr,rR�tabr�r]r�r�r�r)�changedfiles�st�	filename1�	filename2r#r#r$r��sr



"
�










�

��zgitsubrepo.statusc
KsR|jd}ddg}|dr|�d�n|�d|j�|jr*|�d|d|g�n|�d	|d
|g�|jr=|�d�|jrE|�d�|�|�d
g��dkrX|j	rX|�d�|�|�|rd|�|�d}	|�
�rt|	|�|�d7}	n(|�|�}
dd�|
j|
j
|
jfD�}|D]}||�r�|	|�|d|g�d7}	q�|	��r�|�|	�dSdS)Nrr;r�r�s--stats-U%ds--src-prefix=%s/s--dst-prefix=%s/s--src-prefix=a/%s/s--dst-prefix=b/%s/s--ignore-all-spaces--ignore-space-changer�)r��s--ignore-blank-linesr�r�cSsg|]	}|D]}|�qqSr#r#)r��sublistr]r#r#r$r��s���z#gitsubrepo.diff.<locals>.<listcomp>s--)r
r��context�noprefixr��ignorews�ignorewsamountr2r9�ignoreblanklines�alwaysr�r�r�r�r�rD)
r1rGr�r�r
r�r�rRr�r�r�r�r]r#r#r$r��sJ
��

�



���zgitsubrepo.diffc	Os�|j�td�|d�|�d�sI|�d�}|j}|D]-}tj�|j|�}t	�
|j|j|�}|j�td�|tj�
|�f�t�|j�|�|�q|�d�sU|j|dd�gS)Nr�rr�s#saving current version of %s as %s
r�Tr�)rGr�rrpr�rr rTr�r�
backuppathrArer�r�renamere)	r1ryr�r�r�rZr��
parentname�baknamer#r#r$r��s$


���
zgitsubrepo.revertcCr�)Nr}r#r�r#r#r$r�r�zgitsubrepo.shortid)NF)NFNrrr)'r4r5r6r0r �staticmethodr2r+r9r7r%rIrLrNrSrUrZr^r`rgrlrCrqrErIr�rpr�rr�r�r�r�r�r�r�r�r�r�r#r#r"r$r=s^-


#

6	
X


2
&

&

C
1
r)rirkrj)FT)?�
__future__rrIr&rr�r�r�r<r��xml.dom.minidomr��i18nrr�rrrrxrr	r
rrr
r�rrrrrrrrr��utilsrrrrrvrr:rCrr%r*r/r+rErMr^rhrortr,r��objectr�rr�rrqr#r#r#r$�<module>sj@	
�
exc
�

https://t.me/RX1948 - 2025