\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c @@sddlmZddlZddlZddlZddlmZddlmZm Z ddl m Z m Z mZmZmZmZmZeZdZdZd Zd Zed Zd Zd ZdZdZdZ dZ!dedZ#dZ$edZ%dZ&eedZ'edZ(edZ)eeeeeeeedZ*dddddddZ+dS(i(tabsolute_importNi(t_(thextnullid(terrortmatchtmergetpathutiltpycompattscmutiltutilc C@st}t}t}d}t}x}|jdD]l}|j}| s7|jdreq7q7|jdr|dj}|r|j|qq7|dkr|r||krtjt di|d6nt }|}q7q7|dkr t }|}q7|r7|dkrStjt d i|d6|d 6d t d n|jjd r|j t di|d6|d 6q7n|j|q7q7W|||fS(sParse sparse config file content. action is the command which is trigerring this read, can be narrow, sparse Returns a tuple of includes, excludes, and profiles. s t#s %include i s [include]s5%(action)s config cannot have includes after excludestactions [exclude]s4%(action)s config entry outside of section: %(line)stlinethints<add an [include] or [exclude] line to declare the entry typet/sPwarning: %(action)s profile cannot use paths starting with /, ignoring %(line)s N( tsettNonetFalsetsplittstript startswithtaddRtAbortRtTruetwarn( tuitrawR tincludestexcludestprofilestcurrentt havesectionR ((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyt parseconfig"sD        cC@s|j|d|jS(s1Resolve the raw content of a sparse profile file.tchangeid(tfilectxtdata(trepotprofileR"((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyt readprofileUsc C@ststttfS|jjd}|sJtttfS|dkrntjtdnt|j |d\}}}||}|rt}x|r|j }||krqn|j |yt |||}Wn_tj k rPd||f} |j jddr:|j j| q|j j| qnXt|j |d\} } } |j| |j| |j| qW|}n|r|j dn|||fS(sObtain sparse checkout patterns for the given rev. Returns a tuple of iterables representing includes, excludes, and patterns. tsparses3cannot parse sparse patterns from working directorys?warning: sparse profile '%s' not found in rev %s - ignoring it tmissingwarnings.hg*N(tenabledRtvfsttryreadRRRRR!RtpopRR'tManifestLookupErrort configboolRtdebugtupdate( R%trevRRRRtctxtvisitedR&tmsgt pincludest pexcludestsubprofs((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pytpatternsforrev[sD             c C@sg|jjD]$}|tkr|jj|^q}t}t}t}xD|D]<}t||\}}} ||O}||O}|| O}q\W|||fS(sDetermine the active sparse config rules. Rules are constructed by reading the current sparse config and bringing in referenced profiles from parents of the working directory. (tdirstatetparentsRt changelogR2RR9( R%tnodetrevst allincludest allexcludest allprofilesR2RRR((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyt activeconfigs7      cC@s|j}|jd}|r0|jd}nd}|dksT|r|dkrttj|jjdj}||d<|r|jjd}ttj|j}||dRLR=RCtkeytresulttmatchersR2RRRReRs((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyRes> :%        c!C@sts |Sg|jD]}|j^q}t||}|jrN|St}i} |rt||jdjg} nt||jg} g} x(|jD]\} } | \}}}|j| | | r| | | |D]6}||sR|jjt d|| }qRqRW|rt j t dn|j }|d} g} g} g} | j } t| }i}x|D] }||}||}|r| s7|r|r||kr| j|}|jj|r~d|fdf||<| j|qd|tfdf||<| j|q|r| s| r| r||kr| j|||krdgdf||ss!a f g am cd dc r dm dg m e k p prN(RR1RaRbRcReRRRRRRR:RRtwvfsR_RfRtdictRRjRkRRRlt normallookup(R%t origstatustorigsparsematchtforcetpendingRptabortRR:R3RbtlookupRrRRRqRtRRtfltstateRvRRR5((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyt refreshwdirsx           %'         "  !   cC@sx||}t||jd}|t|j@rj|j}t|}t|||dtnt|dS(s1Perform actions after a working directory commit.iRN( R9R2RRR`ReRRRw(R%R=R3RRR((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyt aftercommits   c C@sf|jjd}t|j|d\}}} |j} t|} t|j} d| kr|r|jjdt j |j|jn5d| kr|jj dt j |j|jny-t ||||t || | d|SWnktk ra|j| krH|jj|j| O_t j |j|jnt |||| nXdS(s5Update the sparse config and working directory state.R(s exp-sparseRN(R+R,R!RR`ReRt requirementstdiscardR t writerequiresRRWRt ExceptionRR( R%RRRRtremovingRt oldincludest oldexcludest oldprofilest oldstatustoldmatcht oldrequires((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyt_updateconfigandrefreshwdir s*      c C@sx|jf|jjd}t|j|d\}}}| rO| rOdSt|tt|d|WdQXdS(sClears include/exclude rules from the sparse config. The remaining sparse config only has profiles, if defined. The working directory is refreshed, as needed. R(NR(twlockR+R,R!RRR(R%RRRRR((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyt clearrules0s  c C@s|j|jjd}t|j|d\}}}t|\}} } t} x|D]} tjtj | dd} | j }WdQXt|j|d\}}}t |t |t |}|j |||j || |j || t |t |t ||kr_t } q_q_Wd}}}d}| rt || }t ||}t || }tt t||||d|}nt|j|||||WdQXdS(sImport sparse config rules from files. The updated sparse config is written out and the working directory is refreshed, as needed. R(tmodetrbNiR(iii(RR+R,R!RRBRR t posixfilet expandpathtreadRnR1RRRt printchanges(R%toptstpathsRRRRRt aincludest aexcludest aprofilestchangedRTRSt iincludest iexcludest iprofilestoldsizet profilecountt includecountt excludecounttfcounts((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pytimportfromfiles?s4  !  &  c C@s|j{|jjd} t|j| d\} } }|rat}t}t}n$t| }t| }t|}td|Drtjt dn| sh|j |j }}g}x|D]}t j |d\}}|t jks|dkrN|r%|dndtj|||}|j|q|j|qW|}n|r~|j|ne|r|j|nO|r|j|n9|r|j|n#|r|j||j|nt||t||}t|| t| |}t|| t| |}ttt||||d| d|}t|j|||||WdQXdS( sPerform a sparse config update. Only one of the actions may be performed. The new config is written out and a working directory refresh is performed. R(cs@s!|]}tjj|VqdS(N(tosRxtisabs(Rtpat((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pys sspaths cannot be absolutet:RyRRN(RR+R,R!RRtanyRRRRtgetcwdRzt _patsplitRtcwdrelativepatternkindsRt canonpathRfR1tdifference_updateRnRRR(R%tpatsRR}Rtresettdeletet enableprofiletdisableprofileRtusereporootpathsRt oldincludet oldexcludeRt newincludet newexcludet newprofilesRtcwdtabspatstkindpattkindRtapRRRR((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyt updateconfigis\                c C@s|jd|}|j|j|jdtd||j|jdtd||j|jdtd||js|j|jdtd ||j|jd td ||j|jd td |nWdQXdS(s/Print output summarizing sparse config changes.R(tprofiles_addedsProfiles changed: %d tinclude_rules_addedsInclude rules changed: %d texclude_rules_addedsExclude rules changed: %d t files_addedsFiles added: %d t files_droppedsFiles dropped: %d tfiles_conflictingsFiles conflicting: %d N(t formattert startitemt condwritetverboseRtisplain( RRRRRRbRrt conflictingtfm((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyRs  (,t __future__RRgRIRti18nRR=RRRyRRRzRRjRRR R RR*R!R'R9RBRRNRWRXRZR\RwRRReRRRRRRRR(((s6/usr/lib64/python2.7/site-packages/mercurial/sparse.pyts<   4  3  8       " 4 W b #  *  @