3 ”Re/ã@sÄddlmZddlZddlZddlmZddlmZm Z ddl m Z ddl m Z ddlmZddlmZmZe rœdd lmZmZdd lmZdd lmZmZejeƒZGd d „d eƒZejeƒdS)é)Úabsolute_importN)Úparse)Ú display_pathÚrmtree)Ú make_command)ÚMYPY_CHECK_RUNNING)Ú path_to_url)ÚVersionControlÚvcs)ÚOptionalÚTuple)Ú HiddenText)ÚAuthInfoÚ RevOptionscsŒeZdZdZdZdZdZ‡fd d „Zed d „ƒZ dd„Z dd„Z dd„Z dd„Z e‡fdd„ƒZedd„ƒZedd„ƒZedd„ƒZ‡ZS)ÚBazaarÚbzrz.bzrÚbranchúbzr+httpú bzr+httpsúbzr+sshúbzr+sftpúbzr+ftpúbzr+lpcs0tt|ƒj||Žttddƒr,tjjdgƒdS)NÚ uses_fragmentÚlp)ÚsuperrÚ__init__ÚgetattrÚ urllib_parserÚextend)ÚselfÚargsÚkwargs)Ú __class__©ú‡/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/vcs/bazaar.pyr#s zBazaar.__init__cCsd|gS)Nz-rr$)Úrevr$r$r%Úget_base_rev_args*szBazaar.get_base_rev_argscCs>tjj|ƒrt|ƒ|j|ƒ\}}|jtd|||jƒƒƒdS)zU Export the Bazaar repository at the url to the destination location ÚexportN)ÚosÚpathÚexistsrÚget_url_rev_optionsÚ run_commandrÚto_args)r ÚlocationÚurlÚ rev_optionsr$r$r%r(.s  z Bazaar.exportcCs>|jƒ}tjd||t|ƒƒtdd|jƒ||ƒ}|j|ƒdS)NzChecking out %s%s to %srz-q)Ú to_displayÚloggerÚinforrr.r-)r Údestr0r1Ú rev_displayÚcmd_argsr$r$r%Ú fetch_new<s zBazaar.fetch_newcCs|jtd|ƒ|d�dS)NÚswitch)Úcwd)r-r)r r5r0r1r$r$r%r9Jsz Bazaar.switchcCs"tdd|jƒƒ}|j||d�dS)NÚpullz-q)r:)rr.r-)r r5r0r1r7r$r$r%ÚupdateNsz Bazaar.updatecs2tt|ƒj|ƒ\}}}|jdƒr(d|}|||fS)Nzssh://zbzr+)rrÚget_url_rev_and_authÚ startswith)Úclsr0r&Ú user_pass)r#r$r%r=Ss zBazaar.get_url_rev_and_authcCsj|jdg|d�}xT|jƒD]H}|jƒ}x:dD]2}|j|ƒr,|j|ƒd}|j|ƒrZt|ƒS|Sq,WqWdS)Nr4)r:úcheckout of branch: úparent branch: é)rArB)r-Ú splitlinesÚstripr>ÚsplitÚ_is_local_repositoryr)r?r/ÚurlsÚlineÚxÚrepor$r$r%Úget_remote_url\s   zBazaar.get_remote_urlcCs|jdg|d�}|jƒdS)NÚrevno)r:rCéÿÿÿÿ)r-rD)r?r/Úrevisionr$r$r%Ú get_revisionjs zBazaar.get_revisioncCsdS)z&Always assume the versions don't matchFr$)r?r5Únamer$r$r%Úis_commit_id_equalqszBazaar.is_commit_id_equal)rrrrrrr)Ú__name__Ú __module__Ú __qualname__rQÚdirnameÚ repo_nameÚschemesrÚ staticmethodr'r(r8r9r<Ú classmethodr=rLrPrRÚ __classcell__r$r$)r#r%rs    r)Ú __future__rÚloggingr)Zpip._vendor.six.moves.urllibrrÚpip._internal.utils.miscrrÚpip._internal.utils.subprocessrÚpip._internal.utils.typingrÚpip._internal.utils.urlsrÚ pip._internal.vcs.versioncontrolr r Útypingr r r rrÚ getLoggerrSr3rÚregisterr$r$r$r%Ús       ]