Ë  ‹[u— e@ãóÀ—ddlZddlZddlmZddlmZmZhd£Zd„Zdd„Z Gd„d «Z Gd „d e «Z Gd „d e «Z Gd„de «Z Gd„de «Zd„Zdd„Zy)éNé)Ú_)ÚerrorÚpycompat>óhelpóversionónoninteractivecóˆ—|jd«rE|jd«\}}}|dd|vr|t|«|dfS|dddz|vr|t|«|dfSy |jd«r[|dk7rV|jd«sE|dd|dd}}|j|d d«}|d k\r"|t|«||jd |d z«fSy ) aŠCheck if the given arg is a valid unabbreviated option Returns (flag_str, has_embedded_value?, embedded_value, takes_value?) >>> def opt(arg): ... return _earlyoptarg(arg, b'R:q', [b'cwd=', b'debugger']) long form: >>> opt(b'--cwd') ('--cwd', False, '', True) >>> opt(b'--cwd=') ('--cwd', True, '', True) >>> opt(b'--cwd=foo') ('--cwd', True, 'foo', True) >>> opt(b'--debugger') ('--debugger', False, '', False) >>> opt(b'--debugger=') # invalid but parsable ('--debugger', True, '', False) short form: >>> opt(b'-R') ('-R', False, '', True) >>> opt(b'-Rfoo') ('-R', True, 'foo', True) >>> opt(b'-q') ('-q', False, '', False) >>> opt(b'-qfoo') # invalid but parsable ('-q', True, 'foo', False) unknown or invalid: >>> opt(b'--unknown') ('', False, '', False) >>> opt(b'-u') ('', False, '', False) >>> opt(b'-ufoo') ('', False, '', False) >>> opt(b'--') ('', False, '', False) >>> opt(b'-') ('', False, '', False) >>> opt(b'-:') ('', False, '', False) >>> opt(b'-:foo') ('', False, '', False) ó--ó=éNFTó-s-:rró:)óFrF)Ú startswithÚ partitionÚboolÚfind)ÚargÚ shortlistÚnamelistÚflagÚeqÚvalÚis ú7usr/lib/python3.12/site-packages/mercurial/fancyopts.pyÚ _earlyoptargrsæ€ðb ‡~�~�eÔØŸ ™  dÓ+‰ ˆˆb�#Ø ��ˆ8�xÑ Øœ˜b› 3¨Ð-Ð -Ø ��ˆ8�d‰?˜hÑ &Øœ˜b› 3¨Ð,Ð ,ð "ð �‰˜Ô  #¨¢+°c·n±nÀUÔ6Kؘ˜�G˜S  ˜WˆcˆØ �N‰N˜4  ˜8Ó $ˆØ �Š6Øœ˜c› C¨×)=Ñ)=¸dÀAÈÁEÓ)JÐJÐ JØ !rcó¢—g}g}d}|t|«kr¤||}|dk(r|| z }n“t|||«\} } } } | s| r|dzt|«k\rnk| r| r| s|r|j|«|dz }n=nK| | k(r|j| | f«|dz }n|j| ||dzf«|dz }|t|«krŒ¤|j||d«||fS)as Parse options like getopt, but ignores unknown options and abbreviated forms If gnu=False, this stops processing options as soon as a non/unknown-option argument is encountered. Otherwise, option and non-option arguments may be intermixed, and unknown-option arguments are taken as non-option. If keepsep=True, '--' won't be removed from the list of arguments left. This is useful for stripping early options from a full command arguments. >>> def get(args, gnu=False, keepsep=False): ... return earlygetopt(args, b'R:q', [b'cwd=', b'debugger'], ... gnu=gnu, keepsep=keepsep) default parsing rules for early options: >>> get([b'x', b'--cwd', b'foo', b'-Rbar', b'-q', b'y'], gnu=True) ([('--cwd', 'foo'), ('-R', 'bar'), ('-q', '')], ['x', 'y']) >>> get([b'x', b'--cwd=foo', b'y', b'-R', b'bar', b'--debugger'], gnu=True) ([('--cwd', 'foo'), ('-R', 'bar'), ('--debugger', '')], ['x', 'y']) >>> get([b'--unknown', b'--cwd=foo', b'--', '--debugger'], gnu=True) ([('--cwd', 'foo')], ['--unknown', '--debugger']) restricted parsing rules (early options must come first): >>> get([b'--cwd', b'foo', b'-Rbar', b'x', b'-q', b'y'], gnu=False) ([('--cwd', 'foo'), ('-R', 'bar')], ['x', '-q', 'y']) >>> get([b'--cwd=foo', b'x', b'y', b'-R', b'bar', b'--debugger'], gnu=False) ([('--cwd', 'foo')], ['x', 'y', '-R', 'bar', '--debugger']) >>> get([b'--unknown', b'--cwd=foo', b'--', '--debugger'], gnu=False) ([], ['--unknown', '--cwd=foo', '--', '--debugger']) stripping early options (without loosing '--'): >>> get([b'x', b'-Rbar', b'--', '--debugger'], gnu=True, keepsep=True)[1] ['x', '--', '--debugger'] last argument: >>> get([b'--cwd']) ([], ['--cwd']) >>> get([b'--cwd=foo']) ([('--cwd', 'foo')], []) >>> get([b'-R']) ([], ['-R']) >>> get([b'-Rbar']) ([('-R', 'bar')], []) >>> get([b'-q']) ([('-q', '')], []) >>> get([b'-q', b'--']) ([('-q', '')], []) '--' may be a value: >>> get([b'-R', b'--', b'x']) ([('-R', '--')], ['x']) >>> get([b'--cwd', b'--', b'x']) ([('--cwd', '--')], ['x']) value passed to bool options: >>> get([b'--debugger=foo', b'x']) ([], ['--debugger=foo', 'x']) >>> get([b'-qfoo', b'x']) ([], ['-qfoo', 'x']) short option isn't separated with '=': >>> get([b'-R=bar']) ([('-R', '=bar')], []) ':' may be in shortlist, but shouldn't be taken as an option letter: >>> get([b'-:', b'y']) ([], ['-:', 'y']) '-' is a valid non-option argument: >>> get([b'-', b'y']) ([], ['-', 'y']) rr rr N)ÚlenrÚappendÚextend) ÚargsrrÚgnuÚkeepsepÚ parsedoptsÚ parsedargsÚposrrÚhasvalrÚtakevals rÚ earlygetoptr*]s€ðd€JØ€JØ €CØ ”�D“ Š/Ø�3‰iˆØ �%Š<Ø �w�;Ñ ˆCØ Ü%1°#°yÀ(Ó%KÑ"ˆˆf�c˜7Ù™' c¨A¡g´°T³Ò&:à Ù‘v¡gáØ×!Ñ! #Ô&Ø�q‘‘àØ �wÒ à × Ñ ˜t S˜kÔ *Ø �1‰H‰Cð × Ñ ˜t T¨#°©'¡]Ð3Ô 4Ø �1‰HˆCð/ ”�D“ ‹/ð2×Ñ�d˜3˜4�jÔ!Ø �zÐ !Ð!rcó^—eZdZdZej Zd„Zd„Zd„Z ejd„«Z y)Ú customoptz2Manage defaults and mutations for any type of opt.có—||_y©N©Ú _defaultvalue)ÚselfÚ defaultvalues rÚ__init__zcustomopt.__init__Ôs €Ø)ˆÕrcó—y)NF©©r1s rÚ _isbooloptzcustomopt._isboolopt×s€Ørcó—|jS)zŒReturns the default value for this opt. Subclasses should override this to return a new value if the value type is mutable.r/r6s rÚgetdefaultvaluezcustomopt.getdefaultvalueÚs€ð ×!Ñ!Ð!rcó—y)zzAdds newparam to oldstate and returns the new state. On failure, abort can be called with a string error message.Nr5©r1ÚoldstateÚnewparamÚaborts rÚnewstatezcustomopt.newstateás�rN) Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚabcÚABCMetaÚ __metaclass__r3r7r9Úabstractmethodr?r5rrr,r,Ïs9„Ù<à—K‘K€Mò*òò"ð ×ÑñHóñHrr,có—eZdZd„Zd„Zy)Ú _simpleoptcóL—t|jttd«f«Sr.)Ú isinstancer0rÚtyper6s rr7z_simpleopt._isbooloptés€Ü˜$×,Ñ,¬t´T¸$³ZÐ.@ÓAÐArcó—|Sr.r5r;s rr?z_simpleopt.newstateìs€ØˆrN)r@rArBr7r?r5rrrIrIès „òBórrIcó$‡—eZdZˆfd„Zd„ZˆxZS)Ú _callableoptcó:•—||_tt|�d«yr.)Ú callablefnÚsuperrOr3)r1rQÚ __class__s €rr3z_callableopt.__init__ñsø€Ø$ˆŒÜ Œl˜DÑ*¨4Õ0rcó$—|j|«Sr.)rQr;s rr?z_callableopt.newstateõs€Ø�‰˜xÓ(Ð(r)r@rArBr3r?Ú __classcell__)rSs@rrOrOðs ø„ô1ö)rrOcó—eZdZd„Zd„Zy)Ú_listoptcó —|jddSr.r/r6s rr9z_listopt.getdefaultvalueús€Ø×!Ñ!¡!Ð$Ð$rcó(—|j|«|Sr.)r r;s rr?z_listopt.newstateýs€Ø�‰˜Ô!؈rN)r@rArBr9r?r5rrrWrWùs „ò%órrWcó—eZdZd„Zy)Ú_intoptcóZ— t|«S#t$r|td««YywxYw)Ns expected int)ÚintÚ ValueErrorrr;s rr?z_intopt.newstates-€ð &Ü�x“=Ð øÜò &Ù ”!�OÓ$Ö %ð &ús ‚ �*©*N)r@rArBr?r5rrr[r[s„ó&rr[cóæ—t|t«r|St|«r t|«St|t«rt |dd«St |«t d«ur t|«St|«S)zzfancyopts..abort}s9ø€Ü×&Ñ&ÜÐ;Ó<Ü×,Ñ,¨SÓ1°3¸Ð:ñ;óðr)rr!ÚgetÚreplacercr9r7Ú nevernegaterr Ú functoolsÚpartialr*rÚ gnugetoptbÚgetoptbr?)r"ÚoptionsÚstater#ÚearlyÚ optaliasesrrÚargmapÚdefmapÚ negationsÚoÚalllongÚoptionÚshortÚnamerbÚcommentÚdummyÚonamesÚnÚinsertÚparseÚoptsÚboolvalÚnegationÚobjr>rlrs @@rÚ fancyoptsrŠsƒù€ð8ÐØˆ Ø€HØ€IØ €FØ €FØ€IÙ$Ó%™W˜ˆq�‹t˜W€GÐ%äˆÜ ˆv‹;˜!Ò Ø39Ñ 0ˆE�4˜ '©5à,2Ñ )ˆE�4˜ 'à�ˆØ� ‰ �j—n‘n T¨2Ó.Ô/Ø�|‰|˜D $Ó'ˆà#ˆˆt�e‰|ÑÛˆAØ $ˆF�5˜1‘9Ò ðä" 7Ó+ˆˆt‰ ð˜T‘l×2Ñ2Ó4ˆˆd‰ ð�d‰|×&Ñ&Ô(ÙØ˜‘ �Ù(.Ó/© 1�a˜$“h¨ˆFÑ/Ø œÑ $Û�Ø—<‘< Ô'ؘq˜r˜U‘Fà# a™Z�Fð Ò(Ø! A™I¨iÑ7Ð7Ð7Ø05¸± �I˜e f™nÑ-Ø—O‘O FÕ+ðñ Ø ˜Ñ ˆIÛ Ø �O‰O˜FÖ #ðOñT Ü×!Ñ!¤+°3Ô7‰Ù Ü×#Ñ#‰ä× Ñ ˆÙ�t˜Y¨Ó1�J€Dˆ$󉈈S؈ؗ=‘=  eÓ,ˆÙ ؈C؈GØ�c‰{ˆØ�T‰lˆØ �>‰>Ô Ø!ˆE�$ŠKõ ð ! ™,×/Ñ/°°d± ¸SÀ%ÓHˆE�$ŠKð%ð* €KùòU&ùò00s • Hà H)FF)FFN)rDrpÚi18nrÚrrrorr*r,rIrOrWr[rcrŠr5rrÚr�spðó Ûå÷ò € ò<"ó~o"÷dHñHô2�ôô)�9ô)ôˆyôô&ˆiô&ò #ômr