1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
U
H=®d*ã@sÌddlmZddlZddlZddlmZddlmZmZddl    m
Z
ddl m Z ddl mZddlmZdd    lmZdd
lmZmZmZer¤dd l    mZdd lmZe e¡ZGd d„deƒZe e¡dS)é)Úabsolute_importN)Ú configparser)Ú
BadCommandÚSubProcessError)Ú display_path)Ú make_command)Ú TempDirectory)ÚMYPY_CHECK_RUNNING)Ú path_to_url)ÚVersionControlÚ!find_path_to_setup_from_repo_rootÚvcs)Ú
HiddenText)Ú
RevOptionscs˜eZdZdZdZdZdZedd„ƒZdd„Z    d    d
„Z
d d „Z d d„Z e dd„ƒZe dd„ƒZe dd„ƒZe dd„ƒZe dd„ƒZe ‡fdd„ƒZ‡ZS)Ú    MercurialÚhgz.hgÚclone)rzhg+filezhg+httpzhg+httpszhg+sshzhg+static-httpcCs|gS)N©)ÚrevrrúRD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/vcs/mercurial.pyÚget_base_rev_args'szMercurial.get_base_rev_argsc    Cs>tdd*}|j|j|d|jd|g|jdW5QRXdS)z?Export the Hg repository at the url to the destination locationÚexport)Úkind)ÚurlÚarchive©ÚcwdN)rÚunpackÚpathÚ run_command)ÚselfÚlocationrÚtemp_dirrrrr+s  ÿzMercurial.exportcCsP| ¡}t d||t|ƒ¡| tddd||ƒ¡|jtdd| ¡ƒ|ddS)NzCloning hg %s%s to %srz
--noupdateú-qÚupdater)Ú
to_displayÚloggerÚinforrrÚto_args)r ÚdestrÚ rev_optionsÚ rev_displayrrrÚ    fetch_new5süþzMercurial.fetch_newc    
Cs²tj ||jd¡}t ¡}z>| |¡| dd|j¡t    |dƒ}| 
|¡W5QRXWn6t tj fk
rŽ}zt  d||¡W5d}~XYn Xtdd| ¡ƒ}|j||ddS)    NÚhgrcÚpathsÚdefaultÚwz/Could not switch Mercurial repository to %s: %sr$r#r)ÚosrÚjoinÚdirnamerÚRawConfigParserÚreadÚsetÚsecretÚopenÚwriteÚOSErrorÚNoSectionErrorr&Úwarningrr(r)    r r)rr*Ú repo_configÚconfigÚ config_fileÚexcÚcmd_argsrrrÚswitchDs
 ÿzMercurial.switchcCs4|jddg|dtdd| ¡ƒ}|j||ddS)NÚpullr#rr$)rrr()r r)rr*rArrrr$UszMercurial.updatecCs0|jddg|d ¡}| |¡r(t|ƒ}| ¡S)NÚ
showconfigz paths.defaultr)rÚstripÚ_is_local_repositoryr
)Úclsr!rrrrÚget_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©rrE)rGr!Úcurrent_revisionrrrÚ get_revisionds
ÿ
zMercurial.get_revisioncCs|jddg|d ¡}|S)zh
        Return the changeset identification hash, as a 40-character
        hexadecimal string
        rIz--template={node}rrJ)rGr!Úcurrent_rev_hashrrrÚget_requirement_revisionms
þ
z"Mercurial.get_requirement_revisioncCsdS)z&Always assume the versions don't matchFr)rGr)ÚnamerrrÚis_commit_id_equalxszMercurial.is_commit_id_equalcCs@|jdg|d ¡}tj |¡s6tj tj ||¡¡}t||ƒS)z~
        Return the path to setup.py, relative to the repo root.
        Return None if setup.py is in the repo root.
        Úrootr)rrEr1rÚisabsÚabspathr2r )rGr!Ú    repo_rootrrrÚget_subdirectory}sÿ
 zMercurial.get_subdirectorycsxtt|ƒ |¡}|r|Sz|jdg|dd}Wn6tk
rPt d|¡YdStk
rdYdSXtj     
|  d¡¡S)NrQF)rÚlog_failed_cmdzIcould not determine if %s is under hg control because hg is not availablez
) ÚsuperrÚget_repository_rootrrr&Údebugrr1rÚnormpathÚrstrip)rGr!ÚlocÚr©Ú    __class__rrrXŠs"ý
ÿzMercurial.get_repository_root)Ú__name__Ú
__module__Ú __qualname__rOr3Ú    repo_nameÚschemesÚ staticmethodrrr,rBr$Ú classmethodrHrLrNrPrUrXÚ __classcell__rrr^rrs,
 
 
 
 
 
 
 
r)Ú
__future__rÚloggingr1Úpip._vendor.six.movesrÚpip._internal.exceptionsrrÚpip._internal.utils.miscrÚpip._internal.utils.subprocessrÚpip._internal.utils.temp_dirrÚpip._internal.utils.typingr    Úpip._internal.utils.urlsr
Ú pip._internal.vcs.versioncontrolr r r rrÚ    getLoggerr`r&rÚregisterrrrrÚ<module>s