Your IP : 18.224.44.207
�
�Re� � @ s� d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z m Z d d l m Z d d l
m Z m Z d d l
m Z d d l m Z Gd d � d e � Z e j e � d S)
� N)�call_subprocess)�display_path�rmtree)�logger)�vcs�VersionControl)�path_to_url)�ConfigParserc @ s� e Z d Z d Z d Z d Z d! Z d Z d Z d
d � Z d d
� Z
d d � Z d d � Z d d � Z
d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d S)"� Mercurial�hgz.hg�clone�hg+http�hg+https�hg+ssh�hg+static-httpzhg-clone.txtzg# This was a Mercurial repo; to make it a repo again run:
hg init
hg pull %(url)s
hg update -r %(rev)s
c C s� d } } x� | j � D]� } | j � s | j � j d � rE q n t j d | � } | ru | j d � j � } n t j d | � } | r� | j d � j � } n | r | r | | f Sq Wd S)N�#zhg\s*pull\s*(.*)\s*� z^hg\s*update\s*-r\s*(.*)\s*)NN)�
splitlines�strip�
startswith�re�search�group)�self�content�url�rev�line� url_match� rev_match� r �,/tmp/pip-ztkk0jow-build/pip/vcs/mercurial.py�parse_vcs_bundle_file s
"zMercurial.parse_vcs_bundle_filec C s` t j d d � } | j | � z/ t | j d | g d | j d d d | �Wd t | � Xd S) z?Export the Hg repository at the url to the destination locationz-exportzpip-�archive�
filter_stdout�show_stdoutF�cwdN)�tempfile�mkdtemp�unpackr �cmd�_filterr )r �location�temp_dirr r r! �export% s
zMercurial.exportc C s� t j j | | j d � } t j � } yJ | j | � | j d d | � t | d � } | j | � | j
� WnB t t j f k
r� t
j � d } t j d | | f � Yn! Xt | j d d g | d | �d S)
N�hgrc�paths�default�wr z/Could not switch Mercurial repository to %s: %s�updatez-qr&