*Y3ddlZddlZddlZddlmZmZddlmZmZddl m Z m Z ddl m Z ddlmZddlmZmZmZmZejeZGdd eZejedS) N)ListOptional) BadCommandInstallationError) HiddenText display_path) make_command) path_to_url) RevOptionsVersionControl(find_path_to_project_root_from_repo_rootvcsceZdZdZdZdZdZedede efdZ ded e d e dd fd Z ded e d e dd fd Zded e d e dd fdZededefdZededefdZededefdZededeedefdZededeefdZededeeffd ZxZS) Mercurialhgz.hgclone)zhg+filezhg+httpzhg+httpszhg+sshzhg+static-httprevreturnc|gS)N)rs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/vcs/mercurial.pyget_base_rev_argszMercurial.get_base_rev_args s u desturl rev_optionsNc >|}td||t||t ddd|||t dd||dS)NzCloning hg %s%s to %srz --noupdate-qupdatecwd) to_displayloggerinfor run_commandr to_args)selfrrr rev_displays r fetch_newzMercurial.fetch_new$s!,,..  #         g|T3MMNNN  4)<)<)>)> ? ?      rcJtj||jd}t j} |||dd|jt|d5}| |dddn #1swxYwYtdd| }| ||dS#ttjf$r'}t d||Yd}~dSd}~wwxYw) Nhgrcpathsdefaultwrrr z/Could not switch Mercurial repository to %s: %s)ospathjoindirname configparserRawConfigParserreadsetsecretopenwriter r&r%OSErrorNoSectionErrorr#warning) r'rrr repo_configconfig config_filecmd_argsexcs rswitchzMercurial.switch2sagll4v>> -// 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)Npullrr r)r%r r&)r'rrrr@s rrzMercurial.update@s[ &$T222$ 0C0C0E0EFF t,,,,,rlocationc|ddgdd|}||rt|}|S)N showconfigz paths.defaultFT show_stdout stdout_onlyr!)r%strip_is_local_repositoryr )clsrErs rget_remote_urlzMercurial.get_remote_urlEsloo ? +   %''  # #C ( ( #c""Cyy{{rc`|ddgdd|}|S)zW Return the repository-local changeset revision number, as an integer. parentsz--template={rev}FTrHr%rK)rMrEcurrent_revisions r get_revisionzMercurial.get_revisionQsD ?? * + +  %''   rc`|ddgdd|}|S)zh Return the changeset identification hash, as a 40-character hexadecimal string rPz--template={node}FTrHrQ)rMrEcurrent_rev_hashs rget_requirement_revisionz"Mercurial.get_requirement_revision^sD ?? + , +  %''   rnamecdS)z&Always assume the versions don't matchFr)rMrrWs ris_commit_id_equalzMercurial.is_commit_id_equalls 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. rootFTrH)r%rKr/r0isabsabspathr1r )rMrE repo_roots rget_subdirectoryzMercurial.get_subdirectoryqsOO H%Tx$  %'' w}}Y'' K Xy(I(IJJI7)LLLrc^t|}|r|S |dg|dddd}n8#t$rtd|YdSt $rYdSwxYwtj | dS)Nr[FTraise)r!rIrJ on_returncodelog_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez ) superget_repository_rootr%rr#debugrr/r0normpathrstrip)rMrElocr __class__s rrezMercurial.get_repository_rootsgg))(33  J ! %$  AA    LL.    44    44 w 0 0111sA%A:- A:9A:)__name__ __module__ __qualname__rWr2 repo_nameschemes staticmethodstrrrrr r)rBr classmethodrNrSrVrboolrYr_re __classcell__)rks@rrrs/ DGIGstCy\  c     PT      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)r3loggingr/typingrrpip._internal.exceptionsrrpip._internal.utils.miscrrpip._internal.utils.subprocessr pip._internal.utils.urlsr pip._internal.vcs.versioncontrolr r r r getLoggerrlr#rregisterrrrrs, !!!!!!!!BBBBBBBB========777777000000  8 $ $B2B2B2B2B2B2B2B2J  Yr