HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/2078924/root/lib64/python2.7/site-packages/hgext/uncommit.pyo
�
1�3\c@@sAdZddlmZddlmZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZiZeje�ZiZeje�Zeddde�dZd	�Zd
�Zeddd
eed�fgejed�dej�d��Zd�Zedgdejde�d��ZdS(sHuncommit part or all of a local changeset (EXPERIMENTAL)

This command undoes the effect of a local commit, returning the affected
files to their uncommitted state. This means that files modified, added or
removed in the changeset will be left unchanged, and so will remain modified,
added and removed in the working directory.
i(tabsolute_import(t_(tcmdutiltcommandstcontexttcopiesterrortnodetobsutiltpycompatt	registrartrewriteutiltscmutiltexperimentaltuncommitondirtywdirtdefaultsships-with-hg-corec	@s|j�}t|j��}t�fd�|D��}|sDdS||�|sh|j�dj�Stj||��t�fd��j	�D���|d
�fd�}t
j|d|j�tjgd|j
�d�d|d	|j�d
|j�d|j��}|j|�S(srRecommit ctx with changed files not in match. Return the new
    node identifier, or None if nothing changed.
    c3@s!|]}�|�r|VqdS(N((t.0tf(tmatch(s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pys	<genexpr>=sic3@s-|]#\}}|�kr||fVqdS(N((Rtdsttsrc(tfiles(s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pys	<genexpr>Js	c
@sc||krdS||}tj|||j�|j�|j�|j�d�j|��}|S(Ntcopied(tNoneRt
memfilectxtpathtdatatislinktisexectget(trepotmemctxRt
contentctxtredirecttfctxtmctx(R(s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pyt	filectxfnLs
	tparentsttextRR$tusertdatetextraN((tp1tsetRRR%RRt
pathcopiestdictt	iteritemsRRtnullidtdescriptionR'R(R)t	commitctx(	RtctxRt
keepcommittbasetinitialfilestexcludeR$tnew((RRRs4/usr/lib64/python2.7/site-packages/hgext/uncommit.pyt_commitfiltered6s(
"
c
@s�|j}t|j��}|}x4|jD])}||dkrGq+n|j|�q+WxQ|jD]F}||dkr�|j|�qb||dkrb|j|�qbqbWxQ|jD]F}||dkr�|j|�q�||dkr�|j	|�q�q�Wi�x?|j|jD]-}||j
�}|r|d�|<qqW�j|�t�fd��j�D��}x[|j�D]M\}	}||ks�|	|ks�||	dkr�d}n|j||	�q�WdS(s� fix the dirstate after switching the working directory from oldctx to
    newctx which can be result of either unamend or uncommit.
    trtaic3@s-|]#\}}|�j||�fVqdS(N(R(RRR(t	oldcopies(s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pys	<genexpr>�sN(tdirstateR-RtmodifiedtnormallookuptaddedtdroptaddtremovedtremovetrenamedtupdateR.Rtcopy(
RtoldctxtnewctxtstatustdsRtsRRR((R;s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pyt_fixdirstate`s:	
(	tuncommitttkeeps'allow an empty commit after uncommitings[OPTION]... [FILE]...thelpcategoryc
O@s�tj|�}|j���|j���|rV|jjdd�rVtj|�n|d}tj	||j
�gd�t|j��dkr�t
jtd���n|jd��"tj|||�}|jd�p�|}t||||�}|dkr|jtd��dSi}||j�j�krR|f||j�<nd||j�<tj||dd	t�|jj��M|jj|tj�|j�j|d
|�}	t|||||	�WdQXWdQXWdQXWdQXdS(
s�uncommit part or all of a local changeset

    This command undoes the effect of a local commit, returning the affected
    files to their uncommitted state. This means that files modified or
    deleted in the changeset will be left unchanged, and so will remain
    modified in the working directory.

    If no files are specified, the commit will be pruned, unless --keep is
    given.
    R
Rt.RMiscannot uncommit merge changesetROsnothing to uncommit
tfixphaseRN(( R	tbyteskwargstwlocktlocktuit
configboolRt
bailifchangedRtprechecktrevtlenR%RtAbortRttransactionRRRR8RRIR*RtcleanupnodestTrueR<tparentchanget
setparentsR/RL(
RVRtpatstoptstoldRR3tnewidtmappingRK((s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pyRM�s4



cc@sJxC|j�jjj|j�d�D]}tj|j�|�Vq%WdS(sFyields the obsolete markers marking the given changeset as a successorN((RtobsstoretpredecessorsRRRtmarker(R2R((s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pytpredecessormarkers�s+tunamendt	helpbasicc@s|j�}|j���|j���|jd���|d}tj||j�gd�tt|��}t	|�dkr�t
d�}tj|t	|���n|dj
�}||��j�}|j�|d<�fd�}	tj|d�j��j�fd	�j�d
�j�d|	d�j�d
�j�d|�}
|j|
�}||}|j}
|
j��=|
j|tj�|j�|�}t||||�WdQXi|f|j�6}t j!||ddt"�WdQXWdQXWdQXdS(s3undo the most recent amend operation on a current changeset

    This command will roll back to the previous version of a changeset,
    leaving working directory in state in which it was before running
    `hg amend` (e.g. files modified as part of an amend will be
    marked as modified `hg status`)
    RkRQis:changeset must have one predecessor, found %i predecessorsitunamend_sourcec@s*y�j|�SWntk
r%dSXdS(N(tfilectxtKeyErrorR(Rtctx_R(tpredctx(s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pyR$�s
R%R&RR$R'R(R)NRR(#t
unfilteredRTRUR]RRYRZtlistRjR[RRR\tprednodeR)thexRRR*tp2R0RR'R(R1R<R`RaRR/RIRLRR^R_(RVRRctunfitcurctxtmarkersteRttextrasR$RHtnewprednodet
newpredctxR<RKRf((Rqs4/usr/lib64/python2.7/site-packages/hgext/uncommit.pyRk�s@



	
	
N(t__doc__t
__future__Rtmercurial.i18nRt	mercurialRRRRRRRR	R
RRtcmdtabletcommandtconfigtablet
configitemtFalset
testedwithR8RLtwalkoptstCATEGORY_CHANGE_MANAGEMENTRMRjR_Rk(((s4/usr/lib64/python2.7/site-packages/hgext/uncommit.pyt<module>s(L	*	*/