B Re*@sddlmZddlZddlZddlmZddlmZmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZmZmZerdd l mZdd lmZeeZGd ddeZeedS))absolute_importN) configparser) BadCommandSubProcessError) display_path) make_command) TempDirectory)MYPY_CHECK_RUNNING) path_to_url)VersionControl!find_path_to_setup_from_repo_rootvcs) HiddenText) RevOptionscseZdZdZdZdZdZeddZddZ d d Z d d Z d dZ e ddZe ddZe ddZe ddZe ddZe fddZZS) Mercurialhgz.hgclone)rzhg+filezhg+httpzhg+httpszhg+sshzhg+static-httpcCs|gS)N)revrr/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/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|}td||t||tddd|||jtdd||ddS)NzCloning hg %s%s to %srz --noupdatez-qupdate)r) to_displayloggerinforrrto_args)rdestr rev_options rev_displayrrr fetch_new5s zMercurial.fetch_newc Cstj||jd}t}y>|||dd|jt |d}| |WdQRXWn6t tj fk r}zt d||Wdd}~XYn Xtdd|}|j||ddS) Nhgrcpathsdefaultwz/Could not switch Mercurial repository to %s: %sr"z-q)r)osrjoindirnamerRawConfigParserreadsetsecretopenwriteOSErrorNoSectionErrorr$warningrr&r) rr'rr( repo_configconfig config_fileexccmd_argsrrrswitchDs  zMercurial.switchcCs4|jddg|dtdd|}|j||ddS)Npullz-q)rr")rrr&)rr'rr(r?rrrr"UszMercurial.updatecCs0|jddg|d}||r(t|}|S)N showconfigz paths.default)r)rstrip_is_local_repositoryr )clsr rrrrget_remote_url[s   zMercurial.get_remote_urlcCs|jddg|d}|S)zW Return the repository-local changeset revision number, as an integer. parentsz--template={rev})r)rrC)rEr current_revisionrrr get_revisiondszMercurial.get_revisioncCs|jddg|d}|S)zh Return the changeset identification hash, as a 40-character hexadecimal string rGz--template={node})r)rrC)rEr current_rev_hashrrrget_requirement_revisionms z"Mercurial.get_requirement_revisioncCsdS)z&Always assume the versions don't matchFr)rEr'namerrris_commit_id_equalxszMercurial.is_commit_id_equalcCs@|jdg|d}tj|s6tjtj||}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)rrCr/risabsabspathr0r )rEr repo_rootrrrget_subdirectory}s  zMercurial.get_subdirectorycsttt||}|r|Sy|jdg|dd}Wn2tk rNtd|dStk r`dSXtj | dS)NrNF)rlog_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez ) superrget_repository_rootrrr$debugrr/rnormpathrstrip)rEr locr) __class__rrrUs zMercurial.get_repository_root)__name__ __module__ __qualname__rLr1 repo_nameschemes staticmethodrrr*r@r" classmethodrFrIrKrMrRrU __classcell__rr)r[rrs    r) __future__rloggingr/pip._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 getLoggerr\r$rregisterrrrrs