B š•Reo0ã@süddlmZddlZddlZddlZddlmZddlmZm Z m Z m Z ddl m Z ddlmZddlmZmZe d¡Ze d ¡Ze d ¡Ze d ¡ZerÔdd lmZmZdd l mZddlmZddlmZmZe e ¡Z!Gdd„deƒZ"e #e"¡dS)é)Úabsolute_importN)Ú indent_log)Ú display_pathÚis_console_interactiveÚrmtreeÚsplit_auth_from_netloc)Ú make_command)ÚMYPY_CHECK_RUNNING)ÚVersionControlÚvcsz url="([^"]+)"zcommitted-rev="(\d+)"z\s*revision="(\d+)"z(.*))ÚOptionalÚTuple)Ú CommandArgs)Ú HiddenText)ÚAuthInfoÚ RevOptionscsÚeZdZdZdZdZdZedd„ƒZe dd„ƒZ ed d „ƒZ e‡fd d „ƒZ e‡fd d„ƒZ e dd„ƒZedd„ƒZedd„ƒZedd„ƒZd(‡fdd„ Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Z‡ZS))Ú SubversionÚsvnz.svnÚcheckout)rzsvn+sshzsvn+httpz svn+httpszsvn+svncCsdS)NT©)ÚclsÚ remote_urlrrú‹/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/vcs/subversion.pyÚshould_add_vcs_url_prefix+sz$Subversion.should_add_vcs_url_prefixcCsd|gS)Nz-rr)ÚrevrrrÚget_base_rev_args/szSubversion.get_base_rev_argsc Cs¬d}x¢t |¡D]”\}}}|j|kr2g|dd…<q| |j¡tj ||jd¡}tj |¡s^q| |¡\}}||kr~|d}n|rŒ| |¡sšg|dd…<qt ||ƒ}qW|S)zR Return the maximum revision for all files under a given location rNÚentriesú/) ÚosÚwalkÚdirnameÚremoveÚpathÚjoinÚexistsÚ_get_svn_url_revÚ startswithÚmax) rÚlocationÚrevisionÚbaseÚdirsÚ_Ú entries_fnÚdirurlÚlocalrevrrrÚ get_revision3s"      zSubversion.get_revisioncs"|dkrtt|ƒ ||¡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)ÚsuperrÚget_netloc_and_authr)rÚnetlocÚscheme)Ú __class__rrr3OszSubversion.get_netloc_and_authcs2tt|ƒ |¡\}}}| d¡r(d|}|||fS)Nzssh://zsvn+)r2rÚget_url_rev_and_authr&)rÚurlrÚ user_pass)r6rrr7\s zSubversion.get_url_rev_and_authcCs(g}|r|d|g7}|r$|d|g7}|S)Nz --usernamez --passwordr)ÚusernameÚpasswordÚ extra_argsrrrÚ make_rev_argses   zSubversion.make_rev_argscCsV|}xBtj tj |d¡¡sF|}tj |¡}||krt d|¡dSqW| |¡dS)Nzsetup.pyzGCould not find setup.py for directory %s (tried all parent directories)r)rr"r$r#r ÚloggerÚwarningr%)rr(Ú orig_locationÚ last_locationrrrÚget_remote_urlps zSubversion.get_remote_urlc Csrddlm}tj ||jd¡}tj |¡rHt|ƒ}| ¡}WdQRXnd}|  d¡sj|  d¡sj|  d¡r¬t t t j | d¡ƒƒ}|dd=|dd }d d „|Dƒdg}nª|  d ¡rüt |¡}|sÖtd jftƒŽƒ‚| d¡}dd „t |¡Dƒdg}nZy8| dd|g¡} t | ¡ d¡}dd „t | ¡Dƒ}Wn |k rTdg}}YnX|rft|ƒ} nd} || fS)Nr)ÚSubProcessErrorrÚÚ8Ú9Ú10z écSs,g|]$}t|ƒdkr|drt|dƒ‘qS)é )ÚlenÚint)Ú.0Údrrrú –sz/Subversion._get_svn_url_rev..z             zSubversion._get_svn_url_revcCsdS)z&Always assume the versions don't matchFr)rÚdestÚnamerrrÚis_commit_id_equal·szSubversion.is_commit_id_equalNcs,|dkrtƒ}||_d|_tt|ƒ ¡dS)N)rÚuse_interactiveÚ _vcs_versionr2rÚ__init__)Úselfrn)r6rrrp¼s zSubversion.__init__cCsvd}| dg¡}| |¡sdS|t|ƒd… ¡d}| d¡d d¡}yttt|ƒƒ}Wntk rpdSX|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 --versionrNrú-Ú.) rbr&rJrZÚ partitionÚtuplerWrKr])rqÚversion_prefixÚversionÚ version_listÚparsed_versionrrrÚcall_vcs_versionËs  zSubversion.call_vcs_versioncCs"|jdk r|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. N)rorz)rqÚ vcs_versionrrrÚget_vcs_versionés zSubversion.get_vcs_versioncCs&|js dgS| ¡}|dkr"dgSgS)aXReturn 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 - export - switch - update :return: A list of command line arguments to pass to ``svn``. z--non-interactive)rOéz--force-interactive)rnr|)rqÚ svn_versionrrrÚget_remote_call_optionsþs  z"Subversion.get_remote_call_optionsc Csh| |¡\}}t d||¡tƒ<tj |¡r8t|ƒtd|  ¡|  ¡||ƒ}|  |¡WdQRXdS)z@Export the svn repository at the url to the destination locationz!Exporting svn repository %s to %sÚexportN) Úget_url_rev_optionsr>rRrrr"r$rrrÚto_argsrb)rqr(r8Ú rev_optionsÚcmd_argsrrrr€s zSubversion.exportcCsD| ¡}t d||t|ƒ¡tdd| ¡| ¡||ƒ}| |¡dS)NzChecking out %s%s to %srz-q)Ú to_displayr>rRrrrr‚rb)rqrkr8rƒÚ rev_displayr„rrrÚ fetch_new0s  zSubversion.fetch_newcCs&td| ¡| ¡||ƒ}| |¡dS)NÚswitch)rrr‚rb)rqrkr8rƒr„rrrrˆ?szSubversion.switchcCs$td| ¡| ¡|ƒ}| |¡dS)NÚupdate)rrr‚rb)rqrkr8rƒr„rrrr‰GszSubversion.update)N)Ú__name__Ú __module__Ú __qualname__rlr Ú repo_nameÚschemesÚ classmethodrÚ staticmethodrr0r3r7r=rBr%rmrprzr|rr€r‡rˆr‰Ú __classcell__rr)r6rr%s*      2 !r)$Ú __future__rÚloggingrÚreÚpip._internal.utils.loggingrÚpip._internal.utils.miscrrrrÚpip._internal.utils.subprocessrÚpip._internal.utils.typingr Ú pip._internal.vcs.versioncontrolr r Úcompiler[r`rdrcÚtypingr r rrrrÚ getLoggerrŠr>rÚregisterrrrrÚs,           -