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/thread-self/root/lib64/python2.7/site-packages/mercurial/transaction.pyc
�
1�3\c@@s�ddlmZddlZddlmZddlmZmZmZdZ	ddhZ
d	Zd
ZdZ
d�Zeed
�Zdejfd��YZed�ZdS(i(tabsolute_importNi(t_(terrortpycompattutilit	bookmarkstdirstatetalltprefinalizetpostfinalizec@s�fd�}|S(Nc@s7|jdkr'tjtd���n�|||�S(Nis;cannot use transaction when it is already committed/aborted(t_countRtAbortR(tselftargstkwds(tfunc(s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt_active(s	((RR((Rs;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytactive'scC@s�x�|D]�\}}	}
|	s#|r�|o8|df|k}y0||dd|�}|j|	�|j�Wq�tk
r�|td�|��q�Xqy|j|�Wqttfk
r�}
|
jtjkr��q�qXqWg}xd|D]\\}}}}||kr*|r*|d||f�n||}y�|r�|r�|j|�}|j|�}|ov||f|k}y't	j
||d|�|j|�Wqtk
r�|td�|�qXnQ|p�|}y|j|�Wn1ttfk
r}
|
jtjkr�qnXWq�tttj
fk
rJ}
|sK�qKq�Xq�Wd|}|j|�rx|j|�n|j|�y4x-|D]%}|j|�r�|j|�q�q�WWntttj
fk
r�}
nXdS(Nttat
checkambigsfailed to truncate %s
s.couldn't handle %s: unknown cache location %s
sfailed to recover %s
s%s.backupfiles(ttruncatetclosetIOErrorRtunlinktOSErrorterrnotENOENTtjoinRtcopyfiletappendRRtexists(tjournaltreporttopenertvfsmaptentriest
backupentriesRtcheckambigfilestftot_ignoreRtfptinsttbackupfilestltbtctvfstfilepatht
backuppathttarget((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt	_playback/sd








ttransactioncB@s�eZdddddddd�Zd�Zd�Zed��Zed��Zedd��Z	d�Z
eedd	��Zd
�Z
edd��Zeddd
��Zed��Zded�Zed��Zedd��Zedd��Zd�Zd�Zd�Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zd�Z d�Z!RS( s	<unnamed>cC@s�d|_d|_||_||_|j�}||d<||_||_g|_i|_||_	||_
g|_|d	kr�d�}n||_
|	d	kr�d�}	n|	|_t�|_|
r�|jj|
�n|g|_i|_i|_|j|j	d�|_g|_i|_d|j	|_|j|jd�|_|jjdt�|d	k	r�|j|j	|d@�|j|j|d@�ni|_i|_t |_!i|_"i|_#i|_$d	S(
sBegin a new transaction

        Begins a new transaction that allows rolling back writes in the event of
        an exception.

        * `after`: called after the transaction has been committed
        * `createmode`: the mode of the journal file that will be created
        * `releasefn`: called after releasing (with transaction and result)

        `checkambigfiles` is a set of (path, vfs-location) tuples,
        which determine whether file stat ambiguity should be avoided
        for corresponded files.
        iRcS@sdS(N(tNone(ttr((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt<lambda>�RcS@sdS(N(R6(R7tsuccess((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyR8�Rtws%s.backupfiless%d
i�N(%R
t_usagest_reportt_openertcopyt_vfsmapt_aftert_entriest_mapt_journalt	_undonamet_queueR6t
_validatort
_releasefntsett_checkambigfilestupdatet_namestchangesthookargstopent_filet_backupentriest
_backupmapt_backupjournalt_backupsfiletwritetversiontchmodt_filegeneratorst_pendingcallbacktFalset_anypendingt_finalizecallbackt_postclosecallbackt_abortcallback(RR!R"R#tjournalnametundonametaftert
createmodet	validatort	releasefnR&tname((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt__init__jsP				
																		cC@s)dj|j�}d||j|jfS(Nt/s*<transaction name=%s, count=%d, usages=%d>(RRKR
R;(RRd((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt__repr__�scC@s|jr|j�ndS(N(RCt_abort(R((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt__del__�s	cC@s|jjg�dS(s�delay registration of file entry

        This is used by strip to delay vision of strip offset. The transaction
        sees either none or all of the strip actions to be done.N(RER(R((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt
startgroup�scC@s@|jj�}x*|D]"\}}}|j|||�qWdS(s�apply delayed registration of file entry.

        This is used by strip to delay vision of strip offset. The transaction
        sees either none or all of the strip actions to be done.N(REtpopt	_addentry(RtqR'R(tdata((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytendgroup�scC@sc||jks||jkr"dS|jrL|jdj|||f�dS|j|||�dS(s5record the state of an append-only file before updateNi����(RBRQRERRl(RtfiletoffsetRn((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytadd�s	cC@s�||jks||jkr"dS|jj|||f�t|j�d|j|<|jjd||f�|jj�dS(s3add a append-only entry to memory and on-disk stateNis%s%d
(RBRQRARtlenRORTtflush(RRpRqRn((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyRl�sRcC@s�|jr!d}tj|��n||jks?||jkrCdS|j|}|j|�\}}d|j|f}|j||�}	|j	|�r�|j
|�}
|j
|	�}tj|
|d|�nd}	|j
|||	tf�dS(sWAdds a backup of the file to the transaction

        Calling addbackup() creates a hardlink backup of the specified file
        that is used to recover the file in the event of the transaction
        aborting.

        * `file`: the file path, relative to .hg/store
        * `hardlink`: use a hardlink to quickly create the backup
        s/cannot use transaction.addbackup inside "group"Ns%s.backup.%sthardlinkR(RERtProgrammingErrorRBRQR?tsplitRCtreljoinRRRRt_addbackupentryRY(RRpRutlocationtmsgR0tdirnametfilenametbackupfilenamet
backupfileR1R2((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt	addbackup�s	
cC@sS|jj|�t|j�d|j|d<|jjd|�|jj�dS(s0register a new backup entry and write it to diskis%s%s%s%d
N(RPRRsRQRSRTRt(Rtentry((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyRy
scC@s|j|d|tf�dS(s�register a temporary transaction file

        Such files will be deleted when the transaction exits (on both
        failure and success).
        RN(RyRY(RttmpfileRz((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytregistertmpsicC@s||||f|j|<dS(s�add a function to generates some files at transaction commit

        The `genfunc` argument is a function capable of generating proper
        content of each entry in the `filename` tuple.

        At transaction close time, `genfunc` will be called with one file
        object argument per entries in `filenames`.

        The transaction itself is responsible for the backup, creation and
        final write of such file.

        The `genid` argument is used to ensure the same set of file is only
        generated once. Call to `addfilegenerator` for a `genid` already
        present will overwrite the old entry.

        The `order` argument may be used to control the order in which multiple
        generator will be executed.

        The `location` arguments may be used to indicate the files are located
        outside of the the standard directory for transaction. It should match
        one of the key of the `transaction.vfsmap` dictionary.
        N(RW(Rtgenidt	filenamestgenfunctorderRz((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytaddfilegeneratorscC@s ||jkr|j|=ndS(s=reverse of addfilegenerator, remove a file generator functionN(RW(RR�((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytremovefilegenerator:sc
C@s?t}x2t|jj��D]\}}t}|\}}}}	|tk}
|tkrp|tk|
krpqn|j|	}g}z�x�|D]|}
|
|7}
|r�|j	|
d|	�t}n(|j
|
d|	�|
|	f|jk}|j||
ddtd|��q�W||�Wdx|D]}|j
�q"WXqW|S(NRzR:t
atomictempR(RYtsortedRWt	iteritemstTruetgengrouppostfinalizetgengroupalltpostfinalizegeneratorsR?R�R�RIRR(RtsuffixtgrouptanytidR�R�R�R�RzR	R0tfilesRdRR'((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt_generatefiles@s0"


	
cC@sF||jkr!|j|j|S||jkrB|j|j|SdS(N(RBRARQRPR6(RRp((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytfind`s
cC@sl||jkrt|��n|j|}|||f|j|<|jjd||f�|jj�dS(sn
        replace can only replace already committed entries
        that are not pending in the queue
        s%s%d
N(RBtKeyErrorRARORTRt(RRpRqRntindex((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytreplacehs
cC@s2|jd7_|jd7_|jj|�|S(Ni(R
R;RKR(RRd((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytnestvscC@si|jdkr!|jd8_n|jr:|jj�n|jdkre|jdkre|j�ndS(Nii(R
R;RKRkRh(R((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytrelease}s	cC@s
|jdkS(Ni(R
(R((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytrunning�scC@s||j|<dS(s�add a callback to be called when the transaction is pending

        The transaction will be given as callback's first argument.

        Category is a unique identifier to allow overwriting an old callback
        with a newer callback.
        N(RX(Rtcategorytcallback((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt
addpending�scC@slt|j�}x8|D]0}|jj|�|�}|jp@||_qW|j|jdd�O_|jS(spwrite pending file to temporary version

        This is used to allow hooks to view a transaction before commitR�s.pending(R�RXRkRZR�(Rt
categoriestcatR�((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytwritepending�s
cC@s||j|<dS(s�add a callback to be called when the transaction is closed

        The transaction will be given as callback's first argument.

        Category is a unique identifier to allow overwriting old callbacks with
        newer callbacks.
        N(R[(RR�R�((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytaddfinalize�s	cC@s||j|<dS(s�add or replace a callback to be called after the transaction closed

        The transaction will be given as callback's first argument.

        Category is a unique identifier to allow overwriting an old callback
        with a newer callback.
        N(R\(RR�R�((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytaddpostclose�s	cC@s|jj|d�S(s1return a postclose callback added before, or NoneN(R\tgetR6(RR�((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytgetpostclose�scC@s||j|<dS(sadd a callback to be called when the transaction is aborted.

        The transaction will be given as the first argument to the callback.

        Category is a unique identifier to allow overwriting an old callback
        with a newer callback.
        N(R](RR�R�((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytaddabort�s	c
C@sb|jdkr�|j|�d|_|jdt�t|j�}x|D]}|j||�qKWd|_|jdt�n|jd8_|jdkr�dS|jj	�|j
j	�x�|jD]�\}}}}||jkr|r|j
d||f�q�n|j|}|r�|r�|j|�r�y|j|�Wq�tttjfk
r�}|sp�n|j
d|j|�|f�q�Xq�q�Wg|_|j�|jr�|j�d|_n|jj|j�r�|jj|j�n|jj|j�r#|jj|j�nx�|jD]�\}}	}}||jkrq|rq|j
d||f�q-n|j|}|r-|j|�r-y|j|�Wq�tttjfk
r�}|s��n|j
d|j|�|f�q�Xq-q-Wg|_d|_|j|t�d|_t|j�}x|D]}|j||�q:Wd|_dS(scommit the transactioniR�iNs.couldn't remove %s: unknown cache location %s
scouldn't remove %s: %s
s-couldn't remove %s: unknown cache location%s
(R
RFR6R�tgengroupprefinalizeR�R[R�RORRSRPR?R<RRRRRRRRAt
_writeundoR@R=tisfileRRRCRGR�R\(
RR�R�R-R'R.R/R0R+t_f((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyR�sv
	
	

	
	"	
	
	
	"			
cC@s|j�dS(s�abort the transaction (generally called on error, or when the
        transaction is not explicitly committed before going out of
        scope)N(Rh(R((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytabortscC@sm|jdkrdS|jjd|jd�}|jdt�x|jD]\}}}}|shqJn|swd}n�||jkr�|r�|jd||f�qJn|j|}|j	|�\}}	|	j
|j�s�t|	��|	j
|j|jd�}
|j||
�}tj|j|�|j|�dt�|jd	||||f�qJW|j�dS(
s4write transaction data for possible future undo callNs%s.backupfilesR:s%d
Rs-couldn't remove %s: unknown cache location%s
iRus%s%s%s%d
(RDR6R=RNRTRURPR?R<Rwt
startswithRCtAssertionErrorR�RxRRRR�R(RtundobackupfileR-R'R.R/tuR0tbaseRdtuname((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyR�s,			
(!c
C@sld|_d|_|jj�|jj�z|jr�|jr�|jrb|jj	|j�n|j
r�|jj	|j
�ndS|jtd��y�x(t
|j�D]}|j||�q�Wd|_t|j
|j|j|j|j|jtd|j�|jtd��Wn$tk
r@|jtd��nXWdd|_
|j|t�d|_XdS(Nistransaction abort!
R&srollback completed
s(rollback failed - please run hg recover
(R
R;RORRSRARPRRR=RRCR<RR�R]R6R4R?RYRIt
BaseExceptionRG(RR�((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyRh0s2		

			
	N("t__name__t
__module__R6ReRgRiRRjRoRrRlR�R�RyR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RR�R�Rh(((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyR5isJS		

	
	 
				

H	c	C@s�g}g}|j|�}|j�}|j�xt|D]l}	y5|	jd�\}
}|j|
t|�d
f�Wq8tk
r�|td�t	j
|	��q8Xq8Wd|}|j|�r{|j|�}|j�}|r{|dd }
|
dtkrexr|dD]S}|r|d }|jd�\}	}
}}|j|	|
|t
|�f�qqWqx|td��q{nt||||||d	|�d
S(s�Rolls back the transaction contained in the given file

    Reads the entries in the specified file, and the corresponding
    '*.backupfiles' file, to recover from an incomplete transaction.

    * `file`: a file containing a list of entries, specifying where
    to truncate each file.  The file should contain a list of
    fileoffset pairs, delimited by newlines. The corresponding
    '*.backupfiles' file should contain a list of filebackupfile
    pairs, delimited by .

    `checkambigfiles` is a set of (path, vfs-location) tuples,
    which determine whether file stat ambiguity should be avoided at
    restoring corresponded files.
    ss couldn't read journal entry %r!
s%s.backupfilesii����s%dis8journal was created by a different version of Mercurial
R&N(RNt	readlinesRRwRtintR6t
ValueErrorRRtbytestrRRUtboolR4(R"R#RpR!R&R$R%R*tlinesR-R'R(t
backupjournaltvertlineR.R/((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytrollbackPs6

 
"

)(t
__future__RRti18nRRRRRRUR�R�R�R�RR�R6R4t
transactionalR5R�(((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt<module>s			9��