7fddlZddlZddlZddlmZmZmZddlmZm Z ddl m Z m Z ddl mZddlmZddlmZmZmZmZejeZGdd eZejedS) N)ListOptionalTuple) BadCommandInstallationError) HiddenText display_path) make_command) path_to_url) RevOptionsVersionControl(find_path_to_project_root_from_repo_rootvcsc eZdZdZdZdZdZedede efdZ ded e d e d e dd f d Zded e d e dd fdZded e d e dd fdZededefdZededefdZededefdZededeedefdZededeefdZededeeffd ZxZS) Mercurialhgz.hgclone)zhg+filezhg+httpzhg+httpszhg+sshzhg+static-httprevreturncd|gS)Nz--rev=)rs {/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/vcs/mercurial.pyget_base_rev_argszMercurial.get_base_rev_args sdesturl rev_options verbosityNcr|}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_commandr to_args)selfrrrr rev_displayflagss r fetch_newzMercurial.fetch_new$s",,..  #         >>%1EE !^^EE !^^"EE,E g|OeOSO$OOOPPP   AE A;+>+>+@+@ A A A      rcJtj||jd}t j} |||dd|jt|d5}| |dddn #1swxYwYtdd| }| ||dS#ttjf$r'}t d||Yd}~dSd}~wwxYw) Nhgrcpathsdefaultwr#-qr$z/Could not switch Mercurial repository to %s: %s)ospathjoindirname configparserRawConfigParserreadsetsecretopenwriter r*r)OSErrorNoSectionErrorr'warning) r+rrr repo_configconfig config_filecmd_argsexcs rswitchzMercurial.switch<sagll4v>> -// 1 KK $ $ $ JJw 3: 6 6 6k3'' *; [))) * * * * * * * * * * * * * * * $HdK4G4G4I4IJJH   X4  0 0 0 0 0 45 X X X NNLcSV W W W W W W W W W Xs<AC%<B C%B""C%%B"&C%%D";DD"c|ddg|tdd|}|||dS)Npullr4r$r#)r)r r*)r+rrrrFs rr#zMercurial.updateJs[ &$T222$ 0C0C0E0EFF t,,,,,rlocationc|ddgdd|}||rt|}|S)N showconfigz paths.defaultFT show_stdout stdout_onlyr%)r)strip_is_local_repositoryr )clsrKrs rget_remote_urlzMercurial.get_remote_urlOsloo ? +   %''  # #C ( ( #c""Cyy{{rc`|ddgdd|}|S)zW Return the repository-local changeset revision number, as an integer. parentsz--template={rev}FTrNr)rQ)rSrKcurrent_revisions r get_revisionzMercurial.get_revision[sD ?? * + +  %''   rc`|ddgdd|}|S)zh Return the changeset identification hash, as a 40-character hexadecimal string rVz--template={node}FTrNrW)rSrKcurrent_rev_hashs rget_requirement_revisionz"Mercurial.get_requirement_revisionhsD ?? + , +  %''   rnamecdS)z&Always assume the versions don't matchFr)rSrr]s ris_commit_id_equalzMercurial.is_commit_id_equalvs 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. rootFTrN)r)rQr5r6isabsabspathr7r)rSrK repo_roots rget_subdirectoryzMercurial.get_subdirectory{sOO H%Tx$  %'' w}}Y'' K Xy(I(IJJI7)LLLrc^t|}|r|S |dg|dddd}n8#t$rtd|YdSt $rYdSwxYwtj | dS)NraFTraise)r%rOrP on_returncodelog_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez ) superget_repository_rootr)rr'debugrr5r6normpathrstrip)rSrKlocr __class__s rrkzMercurial.get_repository_rootsgg))(33  J ! %$  AA    LL.    44    44 w 0 0111sA%A:- A:9A:)__name__ __module__ __qualname__r]r8 repo_nameschemes staticmethodstrrrrr intr.rHr# classmethodrTrYr\rboolr_rerk __classcell__)rqs@rrrs: DGIG s tCy   \   ( 7A NQ     0 13 1Z 1j 1T 1 1 1 1-3-Z-j-T----  c c   [   C  C    [          [  c#4[ M M M M M[ M2328C=22222[22222rr)r9loggingr5typingrrrpip._internal.exceptionsrrpip._internal.utils.miscrr pip._internal.utils.subprocessr pip._internal.utils.urlsr pip._internal.vcs.versioncontrolr r rr getLoggerrrr'rregisterrrrrs2 ((((((((((BBBBBBBB========777777000000  8 $ $L2L2L2L2L2L2L2L2^  Yr