8dJddlmZddlZddlZddlZddlmZmZddlm Z m Z ddl m Z ddl mZddlmZmZmZmZejeZGdd eZejedS) ) annotationsN) BadCommandInstallationError) HiddenText display_path) make_command) path_to_url) RevOptionsVersionControl(find_path_to_project_root_from_repo_rootvcsceZdZdZdZdZdZed d Zd!dZ d"d!dZ d"d!dZ e d#dZ e d#dZe d#dZe d$dZe d%dZe d%fd ZxZS)& Mercurialhgz.hgclone)zhg+filezhg+httpzhg+httpszhg+sshzhg+static-httprevstrreturn list[str]cd|gS)Nz--rev=)rs m/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/vcs/mercurial.pyget_base_rev_argszMercurial.get_base_rev_args!sdesturlr rev_optionsr verbosityintNonecr|}td||t||dkrd}n|dkrd}n |dkrd}nd}|t d d g|||R|t d g||R| dS) NzCloning hg %s%s to %sr)z--quietr) --verbose)r$z--debugrz --noupdateupdatecwd) to_displayloggerinfor run_commandrto_args)selfrrrr rev_displayflagss r fetch_newzMercurial.fetch_new%s",,..  #         >>%1EE !^^EE !^^"EE,E g|OeOSO$OOOPPP   AE A;+>+>+@+@ A A A      rrcg}tj||jd}t j}|dkr|d |||dd|j t|d5}| |dddn #1swxYwYtdg|| R} || |dS#ttjf$r'} t"d || Yd} ~ dSd} ~ wwxYw) Nhgrcr-qpathsdefaultwr%r&z/Could not switch Mercurial repository to %s: %s)ospathjoindirname configparserRawConfigParserappendreadsetsecretopenwriterr,r+OSErrorNoSectionErrorr)warning) r-rrrr extra_flags repo_configconfig config_filecmd_argsexcs rswitchzMercurial.switch=s gll4v>> -// >>   t $ $ $ 1 KK $ $ $ JJw 3: 6 6 6k3'' *; [))) * * * * * * * * * * * * * * * $HR{RK>   t $ $ $ &/;/T:::N;N 8K8K8M8MNNN t,,,,,rlocationc|ddgdd|}||rt|}|S)N showconfigz paths.defaultFT show_stdout stdout_onlyr')r+strip_is_local_repositoryr )clsrOrs rget_remote_urlzMercurial.get_remote_urlfsloo ? +   %''  # #C ( ( #c""Cyy{{rc`|ddgdd|}|S)zW Return the repository-local changeset revision number, as an integer. parentsz--template={rev}FTrRr+rU)rWrOcurrent_revisions r get_revisionzMercurial.get_revisionrsD ?? * + +  %''   rc`|ddgdd|}|S)zh Return the changeset identification hash, as a 40-character hexadecimal string rZz--template={node}FTrRr[)rWrOcurrent_rev_hashs rget_requirement_revisionz"Mercurial.get_requirement_revisionsD ?? + , +  %''   rname str | NoneboolcdS)z&Always assume the versions don't matchFr)rWrras ris_commit_id_equalzMercurial.is_commit_id_equals urc2|dgdd|}tj|s=tjtj||}t||S)z Return the path to Python project root, relative to the repo root. Return None if the project root is in the repo root. rootFTrR)r+rUr7r8isabsabspathr9r )rWrO repo_roots rget_subdirectoryzMercurial.get_subdirectorysOO H%Tx$  %'' w}}Y'' K Xy(I(IJJI7)LLLrc^t|}|r|S |dg|dddd}n8#t$rtd|YdSt $rYdSwxYwtj | dS)NrgFTraise)r'rSrT on_returncodelog_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez ) superget_repository_rootr+rr)debugrr7r8normpathrstrip)rWrOlocr __class__s rrqzMercurial.get_repository_rootsgg))(33  J ! %$  AA    LL.    44    44 w 0 0111sA%A:- A:9A:)rrrr) rrrrrr rrrr )r)rOrrr)rrrarbrrc)rOrrrb)__name__ __module__ __qualname__rar: repo_nameschemes staticmethodrr0rLr% classmethodrXr]r`rerkrq __classcell__)rws@rrrss DGIG   \     : 11111< -----    [     [      [  [ M M M[ M22222[22222rr) __future__rr;loggingr7pip._internal.exceptionsrrpip._internal.utils.miscrrpip._internal.utils.subprocessrpip._internal.utils.urlsr pip._internal.vcs.versioncontrolr r r r getLoggerrxr)rregisterrrrrs&"""""" BBBBBBBB========777777000000  8 $ $b2b2b2b2b2b2b2b2J  Yr