o ]Lb@shddlmZddlZddlZddlZddlZddlmZddlm Z m Z m Z dZ dZ GdddeZdS) )absolute_importN)_)encodingpathutilutils>Ic@s<eZdZddZddZddZddZd d Zd d Zd S)statecCsh|j|_|j|_t|j|_d|_t d|_ |j dd|_ |jdd|_t|j dd|_dS)N fsmonitorsmodeswalk_on_invalidatestimeout)vfs_vfsui_uir normasprefixroot_rootdir _lastclockrfilestat _identityconfigmode configboolwalk_on_invalidatefloattimeout)selfrepor7/usr/lib/python3/dist-packages/hgext/fsmonitor/state.py__init__s zstate.__init__c Csz|dd}Wn ty(}ztd|_|jtjkrWYd}~dSd}~wwtj||_|d}t |dkrL|j ddt || dSz}t t|d}|tkro|j dd|tf| W|dS|d }t |d kr|j dd t || W|dS|d}tt}||kr|j dd ||f| W|dS|d }|d} |d d} W|n|w|| | fS)Nfsmonitor.statesrb)NNNrr s6fsmonitor: state file only has %d bytes, nuking state rs6fsmonitor: version switch from %d to %d, nuking state sLfsmonitor: state file truncated (expected 3 chunks, found %d), nuking state sJfsmonitor: stored hostname "%s" different from current "%s", nuking state )r IOErrorrrrerrnoENOENTfromfpreadlenr log invalidatestructunpack_versionformat_versionclosesplitr strtolocalsocket gethostname) rfileinst versionbytes diskversionr diskhostnamehostnameclock ignorehash notefilesrrrget(sv     !    z state.getc Cs |dur |dStj|jd}||jkr!|jddSz |jddddd}Wnt t fy@|j t dYdSw|C| ttt| ttd| |d| |d|r~| d|| dWddSWddS1swYdS)Nrs1skip updating fsmonitor.state: identity mismatch swbT) atomictemp checkambigs-warning: unable to write out fsmonitor state r )r,rrfrompathr joinrr debugr%OSErrorwarnrwriter-packr/r0rr3r4r5)rr<r=r>identityr6rrrsetks8   "z state.setc Cs`zttj|jddWnty'}z |jtjkrWYd}~nd}~wwt d|_ dS)Ns.hgr) osunlinkpathrCrrEr&r'rrr)rr7rrrr,s  zstate.invalidatecCs ||_dSNr)rr<rrr setlastclocks zstate.setlastclockcCs|jSrNrO)rrrr getlastclockszstate.getlastclockN) __name__ __module__ __qualname__rr?rJr,rPrQrrrrrs C r) __future__rr&rKr4r-mercurial.i18nr mercurialrrrr0r/objectrrrrrs