\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlmZddlmZmZmZdZ ddhZ d Z d Z d Z d Zeed ZdejfdYZedZdS(i(tabsolute_importNi(t_(terrortpycompattutilit bookmarkstdirstatetallt prefinalizet postfinalizec@sfd}|S(Nc@s7|jdkr'tjtdn|||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@sx|D]\}} } | s#| r|o8|df|k} y0||dd| } | j| | jWqtk r|td|qXqy|j|Wqttfk r} | jtjkrqqXqWg}xd|D]\\}}}}||kr*|r*|d||fn||}y|r|r|j|}|j|}|ov||f|k} y't j ||d| |j |Wqtk r|td|qXnQ|p|}y|j|Wn1ttfk r} | jtjkrqnXWqttt j fk rJ} |sKqKqXqWd|}|j|rx|j|n|j|y4x-|D]%}|j|r|j|qqWWnttt 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(ttruncatetclosetIOErrorRtunlinktOSErrorterrnotENOENTtjoinRtcopyfiletappendRR texists(tjournaltreporttopenertvfsmaptentriest backupentriesRtcheckambigfilestftot_ignoreRtfptinstt backupfilestltbtctvfstfilepatht backuppathttarget((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt _playback/sd           t transactioncB@seZddddddddZdZdZedZedZeddZ dZ ee dd Z d Z edd Zed dd ZedZdedZedZeddZeddZdZdZdZedZedZedZedZedZedZedZdZ dZ!RS( s c C@sd|_d|_||_||_|j}||d<||_||_g|_i|_||_ ||_ g|_ |d krd}n||_ | d krd} 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.pytscS@sdS(N(R6(R7tsuccess((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyR8stws%s.backupfiless%d iN(%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#t journalnametundonametaftert 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*(RRKR R;(R Rd((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt__repr__scC@s|jr|jndS(N(RCt_abort(R ((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pyt__del__s cC@s|jjgdS(sdelay 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 startgroupscC@s@|jj}x*|D]"\}}}|j|||qWdS(sapply 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.pytendgroupscC@sc||jks||jkr"dS|jrL|jdj|||fdS|j|||dS(s5record the state of an append-only file before updateNi(RBRQRERRl(R tfiletoffsetRn((s;/usr/lib64/python2.7/site-packages/mercurial/transaction.pytadds  cC@s||jks||jkr"dS|jj|||ft|jd|j|<|jjd||f|jjdS(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.pyRls Rc C@s|jr!d}tj|n||jks?||jkrCdS|j|}|j|\}}d|j|f}|j||} |j |r|j |} |j | } t j | | d|nd} |j ||| tfdS(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 addbackups  cC@sS|jj|t|jd|j|d<|jjd||jjdS(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|tfdS(sregister 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.pyt registertmpsicC@s||||f|j|s   9