ó
˜†Rc           @€  s\   d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d d „ Z d S(   iÿÿÿÿ(   t   with_statementNc         C€  s  t  j d ƒ } | d k r< t j d | IJt j | ƒ n  | d	 k rÝ t j d d d g ƒ d } t t  j	 j
 t  j	 j t ƒ d d ƒ ƒ  } | j ƒ  } Wd	 QX| j d
 |  ƒ } t d d ƒ  } | j | ƒ Wd	 QXn  t  j d t  j	 j
 | d d ƒ ƒ t j d |  ƒ } t j t  j	 j
 t  j	 j t ƒ d ƒ t  j	 j
 | d ƒ ƒ x- |	 D]% } t j t  j	 j
 | d | ƒ ƒ qSWxg | | f D]Y } | r‰d d | d t  j	 j
 | d ƒ d g } t j | ƒ d k sât | ƒ ‚ q‰q‰W| rwt t  j	 j
 | d |
 | d ƒ d ƒ ; } | d IJ| d | IJ| d | IJ| d | IJWd	 QXt t  j	 j
 | d d ƒ d ƒ U } | d IJ| d | IJ| d | IJ| d | IJ| d  | j d! d" ƒ IJWd	 QXx« t  j t  j	 j
 | d# ƒ ƒ D]ˆ } t  j	 j
 | d# | ƒ } t | ƒ  } | j ƒ  } Wd	 QX| j d
 |  ƒ } | j d$ | ƒ } t | d ƒ  } | j | ƒ Wd	 QXqèWn  d% d& d' d( d) d* | j ƒ  d+ |  d, t  j	 j
 | d ƒ d- t  j	 j | ƒ g } i  } | rót j | d. <t j | d/ <n  t j | |  } | j ƒ  \ } } | j d k rc| r<t j | IJn  t j d0 | j IJt j | j ƒ n  t  j d1 ƒ t j | ƒ d	 S(2   sŠ   Create a bazsvn repository in the current directory (or use the
    specified repo), and bootstrap the database using a subversion import.s   ./clear-database.pyi    s   clear-database failed: %d!t   svnadmint   createt
   repositoryt   datas   svnserve.confNs   {{project}}s   repository/conf/svnserve.conft   ws   ../../precommit.pyt   hookss
   pre-commits   .%s.bazstartt
   initial_dbt   rsyncs   -at   /s   .yamls1   comment: Initial admin user, created by bazstart.s   username: %ss   password: %ss   name: %ss   initial_db/Object/Configs   UrlConfig.yamlsë  comment: |
  Configuration used when generating link URLs.  Note that if xhrprefix is
  different from prefix, it must be a subdomain of prefix and you must add
  
  {{{
  Header set Access-Control-Allow-Origin <prefix>
  Header set Access-Control-Allow-Credentials true
  }}}

  to ##webroot/.htaccess##.  xhrprefix (but not the others) may contain a
  *, which will be replaced by an arbitrary string to spread out different
  XHRs to different domains so more things can load in parallel.s
   prefix: %ss   imageprefix: %ss   xhrprefix: %ss   svnprefix: %ss   http://s   svn://s   initial_db/bin/s   {{bazkitype}}t   svnt   imports
   --usernamet   bazkis   -ms   Bootstrapping s    contents on project s
    creation.s   file://t   stdoutt   stderrs    SVN import failed with status %ds   clear-database.py(    t   ost   systemt   sysR   t   exitt   Nonet
   subprocesst
   check_callt   opent   patht   joint   dirnamet   __file__t   readt   replacet   writet   symlinkt   tempfilet   mkdtempt   shutilt   copytreet   rmtreet   callt   AssertionErrort   listdirt
   capitalizet   abspatht   PIPEt   Popent   communicatet
   returncodet   unlink(   t   projectt   packaget   quiett   usernamet   elmnamet   passwordt	   bazkitypet   extra_dbt	   custom_dbt	   remove_dbt
   admin_patht	   urlprefixt   repot   rest   filt   templt   conft   tempdt   rt   dbt   cmdt   admint	   urlconfigR   t   oldt   newt
   import_cmdt   kwt   processt   outt   err(    (    sI   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/bazstart/bootstrap.pyt	   bootstrap   sŽ    	#(

%

(	   t
   __future__R    R   R   R   R   R!   R   RL   (    (    (    sI   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/bazstart/bootstrap.pyt   <module>   s   <