ó
—¨ídc           @@  s  d  d l  m 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 d  d l m Z d  d l m Z m Z e rÙ d  d	 l m Z m Z d  d
 l m Z d  d l m Z m Z n  e j e ƒ Z d e f d „  ƒ  YZ e j e ƒ d S(   i    (   t   absolute_importN(   t   parse(   t   display_patht   rmtree(   t   make_command(   t   MYPY_CHECK_RUNNING(   t   path_to_url(   t   VersionControlt   vcs(   t   Optionalt   Tuple(   t
   HiddenText(   t   AuthInfot
   RevOptionst   Bazaarc           B@  s˜   e  Z d  Z d Z d Z d Z d	 „  Z e d
 „  ƒ Z d „  Z	 d „  Z
 d „  Z d „  Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z RS(   t   bzrs   .bzrt   branchs   bzr+https	   bzr+httpss   bzr+sshs   bzr+sftps   bzr+ftps   bzr+lpc         O@  sE   t  t |  ƒ j | | Ž  t t d d  ƒ rA t j j d g ƒ n  d  S(   Nt   uses_fragmentt   lp(   t   superR   t   __init__t   getattrt   urllib_parset   NoneR   t   extend(   t   selft   argst   kwargs(    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyR   $   s    c         C@  s
   d |  g S(   Ns   -r(    (   t   rev(    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyt   get_base_rev_args+   s    c         C@  s`   t  j j | ƒ r t | ƒ n  |  j | ƒ \ } } |  j t d | | | j ƒ  ƒ d t ƒd S(   sU   
        Export the Bazaar repository at the url to the destination location
        t   exportt   show_stdoutN(	   t   ost   patht   existsR   t   get_url_rev_optionst   run_commandR   t   to_argst   False(   R   t   locationt   urlt   rev_options(    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyR   /   s    c         C@  sW   | j  ƒ  } t j d | | t | ƒ ƒ t d d | j ƒ  | | ƒ } |  j | ƒ d  S(   Ns   Checking out %s%s to %sR   s   -q(   t
   to_displayt   loggert   infoR   R   R%   R$   (   R   t   destR(   R)   t   rev_displayt   cmd_args(    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyt	   fetch_new>   s    c         C@  s    |  j  t d | ƒ d | ƒd  S(   Nt   switcht   cwd(   R$   R   (   R   R-   R(   R)   (    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyR1   L   s    c         C@  s/   t  d d | j ƒ  ƒ } |  j | d | ƒd  S(   Nt   pulls   -qR2   (   R   R%   R$   (   R   R-   R(   R)   R/   (    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyt   updateP   s    c         C@  sJ   t  t |  ƒ j | ƒ \ } } } | j d ƒ r= d | } n  | | | f S(   Ns   ssh://s   bzr+(   R   R   t   get_url_rev_and_autht
   startswith(   t   clsR(   R   t	   user_pass(    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyR5   U   s    !c         C@  s›   |  j  d g d t d t d | ƒ} xp | j ƒ  D]b } | j ƒ  } xM d D]E } | j | ƒ rJ | j | ƒ d } |  j | ƒ r‹ t | ƒ S| SqJ Wq1 Wd  S(	   NR,   R   t   stdout_onlyR2   s   checkout of branch: s   parent branch: i   (   s   checkout of branch: s   parent branch: (
   R$   R&   t   Truet
   splitlinest   stripR6   t   splitt   _is_local_repositoryR   R   (   R7   R'   t   urlst   linet   xt   repo(    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyt   get_remote_url^   s    

c         C@  s2   |  j  d g d t d t d | ƒ} | j ƒ  d S(   Nt   revnoR   R9   R2   iÿÿÿÿ(   R$   R&   R:   R;   (   R7   R'   t   revision(    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyt   get_revisionn   s    c         C@  s   t  S(   s&   Always assume the versions don't match(   R&   (   R7   R-   t   name(    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyt   is_commit_id_equalu   s    (   R   s   bzr+https	   bzr+httpss   bzr+sshs   bzr+sftps   bzr+ftps   bzr+lp(   t   __name__t
   __module__RG   t   dirnamet	   repo_namet   schemesR   t   staticmethodR   R   R0   R1   R4   t   classmethodR5   RC   RF   RH   (    (    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyR      s    						(   t
   __future__R    t   loggingR    t   pip._vendor.six.moves.urllibR   R   t   pip._internal.utils.miscR   R   t   pip._internal.utils.subprocessR   t   pip._internal.utils.typingR   t   pip._internal.utils.urlsR   t    pip._internal.vcs.versioncontrolR   R   t   typingR	   R
   R   R   R   t	   getLoggerRI   R+   R   t   register(    (    (    si   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/pip/_internal/vcs/bazaar.pyt   <module>   s   `