�
�c@slddklZddkZddkZddkZd�Zed�Zdefd��YZ d�Z
dS(i�(t_Ncs�fd�}|S(Ncs9|idjotitd���n�|||�S(Nis;cannot use transaction when it is already committed/aborted(tcountterrortAbortR(tselftargstkwds(tfunc(s(/sys/lib/python/mercurial/transaction.pyt_actives ((RR((Rs(/sys/lib/python/mercurial/transaction.pytactivesc
Cs�x�|D]�\}}}|p|o?y||d�i|�Wq�|td�|��q�Xqy ||�i}ti|�Wqtj
o#} | itijo�q�qXqWti|�dS(Ntasfailed to truncate %s
(ttruncateRtnametostunlinktIOErrorterrnotENOENT(
tjournaltreporttopenertentriesRtftotignoretfntinst((s(/sys/lib/python/mercurial/transaction.pyt _playbacksttransactioncBs�eZddd�Zd�Zed��Zed��Zedd��Zed��Z edd��Z
ed��Zd�Zed ��Z
ed
��Zd�ZRS(
cCs�d|_d|_||_||_||_g|_h|_||_g|_t |id�|_
|dj oti|i|d@�ndS(Nitwi�(
tNoneRRRRtafterRtmapt_queuetopentfileR
tchmod(RRRRRt
createmode((s(/sys/lib/python/mercurial/transaction.pyt__init__,s
cCs7|io)|io|i�n|ii�ndS(N(RRt_abortR#tclose(R((s(/sys/lib/python/mercurial/transaction.pyt__del__<s
cCs|iig�dS(N(R!tappend(R((s(/sys/lib/python/mercurial/transaction.pyt
startgroupAscCs||ii�}dig}|D]}|d|d|dfq ~�}|ii|�|ii|�|ii�dS(Nts%s%d
ii(R!tpoptjoinRtextendR#twritetflush(Rtqt_[1]txtd((s(/sys/lib/python/mercurial/transaction.pytendgroupEs
<cCs�||ijodSn|io%|idi|||f�dSn|ii|||f�t|i�d|i|<|iid||f�|ii�dS(Ni�is%s%d
(R R!R*RtlenR#R0R1(RR#toffsettdata((s(/sys/lib/python/mercurial/transaction.pytaddMs
cCs*||ijo|i|i|SndS(N(R RR(RR#((s(/sys/lib/python/mercurial/transaction.pytfind[scCsn||ijot|��n|i|}|||f|i|<|iid||f�|ii�dS(sn
replace can only replace already committed entries
that are not pending in the queue
s%s%d
N(R tKeyErrorRR#R0R1(RR#R8R9tindex((s(/sys/lib/python/mercurial/transaction.pytreplaceas
cCs|id7_|S(Ni(R(R((s(/sys/lib/python/mercurial/transaction.pytnestoscCs
|idjS(Ni(R(R((s(/sys/lib/python/mercurial/transaction.pytrunningtscCsr|id8_|idjodSn|ii�g|_|io|i�nti|i�d|_dS(scommit the transactioniiN( RR#R(RRR
RRR(R((s(/sys/lib/python/mercurial/transaction.pyR(ws
cCs|i�dS(s�abort the transaction (generally called on error, or when the
transaction is not explicitly committed before going out of
scope)N(R'(R((s(/sys/lib/python/mercurial/transaction.pytabort�scCs�d|_|ii�|ipdSn|itd��zZy9t|i|i|i|it �|itd��Wn|itd��nXWdd|_XdS(Nistransaction abort!
srollback completed
s(rollback failed - please run hg recover
(RR#R(RRRRRRtFalseR(R((s(/sys/lib/python/mercurial/transaction.pyR'�s
"N(t__name__t
__module__RR&R)R R+R6R:R;R>R?R@R(RAR'(((s(/sys/lib/python/mercurial/transaction.pyR+s
cCskg}xKt|�i�D]7}|id�\}}|i|t|�df�qWt||||�dS(Nt(R"t readlinestsplitR*tintRR(RR#RRtlRR((s(/sys/lib/python/mercurial/transaction.pytrollback�s (ti18nRR
RRR tTrueRtobjectRRJ(((s(/sys/lib/python/mercurial/transaction.pys<module>s s
|