ž 7’ReOc@s­ddlZddlZddlZddlmZddlmZddlmZm Z m Z ddl m Z m Z ddlmZGdd„de ƒZe jeƒdS( iN(uurlparse(ulogger(urmtreeu display_pathucall_subprocess(uvcsuVersionControl(u path_to_urlcsË|EeZdZdZdZdZdZd"Zd Zd#‡fd d †Z dd„Z dd„Z dd„Z dd„Zdd„Z‡fdd†Zdd„Zdd„Zdd„Zd d!„Z‡S($uBazaarubzru.bzrubranchubzr-branch.txtubzr+httpu bzr+httpsubzr+sshubzr+sftpubzr+ftpubzr+lpu[# This was a Bazaar branch; to make it a branch again run: bzr branch -r %(rev)s %(url)s . cs[tt|ƒj|||ŽttddƒrWtjjdgƒtjjdgƒndS(Nu uses_fragmentulp( usuperuBazaaru__init__ugetattruurlparseuNoneu uses_fragmentuextendunon_hierarchical(uselfuurluargsukwargs(u __class__(u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyu__init__suBazaar.__init__cCs¿d}}x®|jƒD] }|jƒ s|jƒjdƒrEqntjd|ƒ}|ru|jdƒjƒ}n||jƒd…jƒjddƒd}|r|r||fSqWdS(Nu#u^bzr\s*branch\s*-r\s*(\d*)ii(NN( uNoneu splitlinesustripu startswithureusearchugroupuendusplit(uselfucontentuurlurevulineumatch((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyuparse_vcs_bundle_files ", uBazaar.parse_vcs_bundle_filecCstjddƒ}|j|ƒtjj|ƒr>t|ƒnz/t|jd|gd|d|j ddƒWdt|ƒXdS( uCExport the Bazaar repository at the url to the destination locationu-exportupip-uexportucwdu filter_stdoutu show_stdoutNF( utempfileumkdtempuunpackuosupathuexistsurmtreeucall_subprocessucmdu_filteruFalse(uselfulocationutemp_dir((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyuexport)s  u Bazaar.exportcCs t|jd|gd|ƒdS(Nuswitchucwd(ucall_subprocessucmd(uselfudestuurlu rev_options((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyuswitch6su Bazaar.switchcCs$t|jddg|d|ƒdS(Nupullu-qucwd(ucall_subprocessucmd(uselfudestu rev_options((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyuupdate9su Bazaar.updatecCs |jƒ\}}|r1d|g}d|}n g}d}|j||||ƒrœtjd||t|ƒfƒt|jddg|||gƒndS(Nu-ru (to revision %s)uuChecking out %s%s to %subranchu-q(u get_url_revucheck_destinationuloggerunotifyu display_pathucall_subprocessucmd(uselfudestuurlurevu rev_optionsu rev_display((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyuobtain=s   u Bazaar.obtaincsAtt|ƒjƒ\}}|jdƒr7d|}n||fS(Nussh://ubzr+(usuperuBazaaru get_url_revu startswith(uselfuurlurev(u __class__(u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyu get_url_revKs uBazaar.get_url_revcCs˜t|jdgddd|ƒ}xp|jƒD]b}|jƒ}xMdD]E}|j|ƒrG|j|ƒd}|j|ƒrˆt|ƒS|SqGWq.WdS( Nuinfou show_stdoutucwducheckout of branch: uparent branch: iF(ucheckout of branch: uparent branch: ( ucall_subprocessucmduFalseu splitlinesustripu startswithusplitu_is_local_repositoryu path_to_urluNone(uselfulocationuurlsulineuxurepo((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyuget_urlRs    uBazaar.get_urlcCs/t|jdgddd|ƒ}|jƒdS(Nurevnou show_stdoutucwdiFiÿÿÿÿ(ucall_subprocessucmduFalseu splitlines(uselfulocationurevision((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyu get_revision`suBazaar.get_revisioncCs t|jdgddd|ƒ}g}xl|jƒD]^}tjd|ƒ}|r4|jdƒ}|jdƒ}|j|jƒ|jƒfƒq4q4Wt |ƒS(Nutagsu show_stdoutucwdu([.\w-]+)\s*(.*)$iiF( ucall_subprocessucmduFalseu splitlinesureusearchugroupuappendustripudict(uselfulocationutagsutag_revsulineu tags_matchutagurev((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyu get_tag_revses&uBazaar.get_tag_revsc Cs¿|j|ƒ}|jƒjdƒs1d|}n|jƒjddƒd}|sWdS|j|ƒ}|j|ƒ}||kr˜d|||f}nd|jƒ|f}d|||fS( Nubzr:ubzr+u-iiu%s-%su %s-dev_r%su %s@%s#egg=%s(uget_urluloweru startswithuegg_nameusplituNoneu get_revisionu get_tag_revs( uselfudistulocationu find_tagsurepouegg_project_nameu current_revutag_revsu full_egg_name((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyuget_src_requirementqs  uBazaar.get_src_requirement(ubzrubzr+httpu bzr+httpsubzr+sshubzr+sftpubzr+ftpubzr+lpN(u__name__u __module__u __qualname__unameudirnameu repo_nameu bundle_fileuschemesuguideuNoneu__init__uparse_vcs_bundle_fileuexportuswitchuupdateuobtainu get_url_revuget_urlu get_revisionu get_tag_revsuget_src_requirement(u __locals__((u __class__u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyuBazaar s"      uBazaar(uosutempfileureupip.backwardcompatuurlparseupip.loguloggerupip.utilurmtreeu display_pathucall_subprocessupip.vcsuvcsuVersionControlu pip.downloadu path_to_urluBazaaruregister(((u'/tmp/pip-zej_zi-build/pip/vcs/bazaar.pyus   x