Reo0@s`ddlmZddlZddlZddlZddlmZddlmZm Z m Z m Z ddl m Z ddlmZddlmZmZejdZejd Zejd Zejd Zer*dd lmZmZdd l mZddlmZddlmZmZeje Z!GdddeZ"ej#e"dS))absolute_importN) indent_log) display_pathis_console_interactivermtreesplit_auth_from_netloc) make_command)MYPY_CHECK_RUNNING)VersionControlvcsz url="([^"]+)"zcommitted-rev="(\d+)"z\s*revision="(\d+)"z(.*))OptionalTuple) CommandArgs) HiddenText)AuthInfo RevOptionscs?eZdZdZdZdZd+Zedd Ze d d Z ed d Z efddZ efddZ e ddZeddZeddZeddZdfddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*ZS), Subversionsvnz.svncheckoutsvn+sshsvn+http svn+httpssvn+svncCsdS)NT)cls remote_urlrr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/vcs/subversion.pyshould_add_vcs_url_prefix+sz$Subversion.should_add_vcs_url_prefixcCs d|gS)Nz-rr)revrrrget_base_rev_args/szSubversion.get_base_rev_argsc Csd}xtj|D]\}}}|j|krGg|dds z/Subversion._get_svn_url_rev..z! &  zSubversion._get_svn_url_revcCsdS)z&Always assume the versions don't matchFr)rdestnamerrris_commit_id_equalszSubversion.is_commit_id_equalNcs>|dkrt}||_d|_tt|jdS)N)ruse_interactive _vcs_versionr6r__init__)selfrr)r:rrrts     zSubversion.__init__c Csd}|jdg}|j|s+fS|t|djd}|jddjd}yttt|}Wntk rfSYnX|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 --versionNr-.) rfr*rNr^ partitiontupler[rOra)ruversion_prefixversion version_listparsed_versionrrrcall_vcs_versions   zSubversion.call_vcs_versioncCs/|jdk r|jS|j}||_|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)rsr~)ru vcs_versionrrrget_vcs_versions   zSubversion.get_vcs_versioncCs3|jsdgS|j}|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-interactiverSz--force-interactive)rSr)rrr)ru svn_versionrrrget_remote_call_optionss   z"Subversion.get_remote_call_optionsc Cs|j|\}}tjd||tRtjj|rNt|td|j |j ||}|j |WdQRXdS)z@Export the svn repository at the url to the destination locationz!Exporting svn repository %s to %sexportN) get_url_rev_optionsrBrVrr"r&r(rrrto_argsrf)rur,r< rev_optionscmd_argsrrrrs   zSubversion.exportcCs`|j}tjd||t|tdd|j|j||}|j|dS)NzChecking out %s%s to %srz-q) to_displayrBrVrrrrrf)ruror<r rev_displayrrrr fetch_new0s  zSubversion.fetch_newcCs5td|j|j||}|j|dS)Nswitch)rrrrf)ruror<rrrrrr?s zSubversion.switchcCs2td|j|j|}|j|dS)Nupdate)rrrrf)ruror<rrrrrrGs zSubversion.update)rrrrr)__name__ __module__ __qualname__rpr$ repo_nameschemes classmethodr staticmethodrr4r7r;rArFr)rqrtr~rrrrrrrr)r:rr%s*    2   !   r)$ __future__rloggingr"repip._internal.utils.loggingrpip._internal.utils.miscrrrrpip._internal.utils.subprocessrpip._internal.utils.typingr pip._internal.vcs.versioncontrolr r compiler_rdrhrgtypingr r rrrr getLoggerrrBrregisterrrrrs*   ",