Your IP : 3.142.172.250


Current Path : /opt/alt/python34/lib/python3.4/site-packages/pip/vcs/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib/python3.4/site-packages/pip/vcs/__pycache__/bazaar.cpython-34.pyc

�
�ReO�@s�ddlZddlZddlZddlmZddlmZddlmZm	Z	m
Z
ddlmZm
Z
ddlmZGdd�de
�Zeje�dS)	�N)�urlparse)�logger)�rmtree�display_path�call_subprocess)�vcs�VersionControl)�path_to_urlcs�eZdZdZdZdZdZd#ZdZd�fd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Z�fdd�Zdd�Zdd�Zdd �Zd!d"�Z�S)$�Bazaar�bzrz.bzr�branchzbzr-branch.txt�bzr+http�	bzr+https�bzr+ssh�bzr+sftp�bzr+ftp�bzr+lpz[# This was a Bazaar branch; to make it a branch again run:
bzr branch -r %(rev)s %(url)s .
Ncs[tt|�j|||�ttdd�rWtjjdg�tjjdg�ndS)N�
uses_fragment�lp)�superr
�__init__�getattrrr�extend�non_hierarchical)�self�url�args�kwargs)�	__class__��)/tmp/pip-ztkk0jow-build/pip/vcs/bazaar.pyrszBazaar.__init__cCs�d}}x�|j�D]�}|j�s|j�jd�rEqntjd|�}|ru|jd�j�}n||j�d�j�jdd�d}|r|r||fSqWdS)N�#z^bzr\s*branch\s*-r\s*(\d*)�r)NN)�
splitlines�strip�
startswith�re�search�group�end�split)r�contentr�rev�line�matchrrr �parse_vcs_bundle_files
",zBazaar.parse_vcs_bundle_filecCstjdd�}|j|�tjj|�r>t|�nz/t|jd|gd|d|j	dd�Wdt|�XdS)	zCExport the Bazaar repository at the url to the destination locationz-exportzpip-�export�cwd�
filter_stdout�show_stdoutFN)
�tempfile�mkdtemp�unpack�os�path�existsrr�cmd�_filter)r�location�temp_dirrrr r0)s

z
Bazaar.exportcCs t|jd|gd|�dS)N�switchr1)rr:)r�destr�rev_optionsrrr r>6sz
Bazaar.switchcCs$t|jddg|d|�dS)N�pullz-qr1)rr:)rr?r@rrr �update9sz
Bazaar.updatecCs�|j�\}}|r1d|g}d|}ng}d}|j||||�r�tjd||t|�f�t|jddg|||g�ndS)Nz-rz (to revision %s)�zChecking out %s%s to %srz-q)�get_url_rev�check_destinationr�notifyrrr:)rr?rr,r@�rev_displayrrr �obtain=s
	z
Bazaar.obtaincsAtt|�j�\}}|jd�r7d|}n||fS)Nzssh://zbzr+)rr
rDr%)rrr,)rrr rDKs
zBazaar.get_url_revcCs�t|jdgddd|�}xp|j�D]b}|j�}xMdD]E}|j|�rG|j|�d}|j|�r�t|�S|SqGWq.WdS)	N�infor3Fr1�checkout of branch: �parent branch: r")rJrK)rr:r#r$r%r*�_is_local_repositoryr	)rr<�urlsr-�x�reporrr �get_urlRs

zBazaar.get_urlcCs/t|jdgddd|�}|j�dS)N�revnor3Fr1r"���)rr:r#)rr<�revisionrrr �get_revision`szBazaar.get_revisioncCs�t|jdgddd|�}g}xl|j�D]^}tjd|�}|r4|jd�}|jd�}|j|j�|j�f�q4q4Wt|�S)N�tagsr3Fr1z([.\w-]+)\s*(.*)$r"�)	rr:r#r&r'r(�appendr$�dict)rr<rU�tag_revsr-�
tags_match�tagr,rrr �get_tag_revses&zBazaar.get_tag_revsc	Cs�|j|�}|j�jd�s1d|}n|j�jdd�d}|sWdS|j|�}|j|�}||kr�d|||f}nd|j�|f}d|||fS)	Nzbzr:zbzr+�-r"rz%s-%sz
%s-dev_r%sz%s@%s#egg=%s)rP�lowerr%�egg_namer*rTr\)	r�distr<�	find_tagsrO�egg_project_name�current_revrY�
full_egg_namerrr �get_src_requirementqs
zBazaar.get_src_requirement)zbzrr
rrrrr)�__name__�
__module__�__qualname__�name�dirname�	repo_name�bundle_file�schemes�guiderr/r0r>rBrHrDrPrTr\rerr)rr r
s"

r
)r7r4r&Zpip.backwardcompatr�pip.logr�pip.utilrrr�pip.vcsrr�pip.downloadr	r
�registerrrrr �<module>sx

?>