3 Re*@sddlmZddlZddlZddlmZddlmZmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZmZmZerdd l mZdd lmZejeZGd ddeZejedS))absolute_importN) configparser) BadCommandSubProcessError) display_path) make_command) TempDirectory)MYPY_CHECK_RUNNING) path_to_url)VersionControl!find_path_to_setup_from_repo_rootvcs) HiddenText) RevOptionscseZdZdZdZdZdZed d Zd d Z d dZ ddZ ddZ e ddZe ddZe ddZe ddZe ddZe fddZZS) Mercurialhgz.hgclonehg+filehg+httphg+httpshg+sshhg+static-httpcCs|gS)N)revrr/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el9.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/vcs/mercurial.pyget_base_rev_args'szMercurial.get_base_rev_argsc Cs>tdd*}|j|j|d|jd|g|jdWdQRXdS)z?Export the Hg repository at the url to the destination locationexport)kind)urlarchive)cwdN)runpackpath run_command)selflocationrtemp_dirrrrr+s zMercurial.exportcCsP|j}tjd||t||jtddd|||jtdd|j|ddS)NzCloning hg %s%s to %srz --noupdatez-qupdate)r ) to_displayloggerinforr#rto_args)r$destr rev_options rev_displayrrr fetch_new5s zMercurial.fetch_newc Cstjj||jd}tj}y>|j||jdd|jt |d}|j |WdQRXWn6t tj fk r}zt jd||WYdd}~Xn Xtdd|j}|j||ddS) Nhgrcpathsdefaultwz/Could not switch Mercurial repository to %s: %sr'z-q)r )osr"joindirnamerRawConfigParserreadsetsecretopenwriteOSErrorNoSectionErrorr)warningrr+r#) r$r,rr- repo_configconfig config_fileexccmd_argsrrrswitchDs  zMercurial.switchcCs4|jddg|dtdd|j}|j||ddS)Npullz-q)r r')r#rr+)r$r,rr-rDrrrr'UszMercurial.updatecCs0|jddg|dj}|j|r(t|}|jS)N showconfigz paths.default)r )r#strip_is_local_repositoryr )clsr%rrrrget_remote_url[s   zMercurial.get_remote_urlcCs|jddg|dj}|S)zW Return the repository-local changeset revision number, as an integer. parentsz--template={rev})r )r#rH)rJr%current_revisionrrr get_revisiondszMercurial.get_revisioncCs|jddg|dj}|S)zh Return the changeset identification hash, as a 40-character hexadecimal string rLz--template={node})r )r#rH)rJr%current_rev_hashrrrget_requirement_revisionms z"Mercurial.get_requirement_revisioncCsdS)z&Always assume the versions don't matchFr)rJr,namerrris_commit_id_equalxszMercurial.is_commit_id_equalcCs@|jdg|dj}tjj|s6tjjtjj||}t||S)z~ Return the path to setup.py, relative to the repo root. Return None if setup.py is in the repo root. root)r )r#rHr4r"isabsabspathr5r )rJr% repo_rootrrrget_subdirectory}s  zMercurial.get_subdirectoryc sttt|j|}|r|Sy|jdg|dd}Wn2tk rNtjd|dStk r`dSXtj j |j dS)NrSF)r log_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez ) superrget_repository_rootr#rr)debugrr4r"normpathrstrip)rJr%locr) __class__rrrZs zMercurial.get_repository_root)rrrrrr)__name__ __module__ __qualname__rQr6 repo_nameschemes staticmethodrrr/rEr' classmethodrKrNrPrRrWrZ __classcell__rr)r`rrs    r) __future__rloggingr4pip._vendor.six.movesrpip._internal.exceptionsrrpip._internal.utils.miscrpip._internal.utils.subprocessrpip._internal.utils.temp_dirrpip._internal.utils.typingr pip._internal.utils.urlsr pip._internal.vcs.versioncontrolr r r rr getLoggerrar)rregisterrrrrs