ó
|‰ãWc           @   s¨   d  d l  Z  d  d l Z d  d l m Z e  j j j d ƒ Z e  j j e	 ƒ j
 d ƒ Z d  d l m Z d „  Z d „  Z d „  Z d	 d
 d „ Z d „  Z d „  Z d S(   iÿÿÿÿN(   t   svnwct   svns   repotest.dump(   t   print_c            s³   t  d  k r t j j d ƒ n  |  j d ƒ ‰ |  j d ‡ f d †  d d ƒ \ } } } xK d D]C } |  j j j	 | ƒ r_ t
 | | ƒ ‰  |  j ‡  f d
 †  ƒ q_ q_ W| | | f S(   Ns   svn binary not foundt   tmpdirt   setupc              s   t  ˆ  d d ƒ S(   Nt	   path1repot   path1wc(   t	   getrepowc(    (   R   (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyt   <lambda>   s    t   scopet   modulet   test_removet	   test_movet   test_status_deletedc              s
   t  ˆ  ƒ S(   N(   t   restore_repowc(    (   t   _savedrepowc(    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyR      s    (   R   R   R   (   t   svnbint   Nonet   pyt   testt   skipt   getfuncargvaluet   cached_setupt   functiont   __name__t
   startswitht   save_repowct   addfinalizer(   t   requestt   repot   repourlt   wct   x(    (   R   R   s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyt   pytest_funcarg__repowc1	   s    	c         C   sK   |  j  d ƒ } |  j j } t | d | d | ƒ \ } } } | | | f S(   NR   s	   %s-repo-2s   %s-wc-2(   R   R   R   R   (   R   R   t   nameR   t   urlR   (    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyt   pytest_funcarg__repowc2   s    #c           C   s#   t  d  k r t j j d ƒ n  t  S(   Ns   svn binary not found(   R   R   R   R   R   (    (    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyt	   getsvnbin   s    t   basetestrepoR   c         C   s  |  j  | ƒ } |  j  | ƒ } | j d d ƒ t j j d t j | ƒ ƒ t j j d t j | ƒ t f ƒ t d | ƒ | j d d ƒ t j	 j
 | ƒ } t j j j d k rÑ d t | ƒ j d	 d ƒ } n
 d
 | } | j | ƒ t d | ƒ | | | f S(   Nt   diri   s   svnadmin create "%s"s   svnadmin load -q "%s" <"%s"s   created svn repositoryt   win32s   file://t   /s   \s	   file://%ss   checked out new repo intos   file:///(   t   mkdirt   ensureR   t   processt   cmdexect	   svncommont   _escape_helpert   repodumpR   t   pathR    t   stdt   syst   platformt   strt   replacet   checkout(   R   t   reponamet   wcnameR   t   wcdirR   R   (    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyR   '   s     
c         C   sŠ   t  |  ƒ j d ƒ s" t |  ƒ ‚ |  j ƒ  s4 t ‚ |  j |  j d ƒ } | j | j d ƒ } |  j | ƒ | j j | j ƒ | | f S(   Ns   file://s   .1(   R5   R   t   AssertionErrort   checkt   dirpatht   basenamet   copyt	   localpath(   R   R   t	   savedrepot   savedwc(    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyR   ;   s    "c         C   sÃ   |  \ } } | j  d | j d  ƒ } | j ƒ  s7 t ‚ | j  d | j d  ƒ } | j ƒ  sb t ‚ | j j ƒ  | j ƒ  | j | ƒ | j j | j ƒ t j j	 j
 j ƒ  t j j	 j j ƒ  d  S(   NR>   işÿÿÿ(   t   newR>   R<   R;   R@   t   removet   moveR   R1   t   svnurlt   _lsnorevcachet   cleart   _lsrevcache(   t   objRA   RB   R   R   (    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyR   D   s    
(   R   R3   t   py._pathR    R.   R1   t   localt   sysfindR   t   __file__R=   R0   t
   py.builtinR   R!   R$   R%   R   R   R   (    (    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyt   <module>   s   					