7f-VddlZddlZddlZddlmZmZmZddlmZm Z m Z m Z m Z ddl mZmZddlmZmZmZmZmZejeZejdZejdZejdZejd ZGd d eZejedS) N)ListOptionalTuple) HiddenText display_pathis_console_interactiveis_installable_dirsplit_auth_from_netloc) CommandArgs make_command)AuthInfoRemoteNotFoundError RevOptionsVersionControlvcsz url="([^"]+)"zcommitted-rev="(\d+)"z\s*revision="(\d+)"z(.*)c eZdZdZdZdZdZedede fdZ e dede efd Z ed edefd Zed ed edeeeeeeeffffd Zededeeeeefffd Ze deedeedefdZed edefdZed edeeeeffdZededeede fdZd%dee ddffd ZdeedffdZdeedffdZdefdZdeded ed!eddf d"Z deded eddfd#Z!deded eddfd$Z"xZ#S)& Subversionsvnz.svncheckout)zsvn+sshzsvn+httpz svn+httpszsvn+svnzsvn+file remote_urlreturncdS)NT)clsrs |/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/vcs/subversion.pyshould_add_vcs_url_prefixz$Subversion.should_add_vcs_url_prefix$strevc d|gS)Nz-rr)rs rget_base_rev_argszSubversion.get_base_rev_args(s c{rlocationcd}tj|D]\}}}|j|vrg|dd<||jtj||jd}tj|sw||\}}||kr |J|dz}n|r||sg|dd<t||}t|S)zR Return the maximum revision for all files under a given location rNentries/) oswalkdirnameremovepathjoinexists_get_svn_url_rev startswithmaxstr) rr!revisionbasedirs_ entries_fndirurllocalrevs r get_revisionzSubversion.get_revision,s WX.. / /MD${$&&QQQ KK $ $ $dCKCCJ7>>*-- "33D99 FHx)))| 6#4#4T#:#: QQQ8X..HH8}}rnetlocschemecr|dkr"t||St|S)z This override allows the auth information to be passed to svn via the --username and --password options instead of via the URL. ssh)superget_netloc_and_authr )rr8r9 __class__s rr=zSubversion.get_netloc_and_authIs8 U??77..vv>> >%f---rurlct|\}}}|drd|z}|||fS)Nzssh://zsvn+)r<get_url_rev_and_authr-)rr?r user_passr>s rrAzSubversion.get_url_rev_and_authXsM$gg::3??S) >>( # # 3,CC""rusernamepasswordc.g}|r|d|gz }|r|d|gz }|S)Nz --usernamez --passwordr)rCrD extra_argss r make_rev_argszSubversion.make_rev_args`s=#%  3 <2 2J  3 <2 2Jrc|}t|sX|}tj|}||kr"td|t t|X||\}}|t |S)NzMCould not find Python project for directory %s (tried all parent directories))r r%r)r'loggerwarningrr,)rr! orig_location last_locationr?_revs rget_remote_urlzSubversion.get_remote_urlls! $X.. *$Mwx00H=((*! *)%X.. *((22 T ;% % rcddlm}tj||jd}tj|rz/Subversion._get_svn_url_rev..s5FFF!#a&&1**1*C!II***rz.s(HHHC OOHHHrinfoz--xmlFT show_stdout stdout_onlycRg|]$}t|d%Sr_r`rbs rr\z/Subversion._get_svn_url_rev..s(TTTAAGGAJJTTTr)pip._internal.exceptionsrPr%r)r*r'r+openreadr-listmapr/ splitlinessplit_svn_xml_url_research ValueErrorra _svn_rev_refinditer run_command_svn_info_xml_url_re_svn_info_xml_rev_rer.) rr!rP entries_pathfdatar?r#revsmatchxmlrs rr,zSubversion._get_svn_url_revs>>>>>>w||Hck9EE 7>>, ' ' l## qvvxx               D ??3   %4??3#7#7 %4??4;P;P %3s~tzz*/E/EFFGGG 1 !*Q-CFFwFFF!LDD __W % % %#**400E D !B$!B!BCCC++a..CHH[-A-A$-G-GHHHA3NDD %ooWh/ % $& -33C88(((kk!nnTT1E1N1Ns1S1STTT$ % % % "T %  d))CCCCxs%A<<BB0A2H## H/.H/destnamecdS)z&Always assume the versions don't matchFr)rr~rs ris_commit_id_equalzSubversion.is_commit_id_equals urNuse_interactivec|t}||_d|_tdSN)rr _vcs_versionr<__init__)selfrr>s rrzSubversion.__init__sB  "466O.8< r.cd}|dgdd}||sdS|t|dd}|d dd } t t t|}n#t$rYdSwxYw|S) aQuery the version of the currently installed Subversion client. :return: A tuple containing the parts of the version information or ``()`` if the version returned from ``svn`` could not be parsed. :raises: BadCommand: If ``svn`` is not installed. z svn, version z --versionFTrerNr-.) rur-rXro partitiontuplermrYrr)rversion_prefixversion version_listparsed_versions rcall_vcs_versionzSubversion.call_vcs_versions)""K=eQU"VV!!.11 2#n--//06688;((--a066s;;  "3sL#9#9::NN   22 s"B44 CCcX|j|jS|}||_|S)aReturn the version of the currently installed Subversion client. If the version of the Subversion client has already been queried, a cached value will be used. :return: A tuple containing the parts of the version information or ``()`` if the version returned from ``svn`` could not be parsed. :raises: BadCommand: If ``svn`` is not installed. )rr)r vcs_versions rget_vcs_versionzSubversion.get_vcs_versions7   ($ $++-- 'rcT|jsdgS|}|dkrdgSgS)aCReturn options to be used on calls to Subversion that contact the server. These options are applicable for the following ``svn`` subcommands used in this class. - checkout - switch - update :return: A list of command line arguments to pass to ``svn``. z--non-interactive)r]z--force-interactive)rr)r svn_versions rget_remote_call_optionsz"Subversion.get_remote_call_optionssF# )(( (**,,  & )* * r rev_options verbosityc6|}td||t||dkrdg}ng}t dg|||||R}||dS)NzChecking out %s%s to %srz--quietr) to_displayrIrdrr rto_argsru)rr~r?rr rev_displayflagscmd_argss r fetch_newzSubversion.fetch_news",,..  %         >>KEEE     ( ( * *     ! !         """""rctd||||}||dS)Nswitchr rrrurr~r?rrs rrzSubversion.switch0sT   ( ( * *    ! !      """""rctd|||}||dS)Nupdaterrs rrzSubversion.update:sQ   ( ( * *    ! !     """""rr)$__name__ __module__ __qualname__rr' repo_nameschemes classmethodr/boolr staticmethodrr r7rrr=r rArr rGrNrYr,rrrrrrrrr __classcell__)r>s@rrrs| DGIIG34[stCy\CC[8 . ."% . sE(3-#677 8 . . . . .[ .#s#uS(3-5Q/R#####[# 3- +3J+?     \ cc[.//hsmS6H0I///[/bc#4[   $      %S/8sCx(>##(#7A#NQ# ####0#3#Z#j#T#####3#Z#j#T########rr) loggingr%retypingrrrpip._internal.utils.miscrrrr r pip._internal.utils.subprocessr r pip._internal.vcs.versioncontrolr rrrr getLoggerrrIcompilerprsrwrvrregisterrrrrs ((((((((((EDDDDDDD  8 $ $"*_--bj122 !rz"899!rz"455c#c#c#c#c#c#c#c#L   Zr