ó
z*âW
  c           @   sÏ   d  d l  Z d  d l j j Z d  d l Z d  d l Z d  d l m	 Z
 d  d l m Z e j j j d ƒ Z e j j e ƒ j d ƒ Z e j d „  ƒ Z e j d „  ƒ Z d d	 d
 „ Z d „  Z d „  Z d S(   iÿÿÿÿN(   t   svnwc(   t   print_t   svns   repotest.dumpc            sÉ   t  d  k r t j j d ƒ n  |  j d ƒ ‰ |  j d ‡ f d †  d d ƒ \ } } } xa d D]Y } |  j j j	 | ƒ r_ t
 d
 | d |  j ƒ 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_deleteds   saving repot   forc              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
   startswithR   t   save_repowct   addfinalizer(   t   requestt   repot   repourlt   wct   x(    (   R   R   s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyt   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   repowc2   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 |  ƒ d i t j | ƒ d 6d t j ƒ  k sx t j t  ƒ r‡ t j t  ƒ n d d 6d t j ƒ  k s¯ t j |  ƒ r¾ t j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d	 6t j | ƒ d
 6} t t j	 | ƒ ƒ ‚ n  d  } } } } } |  j } | ƒ  }	 |	 s¼d d i d t j ƒ  k sjt j |  ƒ ryt j |  ƒ n d d 6t j | ƒ d 6t j |	 ƒ d 6}
 t t j	 |
 ƒ ƒ ‚ n  d  } }	 |  j |  j d ƒ } | j | j d ƒ } |  j | ƒ | j j | j ƒ | | f S(   Ns   file://sp   
>assert not %(py9)s
{%(py9)s = %(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}.startswith
}(%(py7)s)
}t   py9R5   t   py0R   t   py1t   py3t   py5t   py7t    s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}t   py2t   py4s   .1(   R5   R   t
   @pytest_art   _format_assertmsgt	   _safereprt   @py_builtinst   localst   _should_repr_global_namet   AssertionErrort   _format_explanationR   t   checkt   dirpatht   basenamet   copyt	   localpath(   R   R    t   @py_assert2t   @py_assert4t   @py_assert6t   @py_assert8t   @py_assert10t   @py_format11t   @py_assert1t   @py_assert3t   @py_format5t	   savedrepot   savedwc(    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyR   =   s(     	     Å  	 	  e  
c         C   sè  |  \ } } d | f GH| j  d | j d  ƒ } | j } | ƒ  } | sÅ d d i d t j ƒ  k ss t j | ƒ r‚ t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d	 6} t t j	 | ƒ ƒ ‚ n  d  } } | j  d | j d  ƒ } | j } | ƒ  } | s}d d i d
 t j ƒ  k s+t j | ƒ r:t j | ƒ n d
 d 6t j | ƒ d 6t j | ƒ d	 6} t t j	 | ƒ ƒ ‚ n  d  } } | j j ƒ  | j ƒ  | j | ƒ | j j | j ƒ t j j j j ƒ  t j j j j ƒ  d  S(   Nt	   restoringRN   iþÿÿÿRA   s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}R   R<   RB   RC   R    (   t   newRN   RL   RG   RH   RD   RI   RF   RJ   RK   R   RP   t   removet   moveR   R1   t   svnurlt   _lsnorevcachet   cleart   _lsrevcache(   t   objRZ   R[   R   RW   RX   RY   R    (    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyR   G   s,    	 	  e  
	 	  e  

(   t   __builtin__RG   t   _pytest.assertion.rewritet	   assertiont   rewriteRD   R   t   pytestt   py._pathR    R.   t
   py.builtinR   R1   t   localt   sysfindR   t   __file__RM   R0   t   fixtureR"   R%   R   R   R   (    (    (    s;   /home/ronny/Projects/pytest-dev/py/testing/path/conftest.pyt   <module>   s     	
