Ë äX4¤óîÙ>ãóÄ—ddlZddlmZddlmZddlmZmZm Z m Z m Z m Z mZmZdZdZdZd „Zd „Zd „Zdd „Zd „Zd„Zd„Zdd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!dd„Z"y)éNé)Ú_)Úgetattr)ÚerrorÚmatchÚmergeÚ mergestateÚscmutilÚsparseÚtxnutilÚutils narrowspecsnarrowspec.dirstate)spath:s rootfilesin:cóB—|jd«}t|«||fS)z€Returns the normalized version of a pattern and kind. Returns a tuple with the normalized kind and normalized pattern. ó/)ÚrstripÚ_validatepattern)ÚkindÚpats ú8usr/lib/python3.12/site-packages/mercurial/narrowspec.pyÚnormalizesplitpatternr(s$€ð �*‰*�TÓ €CÜ�SÔØ �ˆ9Ðócó:—t|dzj««S)z?Returns the number of lines in s, including ending empty lines.óx)ÚlenÚ splitlines)Úss rÚ _numlinesr2s€ô ��D‘×$Ñ$Ó&Ó 'Ð'rcóÊ—t|«dkDrtjtd««‚|j d«}d|vsd|vrtjtd««‚y)z®Validates the pattern and aborts if it is invalid. Patterns are stored in the narrowspec as newline-separated POSIX-style bytestring paths. There's no escaping. rs,newlines are not allowed in narrowspec pathsró.s..s0"." and ".." are not allowed in narrowspec pathsN)rrÚAbortrÚsplit)rÚ componentss rrr:s`€ô�ƒ~˜ÒÜ�k‰kœ!ÐKÓLÓMÐMà—‘˜4“€JØ ˆzјU jÑ0Ü�k‰kÜ ÐAÓ Bó ð ð1rcóR—tj||«\}}dt||«zS)zyReturns the normalized version of a text-format pattern. If the pattern has no kind, the default will be added. s%s:%s)ÚmatchmodÚ _patsplitr)ÚpatternÚ defaultkindrrs rÚnormalizepatternr'Ms-€ô ×"Ñ" 7¨KÓ8�I€Dˆ#Ø Ô+¨D°#Ó6Ñ 6Ð6rcóV—|D�chc] }t|«’Œ}}t|«|Scc}w)a”Parses an iterable of patterns into a typed pattern set. Patterns are assumed to be ``path:`` if no prefix is present. For safety and performance reasons, only some prefixes are allowed. See ``validatepatterns()``. This function should be used on patterns that come from the user to normalize and validate them to the internal data structure used for representing patterns. )r'Úvalidatepatterns)ÚpatsÚorigÚress rÚ parsepatternsr-Vs0€ñ/3Ó 3©d dÔ ˜DÕ !¨d€CÐ 3Ü�SÔØ €Jùò 4s…&c óz—tjdt|««5t|t«st j d|z«‚|D]Y}|jt«rŒt jtd«|ztd«djt«z¬«‚ ddd«y#1swYyxYw)a„Validate that patterns are in the expected data structure and format. And that is a set of normalized patterns beginning with ``path:`` or ``rootfilesin:``. This function should be used to validate internal data structures and patterns that are loaded from sources that use the internal, prefixed pattern representation (but can't necessarily be fully trusted). z)narrowspec.validatepatterns(pats size=%d)s'narrow patterns should be a set; got %rs$invalid prefix on narrow pattern: %ss8narrow patterns must begin with one of the following: %ss, ©ÚhintN) r ÚtimedcmrÚ isinstanceÚsetrÚProgrammingErrorÚ startswithÚVALID_PREFIXESrrÚjoin)r*rs rr)r)fs¢€ô �‰ÐAÄ3ÀtÃ9Õ Mܘ$¤Ô$Ü×(Ñ(Ø:¸TÑAóð óˆCØ—>‘>¤.Õ1ô—k‘kÜÐ=Ó>ÀÑDÜð-óð—j‘j¤Ó0ñ 1ôðñ ÷ N× MÑ Mús AB1Á$AB1Â1B:cóz—d}t||z «D] }||dzz }Œ |dz }t|«D] }||dzz }Œ |S)Ns [include] ó s [exclude] )Úsorted)ÚincludesÚexcludesÚoutputÚiÚes rÚformatr@„sU€Ø €FÜ �H˜xÑ'Ö (ˆØ�!�e‘)щð)à ˆnÑ€FÜ �HÖ ˆØ�!�e‘)щðà €Mrcór—|stj«Stj|dg|xsg|xsg¬«S)Nr©ÚincludeÚexclude)r#Úneverr)ÚrootrCrDs rrrŽs8€Ù ô�~‰~ÓÐÜ �>‰>Ø ˆc�2˜wš}¨"°g²mÀô ðrcó¬—tj||d«\}}}|rtjt d««‚t |«t |«||fS)NsnarrowsJincluding other spec files using '%include' is not supported in narrowspec)r Ú parseconfigrrrr))ÚuiÚspecÚ includepatsÚ excludepatsÚprofiless rrHrH™s[€ä)/×);Ñ);¸BÀÀiÓ)PÑ&€K�˜hÙÜ�k‰kÜ ð,ó ó ð ô�[Ô!Ü�[Ô!à ˜ Ð #Ð#rcó8—d}tj|j«rCdtz}|jj |«r|jj t«}|€|jj t«}t|j|«S)Ns %s.pending) r ÚmayhavependingrFÚFILENAMEÚsvfsÚexistsÚtryreadrHrI)ÚreporJÚ pending_paths rÚloadrVªsu€ð €DÜ×јdŸi™iÔ(Ø$¤xÑ/ˆ Ø �9‰9× Ñ ˜LÔ )Ø—9‘9×$Ñ$¤XÓ.ˆDØ €|Ø�y‰y× Ñ ¤Ó*ˆÜ �t—w‘w Ó %Ð%rc󲇇 —|j«}t|«t|«t||«Š |j«}|€d}t j |«‚t |j‰ «}tj|«Šˆfd„}|jd|«|jd|«||_ ˆ fd„}|jdtf|d¬«y)Nú-changing narrow spec outside of a transactioncó(•—‰«}|�d|_yy©N)Ú_pending_narrow_pats©ÚtrÚrÚreporefs €rÚ clean_pendingzsave..clean_pendingÈsø€Ù“ ˆA؈}Ø)-�Õ&ðrs narrow-speccó(•—|j‰«yrZ©Úwrite©ÚfrJs €rÚ write_speczsave..write_specÑ󸀨 �G‰G�D�Mrsstore©Úlocation)Ú unfilteredr)r@Úcurrenttransactionrr4rHrIÚweakrefÚrefÚ addpostcloseÚaddabortr[ÚaddfilegeneratorrP) rTrKrLr]ÚmÚvaluer`rfr_rJs @@rÚsavers·sÇù€Ø �?‰?Ó €Dä�[Ô!Ü�[Ô!Ü �+˜{Ó +€Dà × Ñ Ó "€BØ €zØ ;ˆÜ×$Ñ$ QÓ'Ð'ô˜DŸG™G TÓ*ˆÜ—+‘+˜dÓ#ˆô .ð �‰˜¨ Ô6Ø � ‰ �N MÔ2Ø$)ˆÔ!ô ð ×Ñà Ü ˆKØ Øð õ rcóz‡‡—|j«}|j«}t|jŽŠ|€d}t j |«‚t j|«Šˆfd„}|jd|«|jd|«|j|_ ˆfd„}|jdtf|d¬«y)NrXcó(•—‰«}|�d|_yyrZ)Ú_pending_narrow_pats_dirstater\s €rr`z(copytoworkingcopy..clean_pendingèsø€Ù“ ˆA؈}Ø26�Õ/ðrsnarrow-spec-dirstatecó(•—|j‰«yrZrbrds €rrfz%copytoworkingcopy..write_specñrgrsplainrh) rjrkr@Ú narrowpatsrr4rlrmrnrorvrpÚDIRSTATE_FILENAME)rTr]rqr`rfr_rJs @@rÚcopytoworkingcopyrzÝs°ù€Ø �?‰?Ó €DØ × Ñ Ó "€BÜ �4—?‘?Ð #€DØ €zØ ;ˆÜ×$Ñ$ QÓ'Ð'ô—+‘+˜dÓ#ˆô 7ð �‰Ð/°Ô?Ø � ‰ Ð+¨]Ô;Ø-1¯_©_ˆÔ*ô ð ×Ñà #Ü Ð Ø Øð õ rcóØ—t|«}|j|«g}|s t|«}nºd|vr«g}|D]†}tjtj|««}||vr|j |«ŒAd}|D]+} |j | dz«sŒd}|j |«n|rŒv|j |«Œˆt|«dk(rdh}nt|«}n t|«}|||fS)aVRestricts the patterns according to repo settings, results in a logical AND operation :param req_includes: requested includes :param req_excludes: requested excludes :param repo_includes: repo includes :param repo_excludes: repo excludes :return: include patterns, exclude patterns, and invalid include patterns. spath:.FrTr)r3Úupdater Ú expandpathÚnormpathÚappendr5r) Ú req_includesÚ req_excludesÚ repo_includesÚ repo_excludesÚ res_excludesÚinvalid_includesÚ res_includesÚ req_includeÚvalidÚ repo_includes rÚrestrictpatternsrŠýsù€ô�|Ó$€LØ×ј Ô&ØÐ٠ܘ=Ó)‰ Ø ˜-Ñ '؈ Û'ˆKÜŸ/™/¬$¯-©-¸ Ó*DÓEˆKؘmÑ+Ø×#Ñ# KÔ0ØØˆEÛ -� Ø×)Ñ)¨,¸Ñ*=Õ>Ø �EØ ×'Ñ'¨ Ô4Ùð !.ò Ø ×'Ñ'¨ Õ4ð(ô ˆ|Ó  Ò !Ø%˜;‰Lä˜|Ó,‰Lä˜<Ó(ˆ Ø ˜Ð'7Ð 7Ð7rcóH—|D]}|jj|«ŒyrZ)ÚwvfsÚ unlinkpath)rTÚfilesres rÚ_deletecleanfilesr�&s€Û ˆØ � ‰ ×јQÕñrcó@—tj«}|dj«}|D]Q}|jj |«rŒ|j |t j|j|«dfd«ŒStj|||d|ddd¬«y)NrFsnarrowspec updated)ÚwctxÚmctxÚ overwriteÚ wantfiledata) rÚ mergeresultÚmanifestrŒrRÚaddfileÚ mergestatemodÚ ACTION_GETÚflagsÚ applyupdates)rTÚpctxrŽÚmresultÚmfres rÚ_writeaddedfilesrŸ+s“€Ü×ÑÓ!€GØ ˆd‰× Ñ Ó €BÛ ˆØ�y‰y×Ñ Õ"Ø �O‰OØÜ×(Ñ(Ø—‘˜!“˜eÐ$Ø%õ  ðô ×ÑØ ØØ �$‰ZØ �$‰ZØØö rcó—t|dd«ry|j}|j}|€5|jj t «}t |j|«}||k7r)tjtd«td«¬«‚y)NÚ_updatingnarrowspecFs"working copy's narrowspec is stales&run 'hg tracked --update-working-copy'r/) rrxrvÚvfsrSryrHrIrÚ StateErrorr)rTÚ storespecÚwcspecÚoldspecs rÚcheckworkingcopynarrowspecr§@s‚€äˆtÐ*¨EÔ2ØØ—‘€IØ × /Ñ /€FØ €~Ø—(‘(×"Ñ"Ô#4Ó5ˆÜ˜TŸW™W gÓ.ˆØ �ÒÜ×ÑÜ Ð3Ó 4ÜÐ<Ó=ô ð ðrcó—|j}|€9|jjt«}t |j |«\}}n|\}}|j \}}d|_t|j||¬«}t|j||¬«} tj| |«} tj|| «} |j«€J‚|j} | j|«5| j| gddd¬«\} }}ddd«j |j"z}|j$}|r|j' «n|j' «t)||«t+j,|«}t/|«D]/}|j jt1d«||«z«Œ1t/|j2«D]/}|j jt1d«||«z«Œ1t/|j4«D]/}|j jt1d«||«z«Œ1||zD]}| j7|dd¬ «Œ|d }tj8| t;j<|««} |j?«jA| «D�cgc] }|| vsŒ|‘Œ }}|D]}| j7|ddd¬ «ŒtC|||«d|_y#1swY�ŒîxYwcc}w) zØupdates the working copy and dirstate from the store narrowspec When assumeclean=True, files that are not known to be clean will also be deleted. It is then up to the caller to make sure they are clean. NTrB)ÚsubreposÚignoredÚcleanÚunknowns$not deleting possibly dirty file %s snot deleting unknown file %s snot deleting ignored file %s F)Ú p1_trackedÚ wc_trackedr)r­r®Úpossibly_dirty)"rvr¢rSryrHrIrxr¡rrFr#ÚdifferencematcherÚ currentwlockÚdirstateÚrunning_statusÚstatusÚmodifiedÚaddedr«Úextendr�r Ú getuipathfnr:rr¬rªÚ update_fileÚintersectmatchersr Úmatcherr–ÚwalkrŸ)rTÚ assumecleanÚoldr¦Ú oldincludesÚ oldexcludesÚ newincludesÚ newexcludesÚoldmatchÚnewmatchÚ addedmatchÚ removedmatchÚdsÚlookupr´Ú_mtime_boundaryÚ trackeddirtyr«ÚuipathfnrerœÚnewfiless rÚupdateworkingcopyrÍPs¢€ð × ,Ñ ,€CØ €{Ø—(‘(×"Ñ"Ô#4Ó5ˆÜ#.¨t¯w©w¸Ó#@Ñ ˆ ‘[à#&Ñ ˆ �[Ø#Ÿ™Ñ€K�Ø#€DÔä�T—Y‘Y¨ ¸[ÔI€HÜ�T—Y‘Y¨ ¸[ÔI€HÜ×+Ñ+¨H°hÓ?€JÜ×-Ñ-¨h¸ÓA€Là × Ñ Ó Ð *Ð*Ð *Ø �‰€BØ × Ñ ˜4Õ Ø*,¯)©)Ø ØØØØð +4ó+ Ñ'ˆ�˜÷ !ð—?‘? V§\¡\Ñ1€LØ �L‰L€EÙØ � ‰ �VÕà×јFÔ#Ü�d˜EÔ"Ü×"Ñ" 4Ó(€HÜ �LÖ !ˆØ �‰�‰Ü Ð6Ó 7¹(À1»+Ñ Eõ ð"ô�F—N‘NÖ #ˆØ �‰�‰”qÐ:Ó;¹hÀq»kÑIÕJð$ä �F—N‘NÖ #ˆØ �‰�‰”qÐ:Ó;¹hÀq»kÑIÕJð$à �\Ô !ˆØ �‰�q U°uˆÕ=ð"ð �‰:€Dô×+Ñ+¨J¼¿¹ÀtÓ8LÓM€JØŸ=™=›?×/Ñ/° Ô;ÓKÑ;�a¸qȺ{’Ð;€HÐKÛ ˆØ �‰�q T°dÈ4ˆÕPðä�T˜4 Ô*Ø$€DÕ÷G !Ñ üò>LsÃ.K5Ê4 LÊ>LË5K?)spath)NN)F)#rlÚi18nrÚpycompatrÚrrr#rr r˜r r r r rPryr6rrrr'r-r)r@rHrVrsrzrŠr�rŸr§rÍ©rrÚrÒs‹ðóåÝ÷ ÷ ó ð €à*Ðð€ò ò(ò ó&7ò ò ò<óò$ò" &ò# òL ò@$8òR ò ò*  ô 9%r