I iddlmZddlZddlZddlZddlmZmZddlm Z m Z ddl m Z ddl mZddlmZmZmZmZej(eZGdd eZej0ey) ) annotationsN) BadCommandInstallationError) HiddenText display_path) make_command) path_to_url) RevOptionsVersionControl(find_path_to_project_root_from_repo_rootvcsceZdZdZdZdZdZeddZ ddZ d ddZ d ddZ e dd Z e dd Ze dd Ze dd Ze dd Ze dfd ZxZS) Mercurialhgz.hgclone)zhg+filezhg+httpzhg+httpszhg+sshzhg+static-httpcd|gS)Nz--rev=)revs a/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pip/_internal/vcs/mercurial.pyget_base_rev_argszMercurial.get_base_rev_args!sc4|j}tjd||t||dkrd}n|dk(rd}n |dk(rd}nd}|j t d d g||||j t d g||j | y) NzCloning hg %s%s to %sr)z--quietr) --verbose)rz--debugrz --noupdateupdatecwd) to_displayloggerinfor run_commandrto_args)selfdesturl rev_options verbosity rev_displayflagss r fetch_newzMercurial.fetch_new%s",,.  #      >%1E !^E !^"E,E g|OeOSO$OP   AE A;+>+>+@ A  rcLg}tjj||jd}t j }|dkr|j d |j||jdd|jt|d5}|j|dddtdg||j} |j| |y#1swY9xYw#ttj f$r!} t"j%d || Yd} ~ yd} ~ wwxYw) Nhgrcr-qpathsdefaultwrrz/Could not switch Mercurial repository to %s: %s)ospathjoindirname configparserRawConfigParserappendreadsetsecretopenwriterr#r"OSErrorNoSectionErrorr warning) r$r%r&r'r( extra_flags repo_configconfig config_filecmd_argsexcs rswitchzMercurial.switch=s ggll4v> --/ >   t $ 1 KK $ JJw 3:: 6k3' *; [) * $HR{RK   t $ &/;/T:N;N 8K8K8MN t,rc|jddgdd|j}|j|r t|}|jS)N showconfigz paths.defaultFT show_stdout stdout_onlyr)r"strip_is_local_repositoryr )clslocationr&s rget_remote_urlzMercurial.get_remote_urlfsXoo ? +  %'  # #C (c"Cyy{rcP|jddgdd|j}|S)zW Return the repository-local changeset revision number, as an integer. parentsz--template={rev}FTrLr"rO)rQrRcurrent_revisions r get_revisionzMercurial.get_revisionrs= ?? * + + %'   rcP|jddgdd|j}|S)zh Return the changeset identification hash, as a 40-character hexadecimal string rUz--template={node}FTrLrV)rQrRcurrent_rev_hashs rget_requirement_revisionz"Mercurial.get_requirement_revisions= ?? + , + %'   rcy)z&Always assume the versions don't matchFr)rQr%names ris_commit_id_equalzMercurial.is_commit_id_equalsrc|jdgdd|j}tjj |s=tjj tjj ||}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. rootFTrL)r"rOr2r3isabsabspathr4r )rQrR repo_roots rget_subdirectoryzMercurial.get_subdirectoryslOO H%Tx$ %' ww}}Y' Xy(IJI7)LLrct||}|r|S |jdg|dddd}tjj|jdS#t$rtj d|Yyt $rYywxYw)Nr`FTraise)rrMrN on_returncodelog_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez ) superget_repository_rootr"rr debugrr2r3normpathrstrip)rQrRlocr __class__s rrjzMercurial.get_repository_rootsg)(3 J ! %$  A"ww 011  LL.     sAB=BB)rstrreturnz list[str]) r%rqr&rr'r r(intrrNone)r)rRrqrrrq)r%rqr] str | Nonerrbool)rRrqrrru)__name__ __module__ __qualname__r]r5 repo_nameschemes staticmethodrr+rGr classmethodrSrXr[r^rdrj __classcell__)rps@rrrsH DGIG    ( 7A NQ  : 111 1  1  1< --- -  -  -            M M22rr) __future__rr6loggingr2pip._internal.exceptionsrrpip._internal.utils.miscrrpip._internal.utils.subprocessrpip._internal.utils.urlsr pip._internal.vcs.versioncontrolr r r r getLoggerrwr rregisterrrrrsZ" B=70   8 $b2b2J  Yr