ÿþI n d e x :   s e t u p t o o l s / s v n _ u t i l . p y  
 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
 - - -   s e t u p t o o l s / s v n _ u t i l . p y 	 ( r e v i s i o n   0 )  
 + + +   s e t u p t o o l s / s v n _ u t i l . p y 	 ( r e v i s i o n   0 )  
 @ @   - 0 , 0   + 1 , 1 0 9   @ @  
 + i m p o r t   o s  
 + i m p o r t   r e  
 +  
 + d e f   g e t _ e n t r i e s _ f i l e s ( b a s e ,   r e c u r s e = T r u e ) :  
 +         f o r   b a s e , d i r s , f i l e s   i n   o s . w a l k ( o s . c u r d i r ) :  
 +                 i f   ' . s v n '   n o t   i n   d i r s :  
 +                         d i r s [ : ]   =   [ ]  
 +                         c o n t i n u e         #   n o   s e n s e   w a l k i n g   u n c o n t r o l l e d   s u b d i r s  
 +                 d i r s . r e m o v e ( ' . s v n ' )  
 +                 f   =   o p e n ( o s . p a t h . j o i n ( b a s e , ' . s v n ' , ' e n t r i e s ' ) )  
 +                 y i e l d   f . r e a d ( )  
 +                 f . c l o s e ( )  
 +  
 + c l a s s   S V N E n t r i e s ( o b j e c t ) :  
 +         d e f   _ _ i n i t _ _ ( s e l f ,   d a t a ) :  
 +                 s e l f . d a t a   =   d a t a  
 +  
 +         @ c l a s s m e t h o d  
 +         d e f   l o a d ( c l a s s _ ,   b a s e ) :  
 +                 f i l e n a m e   =   o s . p a t h . j o i n ( b a s e ,   ' . s v n ' ,   ' e n t r i e s ' )  
 +                 f   =   o p e n ( f i l e n a m e )  
 +                 r e s u l t   =   S V N E n t r i e s . r e a d ( f )  
 +                 f . c l o s e ( )  
 +                 r e t u r n   r e s u l t  
 +  
 +         @ c l a s s m e t h o d  
 +         d e f   r e a d ( c l a s s _ ,   f i l e ) :  
 +                 d a t a   =   f i l e . r e a d ( )  
 +                 i s _ x m l   =   d a t a . s t a r t s w i t h ( ' < ? x m l ' )  
 +                 c l a s s _   =   [ S V N E n t r i e s T e x t ,   S V N E n t r i e s X M L ] [ i s _ x m l ]  
 +                 r e t u r n   c l a s s _ ( d a t a )  
 +  
 +         d e f   p a r s e _ r e v i s i o n ( s e l f ) :  
 +                 a l l _ r e v s   =   s e l f . p a r s e _ r e v i s i o n _ n u m b e r s ( )   +   [ 0 ]  
 +                 r e t u r n   m a x ( a l l _ r e v s )  
 +  
 + c l a s s   S V N E n t r i e s T e x t ( S V N E n t r i e s ) :  
 +         k n o w n _ s v n _ v e r s i o n s   =   {  
 +                 ' 1 . 4 . x ' :   8 ,  
 +                 ' 1 . 5 . x ' :   9 ,  
 +                 ' 1 . 6 . x ' :   1 0 ,  
 +                 }  
 +  
 +         d e f   _ _ g e t _ c a c h e d _ s e c t i o n s ( s e l f ) :  
 +                 r e t u r n   s e l f . s e c t i o n s  
 +                  
 +         d e f   g e t _ s e c t i o n s ( s e l f ) :  
 +                 S E C T I O N _ D I V I D E R   =   ' \ f \ n '  
 +                 s e c t i o n s   =   s e l f . d a t a . s p l i t ( S E C T I O N _ D I V I D E R )  
 +                 s e c t i o n s   =   m a p ( s t r . s p l i t l i n e s ,   s e c t i o n s )  
 +                 t r y :  
 +                         #   r e m o v e   t h e   S V N   v e r s i o n   n u m b e r   f r o m   t h e   f i r s t   l i n e  
 +                         s v n _ v e r s i o n   =   i n t ( s e c t i o n s [ 0 ] . p o p ( 0 ) )  
 +                         i f   n o t   s v n _ v e r s i o n   i n   s e l f . k n o w n _ s v n _ v e r s i o n s . v a l u e s ( ) :  
 +                                 l o g . w a r n ( " U n k n o w n   s u b v e r s i o n   v e r s o n   % d " ,   s v n _ v e r s i o n )  
 +                 e x c e p t   V a l u e E r r o r :  
 +                         r e t u r n  
 +                 s e l f . s e c t i o n s   =   s e c t i o n s  
 +                 s e l f . g e t _ s e c t i o n s   =   s e l f . _ _ g e t _ c a c h e d _ s e c t i o n s  
 +                 r e t u r n   s e l f . s e c t i o n s  
 +  
 +         d e f   i s _ v a l i d ( s e l f ) :  
 +                 r e t u r n   b o o l ( s e l f . g e t _ s e c t i o n s ( ) )  
 +          
 +         d e f   g e t _ u r l ( s e l f ) :  
 +                 r e t u r n   s e l f . g e t _ s e c t i o n s ( ) [ 0 ] [ 4 ]  
 +  
 +         d e f   p a r s e _ r e v i s i o n _ n u m b e r s ( s e l f ) :  
 +                 r e v i s i o n _ l i n e _ n u m b e r   =   9  
 +                 r e v _ n u m b e r s   =   [  
 +                         i n t ( s e c t i o n [ r e v i s i o n _ l i n e _ n u m b e r ] )  
 +                         f o r   s e c t i o n   i n   s e l f . g e t _ s e c t i o n s ( )  
 +                         i f   l e n ( s e c t i o n ) > r e v i s i o n _ l i n e _ n u m b e r  
 +                                 a n d   s e c t i o n [ r e v i s i o n _ l i n e _ n u m b e r ]  
 +                         ]  
 +                 r e t u r n   r e v _ n u m b e r s  
 +          
 +         d e f   g e t _ u n d e l e t e d _ r e c o r d s ( s e l f ) :  
 +                 u n d e l e t e d   =   l a m b d a   s :   l e n ( s )   > =   6   a n d   s [ 5 ]   ! =   ' d e l e t e '  
 +                 r e s u l t   =   [  
 +                         s e c t i o n [ 0 ]  
 +                         f o r   s e c t i o n   i n   s e l f . g e t _ s e c t i o n s ( )  
 +                         i f   u n d e l e t e d ( s e c t i o n )  
 +                         ]  
 +                 r e t u r n   r e s u l t  
 +  
 + c l a s s   S V N E n t r i e s X M L ( S V N E n t r i e s ) :  
 +         d e f   i s _ v a l i d ( s e l f ) :  
 +                 r e t u r n   T r u e  
 +  
 +         d e f   g e t _ u r l ( s e l f ) :  
 +                 " G e t   r e p o s i t o r y   U R L "  
 +                 u r l r e   =   r e . c o m p i l e ( ' u r l = " ( [ ^ " ] + ) " ' )  
 +                 r e t u r n   u r l r e . s e a r c h ( s e l f . d a t a ) . g r o u p ( 1 )  
 +  
 +         d e f   p a r s e _ r e v i s i o n _ n u m b e r s ( s e l f ) :  
 +                 r e v r e   =   r e . c o m p i l e ( ' c o m m i t t e d - r e v = " ( \ d + ) " ' )  
 +                 r e t u r n   [  
 +                         i n t ( m . g r o u p ( 1 ) )  
 +                         f o r   m   i n   r e v r e . f i n d i t e r ( s e l f . d a t a )  
 +                         ]  
 +          
 +         d e f   g e t _ u n d e l e t e d _ r e c o r d s ( s e l f ) :  
 +                 e n t r i e s _ p a t t e r n   =   r e . c o m p i l e ( r ' n a m e = " ( [ ^ " ] + ) " ( ? ! [ ^ > ] + d e l e t e d = " t r u e " ) ' ,   r e . I )  
 +                 r e s u l t s   =   [  
 +                         u n e s c a p e ( m a t c h . g r o u p ( 1 ) )  
 +                         f o r   m a t c h   i n   e n t r i e s _ p a t t e r n . f i n d i t e r ( s e l f . d a t a )  
 +                         ]  
 +                 r e t u r n   r e s u l t s  
  
 P r o p e r t y   c h a n g e s   o n :   s e t u p t o o l s \ s v n _ u t i l . p y  
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
 A d d e d :   s v n : k e y w o r d s  
       +   I d   R e v   A u t h o r   D a t e  
  
 I n d e x :   s e t u p t o o l s / c o m m a n d / e g g _ i n f o . p y  
 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
 - - -   s e t u p t o o l s / c o m m a n d / e g g _ i n f o . p y 	 ( r e v i s i o n   7 1 5 5 9 )  
 + + +   s e t u p t o o l s / c o m m a n d / e g g _ i n f o . p y 	 ( w o r k i n g   c o p y )  
 @ @   - 8 , 6   + 8 , 7   @ @  
   f r o m   d i s t u t i l s . e r r o r s   i m p o r t   *  
   f r o m   d i s t u t i l s   i m p o r t   l o g  
   f r o m   s e t u p t o o l s . c o m m a n d . s d i s t   i m p o r t   s d i s t  
 + f r o m   s e t u p t o o l s   i m p o r t   s v n _ u t i l  
   f r o m   d i s t u t i l s . u t i l   i m p o r t   c o n v e r t _ p a t h  
   f r o m   d i s t u t i l s . f i l e l i s t   i m p o r t   F i l e L i s t  
   f r o m   p k g _ r e s o u r c e s   i m p o r t   p a r s e _ r e q u i r e m e n t s ,   s a f e _ n a m e ,   p a r s e _ v e r s i o n ,   \  
 @ @   - 2 0 5 , 3 0   + 2 0 6 , 2 0   @ @  
    
           d e f   g e t _ s v n _ r e v i s i o n ( s e l f ) :  
                   r e v i s i o n   =   0  
 -                 u r l r e   =   r e . c o m p i l e ( ' u r l = " ( [ ^ " ] + ) " ' )  
 -                 r e v r e   =   r e . c o m p i l e ( ' c o m m i t t e d - r e v = " ( \ d + ) " ' )  
    
                   f o r   b a s e , d i r s , f i l e s   i n   o s . w a l k ( o s . c u r d i r ) :  
                           i f   ' . s v n '   n o t   i n   d i r s :  
                                   d i r s [ : ]   =   [ ]  
                                   c o n t i n u e         #   n o   s e n s e   w a l k i n g   u n c o n t r o l l e d   s u b d i r s  
                           d i r s . r e m o v e ( ' . s v n ' )  
 -                         f   =   o p e n ( o s . p a t h . j o i n ( b a s e , ' . s v n ' , ' e n t r i e s ' ) )  
 -                         d a t a   =   f . r e a d ( )  
 -                         f . c l o s e ( )  
 -  
 -                         i f   d a t a . s t a r t s w i t h ( ' 9 ' )   o r   d a t a . s t a r t s w i t h ( ' 8 ' ) :  
 -                                 d a t a   =   m a p ( s t r . s p l i t l i n e s , d a t a . s p l i t ( ' \ n \ x 0 c \ n ' ) )  
 -                                 d e l   d a t a [ 0 ] [ 0 ]     #   g e t   r i d   o f   t h e   ' 8 '   o r   ' 9 '  
 -                                 d i r u r l   =   d a t a [ 0 ] [ 3 ]  
 -                                 l o c a l r e v   =   m a x ( [ i n t ( d [ 9 ] )   f o r   d   i n   d a t a   i f   l e n ( d ) > 9   a n d   d [ 9 ] ] + [ 0 ] )  
 -                         e l i f   d a t a . s t a r t s w i t h ( ' < ? x m l ' ) :  
 -                                 d i r u r l   =   u r l r e . s e a r c h ( d a t a ) . g r o u p ( 1 )         #   g e t   r e p o s i t o r y   U R L  
 -                                 l o c a l r e v   =   m a x ( [ i n t ( m . g r o u p ( 1 ) )   f o r   m   i n   r e v r e . f i n d i t e r ( d a t a ) ] + [ 0 ] )  
 -                         e l s e :  
 +                          
 +                         e n t r i e s   =   s v n _ u t i l . S V N E n t r i e s . l o a d ( b a s e )  
 +                         i f   n o t   e n t r i e s . i s _ v a l i d ( ) :  
                                   l o g . w a r n ( " u n r e c o g n i z e d   . s v n / e n t r i e s   f o r m a t ;   s k i p p i n g   % s " ,   b a s e )  
                                   d i r s [ : ]   =   [ ]  
                                   c o n t i n u e  
 +                         l o c a l r e v   =   e n t r i e s . p a r s e _ r e v i s i o n ( )  
 +                         d i r u r l   =   e n t r i e s . g e t _ u r l ( )  
                           i f   b a s e = = o s . c u r d i r :  
                                   b a s e _ u r l   =   d i r u r l + ' / '       #   s a v e   t h e   r o o t   u r l  
                           e l i f   n o t   d i r u r l . s t a r t s w i t h ( b a s e _ u r l ) :  
 @ @   - 2 4 3 , 7   + 2 3 4 , 6   @ @  
    
    
    
 -  
           d e f   f i n d _ s o u r c e s ( s e l f ) :  
                   " " " G e n e r a t e   S O U R C E S . t x t   m a n i f e s t   f i l e " " "  
                   m a n i f e s t _ f i l e n a m e   =   o s . p a t h . j o i n ( s e l f . e g g _ i n f o , " S O U R C E S . t x t " )  
 I n d e x :   s e t u p t o o l s / c o m m a n d / s d i s t . p y  
 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
 - - -   s e t u p t o o l s / c o m m a n d / s d i s t . p y 	 ( r e v i s i o n   7 1 5 5 9 )  
 + + +   s e t u p t o o l s / c o m m a n d / s d i s t . p y 	 ( w o r k i n g   c o p y )  
 @ @   - 2 , 6   + 2 , 7   @ @  
   f r o m   d i s t u t i l s . u t i l   i m p o r t   c o n v e r t _ p a t h  
   f r o m   d i s t u t i l s   i m p o r t   l o g  
   i m p o r t   o s ,   r e ,   s y s ,   p k g _ r e s o u r c e s  
 + f r o m   s e t u p t o o l s . s v n _ u t i l   i m p o r t   S V N E n t r i e s  
    
   e n t i t i e s   =   [  
           ( " & l t ; " , " < " ) ,   ( " & g t ; " ,   " > " ) ,   ( " & q u o t ; " ,   ' " ' ) ,   ( " & a p o s ; " ,   " ' " ) ,  
 @ @   - 8 0 , 2 4   + 8 1 , 1 1   @ @  
                           y i e l d   j o i n p a t h ( d i r n a m e ,   p a r t s [ 0 ] )  
    
    
 - e n t r i e s _ p a t t e r n   =   r e . c o m p i l e ( r ' n a m e = " ( [ ^ " ] + ) " ( ? ! [ ^ > ] + d e l e t e d = " t r u e " ) ' ,   r e . I )  
    
   d e f   e n t r i e s _ f i n d e r ( d i r n a m e ,   f i l e n a m e ) :  
 -         f   =   o p e n ( f i l e n a m e , ' r U ' )  
 -         d a t a   =   f . r e a d ( )  
 -         f . c l o s e ( )  
 -         i f   d a t a . s t a r t s w i t h ( ' 9 ' )   o r   d a t a . s t a r t s w i t h ( ' 8 ' ) :         #   s u b v e r s i o n   1 . 5 / 1 . 4  
 -                 f o r   r e c o r d   i n   m a p ( s t r . s p l i t l i n e s ,   d a t a . s p l i t ( ' \ n \ x 0 c \ n ' ) [ 1 : ] ) :  
 -                         i f   n o t   r e c o r d   o r   l e n ( r e c o r d ) > = 6   a n d   r e c o r d [ 5 ] = = " d e l e t e " :  
 -                                 c o n t i n u e         #   s k i p   d e l e t e d  
 -                         y i e l d   j o i n p a t h ( d i r n a m e ,   r e c o r d [ 0 ] )  
 -         e l i f   d a t a . s t a r t s w i t h ( ' < ? x m l ' ) :  
 -                 f o r   m a t c h   i n   e n t r i e s _ p a t t e r n . f i n d i t e r ( d a t a ) :  
 -                         y i e l d   j o i n p a t h ( d i r n a m e , u n e s c a p e ( m a t c h . g r o u p ( 1 ) ) )  
 -         e l s e :  
 -                 l o g . w a r n ( " u n r e c o g n i z e d   . s v n / e n t r i e s   f o r m a t   i n   % s " ,   d i r n a m e )  
 +         f o r   r e c o r d   i n   S V N E n t r i e s . l o a d ( d i r n a m e ) . g e t _ u n d e l e t e d _ r e c o r d s ( ) :  
 +                 y i e l d   j o i n p a t h ( d i r n a m e ,   r e c o r d )  
    
 -  
   f i n d e r s   =   [  
           ( c o n v e r t _ p a t h ( ' C V S / E n t r i e s ' ) ,  
                   r e _ f i n d e r ( r e . c o m p i l e ( r " ^ \ w ? / ( [ ^ / ] + ) / " ,   r e . M ) ) ) ,  
 
