\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZddlZddlZddlmZddlmZm Z m Z m Z ddl m Z iZe jeZdZedged d ejdd Zd Zd ZdZdS(s-recreates hardlinks between repository clonesi(tabsolute_importN(t_(terrorthgt registrartutil(t stringutilsships-with-hg-coretrelinks[ORIGIN]t helpcategoryc K@srtjtd s&tjtd r>tjtdntj|j|j|pYd|pbd}|j td|j j |j j f|j |j kr|j tddStj |j j |j j stjtd n|jm|jZtt||}t||j j |j j |}t|j j |j j ||WdQXWdQXdS( srecreate hardlinks between two repositories When repositories are cloned locally, their data files will be hardlinked so that they only use the space of a single repository. Unfortunately, subsequent pulls into either repository will break hardlinks for any files touched by the new changesets, even if both repositories end up pulling the same changes. Similarly, passing --rev to "hg clone" will fail to use any hardlinks, falling back to a complete copy of the source repository. This command lets you recreate those hardlinks and reclaim that wasted space. This repository will be relinked to share space with ORIGIN, which must be on the same local disk. If ORIGIN is omitted, looks for "default-relink", then "default", in [paths]. Do not attempt any read operations on this repository while the command is running. (Both repositories will be locked against writes.) tsamefilet samedevices*hardlinks are not supported on this systemsdefault-relinktdefaultsrelinking %s to %s sthere is nothing to relink Ns/source and destination are on different devices(Rt safehasattrRtAbortRRt repositorytbaseuit expandpathtstatuststoretpathtrootR tlocktsortedtcollecttprunet do_relink(tuitrepotorigintoptstsrct candidatesttargets((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyR!s ) !cC@sttjj}g}t|dj}|dd}|jj}|jtddtdd|}d}|jtd ||fxtj |D]\}} } | j |t||} xt | D]} | d dkrqntj tjj || } t j| js.qn|d 7}|jtjj | | | f|j|d| qWqW|j|jtdt||S(Nttipiit collectingtunittfilesttotalis6tip has %d files, estimated total number of files: %d is.ds.iititems%collected %d candidate storage files (s.ds.i(tlentosRtseptmanifestRt makeprogressRRtwalktsortRtstattjointS_ISREGtst_modetappendtupdatetcomplete(RRtseplenRtliveR%tprogresstpostdirpathtdirnamest filenamestrelpathtfilenametst((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyRNs0 '  " c C@sd}g}|jtddtddt|}d}x|D]\}} |d7}tjj||} tjj||} || | | } | s|jd|qIn|j|| jf|j |d |qIW|j |j td t||S( NcS@sytj|}Wntk r'tSXtj||r>tStj||shtjt dn|j |j kr~tS|S(Ns/source and destination are on different devices( R(R.tOSErrortFalseRR R RR Rtst_size(RtdstR>tts((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyt linkfilterps tpruningR#R$R%iisnot linkable: %s R&s,pruned down to %d probably relinkable files ( R+RR'R(RR/tdebugR2RAR3R4R( RRRBRRDR R7R8tfnR>tsrcpathttgtRC((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyRos$   cC@sd}d}d}d}|jtddtddt|}d} xO|D]G\} } | d7} tjj|| } tjj|| } t| d }t| d }|j|}x8|r|j|}||krPn|j|}qW|j|j|r.|j d | qUny8|| | |j | d | |d7}|| 7}WqUt k r}|j d | t j|fqUXqUW|j|jtd |tj|fdS(NcS@sf|d}tj||ytj||Wn$tk rTtj||nXtj|dS(Ns.bak(R(trenameRtoslinkR?tremove(RRBtbak((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyt relinkfiles  iit relinkingR#R$R%itrbsnot linkable: %s R&s%s: %s s!relinked %d files (%s reclaimed) (R+RR'R(RR/topentreadtcloseRFR3R?twarnRt forcebytestrR4RRt bytecount(RRBR$RRNtCHUNKLENtrelinkedt savedbytesR7R8tftsztsourceRItsfptdfptsintdintinst((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyRsD        ( (t__doc__t __future__RR(R.tmercurial.i18nRt mercurialRRRRtmercurial.utilsRtcmdtabletcommandt testedwithtCATEGORY_MAINTENANCEtNoneRRRR(((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyts  ", ! $