???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
Afc           @   s…  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d d „ Z d „  Z d „  Z i d e
 f d 6d e
 f d 6d e f d 6d e f d 6d e f d 6d e f d 6d e f d 6d e f d 6d e f d 6d e f d 6d e f d 6Z e d k re	 ƒ  n  d S(    s$   Remote RCS -- command line interfaceiÿÿÿÿN(   t   openrcsclientc    
      C   sn  t  j t  _ y t j t  j d d ƒ \ }  } | s= d } n | d | d } } t j | ƒ sp t j d ‚ n  t | \ } } t j | | ƒ \ } } WnZ t j k
 rõ } | GHd GHd GHd GHd	 GHd
 GHd GHd GHd GHd GHd GHt  j d ƒ n Xt	 |  ƒ } | s| j
 ƒ  } n  xP | D]H }	 y | | | |	 ƒ Wqt t j f k
 re} d |	 | f GHqXqWd  S(   Ni   s	   h:p:d:qvLt   headi    s   unknown commands2   usage: rrcs [options] command [options] [file] ...s   where command can be:s+         ci|put      # checkin the given filess         co|get      # checkouts%         info        # print header infos1         head        # print revision of head branchs*         list        # list filename if valids"         log         # print full logs/         diff        # diff rcs file and work files7   if no files are given, all remote rcs files are assumedi   s   %s: %s(   t   syst   stderrt   stdoutt   getoptt   argvt   commandst   has_keyt   errort   exitR    t	   listfilest   IOErrort   os(
   t   optst   restt   cmdt   coptsett   funct   coptst   filest   msgt   xt   fn(    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyt   main   s>    	c         C   s›   t  | ƒ } | j ƒ  } | j ƒ  |  j | ƒ } | r[ t |  | | | ƒ r[ d | GHd  Sd G| Gd GHt | ƒ } |  j | | | ƒ } | r— | GHn  d  S(   Ns    %s: unchanged since last checkins   Checking ins   ...(   t   opent   readt   closet   isvalidt   samet   asklogmessaget   put(   R   R   R   t   ft   datat   newt   messaget   messages(    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyt   checkin/   s    
	c         C   s9   |  j  | ƒ } t | d ƒ } | j | ƒ | j ƒ  d  S(   Nt   w(   t   getR   t   writeR   (   R   R   R   R!   R    (    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyt   checkout=   s    c         C   s   |  j  | ƒ d  S(   N(   t   lock(   R   R   R   (    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyR*   C   s    c         C   s   |  j  | ƒ d  S(   N(   t   unlock(   R   R   R   (    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyR+   F   s    c         C   sT   |  j  | ƒ } | j ƒ  } | j ƒ  x | D] } | d G| | GHq, Wd d GHd  S(   Nt   :t   =iF   (   t   infot   keyst   sort(   R   R   R   t   dictR/   t   key(    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyR.   I   s    
c         C   s   |  j  | ƒ } | G| GHd  S(   N(   R   (   R   R   R   R   (    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyR   Q   s    c         C   s   |  j  | ƒ r | GHn  d  S(   N(   R   (   R   R   R   (    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyt   listU   s    c         C   sT   d } x& | D] \ } } | d | | } q W| d } |  j  | | ƒ } | GHd  S(   Nt    t    i   (   t   log(   R   R   R   t   flagst   ot   aR$   (    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyR6   Y   s    
c   	      C   sÑ   t  |  | | ƒ r d  Sd } x& | D] \ } } | d | | } q# W| d } |  j | ƒ } t j ƒ  } | j | ƒ | j ƒ  d | |  j | ƒ | f GHt j d | | j	 | f ƒ } | rÍ d d GHn  d  S(   NR4   R5   i   s   diff %s -r%s %ss   diff %s %s %sR-   iF   (
   R   R'   t   tempfilet   NamedTemporaryFileR(   t   flushR   R   t   systemt   name(	   R   R   R   R7   R8   R9   R!   t   tft   sts(    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyt   diffa   s    

c         C   s_   | d  k r1 t | ƒ } | j ƒ  } | j ƒ  n  t j | ƒ j ƒ  } |  j | ƒ } | | k S(   N(   t   NoneR   R   R   t   md5R"   t   digestt   sum(   R   R   R   R!   R    t   lsumt   rsum(    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyR   q   s    c         C   s‚   |  r d Gn d Gd GH|  r$ d GHn  d } xQ t  j j d ƒ t  j j ƒ  t  j j ƒ  } | sl | d k rp Pn  | | } q- W| S(   Ns   enter description,s   enter log message,s)   terminate with single '.' or end of file:s"   NOTE: This is NOT the log message!R4   s   >> s   .
(   R   R   R(   R<   t   stdint   readline(   R"   R#   t   line(    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyR   z   s     c         C   s,   y t  j |  ƒ Wn t  j k
 r' n Xd  S(   N(   R   t   unlinkR	   (   R   (    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyt   remove‹   s    R4   t   ciR   t   coR'   R.   R   R3   R*   R+   s   bhLRtd:l:r:s:w:V:R6   t   cRA   t   __main__(   t   __doc__R   R   R   t   stringRC   R:   t	   rcsclientR    R   R%   R)   R*   R+   R.   R   R3   R6   RA   RB   R   R   RL   R   t   __name__(    (    (    s'   /usr/lib64/python2.7/Demo/pdist/rrcs.pyt   <module>   sD   	"												