
    q&fx                     p   d dl Z d dlZd dlmZ d dlmZ d dlmZmZm	Z
mZmZmZmZmZ d dlmZ ddlmZmZmZmZmZmZ  ej2                  d      Z G d	 d
ej6                        ZddZd dZd dZd Z d Z!d Z"	 	 d!dZ#d Z$d Z%d Z&d Z'	 d"dZ(d dZ) G d d      Z* G d d      Z+ G d d      Z,d Z-y)#    N)_)short)encodingerrorlockmdiffpolicyscmutilutilvfs)procutil   )	constantscontentstoredatapackhistorypackmetadatastoreshallowutilosutilc                       e Zd Zy)RepackAlreadyRunningN)__name__
__module____qualname__     </usr/lib/python3/dist-packages/hgext/remotefilelog/repack.pyr   r      s    r   r   c                    t        j                         d| j                  dg}t        d      }|r|j	                  d       t        d      }|r|j	                  d       | j
                  j                  |       i }| j
                  j                  dd      r| j
                  j                  |d	<   t        j                  |t        j                  fd
di| y )Ns   -R   repacks   (running background repack)
s   --incrementals(   (running background incremental repack)
s   --packsonlys   devels   remotefilelog.bg-waitrecord_waitensurestartF)r   hgexecutableorigrootr   appenduiwarn
configboolatexitrunbgcommandr   environ)repoincremental	packsonlycmdmsgkwargss         r   backgroundrepackr1   !   s      "E4==)
DC
,
-C

#$<=

>"GGLLFww($<= $}#x//MUMfMr   c                    t        | d      r~t        j                  | j                   }t	        j
                  | j                  ddi}t        j                  | t        j                        }t        | |||t        j                  |       t        | j                  d      rt        |       \  }}|\  }}}	|\  }
}}t        j                  | }t	        j
                  |ddi}t        | |||
t        j                  |       t        j                  |ddi}t	        j
                  |	ddi}t        | |||t        j                  |       yy)zIIf ``packsonly`` is True, stores creating only loose objects are skipped.shareddatastoresallowincompleteToptions	datastoreN)hasattrr   unioncontentstorer3   r   unionmetadatastoresharedhistorystoresr   getcachepackpathr   FILEPACK_CATEGORY
_runrepackmanifestlog_getmanifeststoresTREEPACK_CATEGORY)r+   r6   
datasourcehistorysourcepackpath	localdata
shareddata	lpackpathldstoreslhstores	spackpathsdstoresshstoress                r   
fullrepackrM   2   sl   t'(!33T5J5JK
%88%%
7;
 //)--
 	''	
 t- 24 8	:(1%	8X(2%	8X "33X>
%88
'+
 	''	
 "33
'+

 &88
'+
 	''	
5 .r   c           	         t        | d      rWt        j                  | t        j                        }t        | | j                  | j                  |t        j                  |       t        | j                  d      rZt        |       \  }}|\  }}}|\  }}	}
t        | |	|
|t        j                  |       t        | |||t        j                  d|       yy)zThis repacks the repo by looking at the distribution of pack files in the
    repo and performing the most minimal repack to keep the repo in good shape.
    r3   r5   r7   T)allowincompletedatar6   N)r8   r   r<   r   r=   _incrementalrepackr3   r;   r?   r@   rA   )r+   r6   rD   rE   rF   rG   rH   rI   rJ   rK   rL   s              r   incrementalrepackrQ   j   s     t'(//)--
 	!!$$''	
 t- 24 8	:(1%	8X(2%	8X 	''	
 	'' $	
! .r   c                    | j                   j                  }| j                   j                  }| j                   j                  }| j                   j                  }t        j                  | t        j                        }t        j                  | j                  j                  j                  t        j                        }|||f|||ffS N)r?   r3   localdatastoresr;   localhistorystoresr   r<   r   rA   getlocalpackpathsvfsr   base)r+   r3   rT   r;   rU   sharedpackpathlocalpackpaths          r   r@   r@      s    ''88&&66O**>>))<< 11i))N  00		I77M
 
);<	)+>? r   c                 Z     t         fd|D              }t        fd|D              }|S )Nc              3   ^   K   | ]$  }t         j                  j                  |       & y wrS   )ospathjoin).0prD   s     r   	<genexpr>z_topacks.<locals>.<genexpr>   s      :qh*:s   *-c              3   .   K   | ]  } |        y wrS   r   )r`   ra   constructors     r   rb   z_topacks.<locals>.<genexpr>   s     /AQ/s   )list)rD   filesrd   pathspackss   ` `  r   _topacksri      s(    :E::E///ELr   c                    | j                   j                  dd      }|dk  r|S ddg}|D ch c][  \  }}}|j                  |kD  rFt        j                  j                  |      d   |v r"t        j                  j                  |      d   ] }}}}|D ]  }	t        j                  j                  ||	      }
|D ]l  }|
|z   }| j                   j                  d|t        j                  t        j                  |      j                        fz         t        j                  |       n  |D cg c])  }t        j                  j                  |d         |vs(|+ c}S c c}}}w c c}w )zsDeletes packfiles that are bigger than ``packs.maxpacksize``.

    Returns ``files` with the removed files omitted.   packss   maxpacksizer   s	   .datapacks   .dataidxr   s#   removing oversize packfile %s (%s)
)r%   configbytesst_sizer]   r^   splitextr_   debugr   	bytecountstatunlinkbasename)r+   folderrf   maxsize	VALIDEXTSr^   ftyperq   	oversized	rootfnamerootpathextrows                r   _deletebigpacksr}      sQ    gg!!(N;G!| {+I "' D%LL7"(8(8(>q(AY(N 	q!I   	77<<	2 	Cc>DGGMM7(=(=>?@ IIdO	 !NCBGG$4$4SV$<I$MCNN Os   A E.)E&E&c                    t        j                  | j                  |       t        j	                  |d      }t        | ||      }t        |t        | j                  |      t        j                        }|j                  d |D               t        |t        | j                  |      t        j                        }	|	j                  d |D               t        |t        j                  t        j                        }
t        |d |
D        t        j                        }|j                  d |D               t        | t!        j"                  |d|it%        j&                  |	ddi||t%        j&                  |ddi|       y )	NT)rq   c              3   V   K   | ]!  }t        |t        j                        r| # y wrS   )
isinstancer   datapackstorer`   ss     r   rb   z%_incrementalrepack.<locals>.<genexpr>   s$      Jq(2H2H$Is   ))c              3   T   K   | ]   }t        |t        j                        s| " y wrS   r   r   historypackstorer   s     r   rb   z%_incrementalrepack.<locals>.<genexpr>   s(      ![99: 	
   &(c              3   (   K   | ]
  \  }}}|  y wrS   r   )r`   fmoderq   s       r   rb   z%_incrementalrepack.<locals>.<genexpr>   s     0}q$0s   c              3   T   K   | ]   }t        |t        j                        s| " y wrS   r   r   s     r   rb   z%_incrementalrepack.<locals>.<genexpr>   s(      ![99: 	
r   r4   )fullhistoryr6   )r   mkstickygroupdirr%   r   listdirr}   ri   _computeincrementaldatapackr   extend_computeincrementalhistorypackr   _allpackfileswithsuffix
PACKSUFFIXINDEXSUFFIXr>   r   r9   r   r:   )r+   r7   historystorerD   categoryrO   r6   rf   	datapackshistorypacksallhistoryfilesallhistorypackss               r   rP   rP      sv      (3NN8$N/ED(E2E-dggu=x?P?PI    &tww6L
    .{%%{'>'>O 00O
   
 &&	
(;	
 	((,MM!44
.2
 r   c                    | j                  dd      | j                  dd      | j                  dd      | j                  dd      | j                  dd      d}t        |t        j
                  t        j                        }t        ||      S )N   remotefilelogs   data.gencountlimits   data.generationss   data.maxrepackpackss   data.repackmaxpacksizes   data.repacksizelimit   gencountlimit   generations   maxrepackpacks   repackmaxpacksize   repacksizelimit)	configint
configlistrl   r   r   r   r   _computeincrementalpackr%   rf   opts	packfiless       r   r   r     s    ,,'79NO&68KL<<4
 !nn7
 NN5
D (x""H$8$8I #9d33r   c                 "   | j                  dd      | j                  dddg      | j                  dd      | j                  ddd      | j                  dd      d	}t        |t        j
                  t        j                        }t        ||      S )
Nr   s   history.gencountlimits   history.generationss   100MBs   history.maxrepackpackss   history.repackmaxpacksizes   400MBs   history.repacksizelimitr   )r   r   rl   r   r   r   r   r   r   s       r   r   r   "  s    ,,6
 4xj
 <<7
 !nn:H
 NN8
D$ ({%%{'>'>I #9d33r   c                     g }| D ch c]  \  }}}|
 }}}}| D ]C  \  }}}|j                  |      s|d t        |        }	|	|z   |vr0|j                  |	||f       E |S c c}}}w rS   )endswithlenr$   )
rf   
packsuffixindexsuffixresultfnr   rq   filesetfilenameprefixs
             r   r   r   ;  s    F(-..nb$r.G. % 	,$  ,,S_,- [ 0vtT*+	, M /s   A$c           	         t        t        d |d   D        d            }|j                  d       g }t        t	        |            D ]  }|j                  g         i | D ]N  \  }}}|j
                  }||d   kD  r||<   t        |      D ]   \  }}	||	kD  s||   j                  |        N P g }
t        |      D ]>  \  }}	t	        ||         |d   kD  s|
j                  t        ||   dfd	              n |
d
d }|
dd
 }
t        fd|D              }||d   k  rY|
rWt	        |      |d   k  rF|j                  |
j                                ||d      z  }||d   k  r|
rt	        |      |d   k  rF|S )a`  Given a set of pack files along with the configuration options, this
    function computes the list of files that should be packed as part of an
    incremental repack.

    It tries to strike a balance between keeping incremental repacks cheap (i.e.
    packing small things when possible, and rolling the packs up to the big ones
    over time).
    c              3   F   K   | ]  }t        j                  |        y wrS   )r   	sizetointr   s     r   rb   z*_computeincrementalpack.<locals>.<genexpr>W  s     @aq!@s   !r   T)reverser   r   r   c                     |    S rS   r   )xsizess    r   <lambda>z)_computeincrementalpack.<locals>.<lambda>w  s    58 r   )r   keyNc              3   (   K   | ]	  }|     y wrS   r   )r`   nr   s     r   rb   z*_computeincrementalpack.<locals>.<genexpr>~  s     3!U1X3s   r   r   )
re   sortedr$   ranger   rm   	enumerater   sumpop)rf   r   limitsgenerationsir   r   rq   sizelimitgenpackschosenpacks
repacksizer   s                @r   r   r   L  s    @4+?@$OF MM! K3v; 2 E# 	d||$+,,f!&) 	HAue|A%%f-		" Hf% 5{1~&6!77OO{1~t9KL  23-K}H3{33JT,--t$5668<<>*eKO,,
 	T,--t$566
 r   c           
         t        j                  | j                  |       d }| j                  j                  dd      }|s|}t	        | |||||||      }	t        j                  | j                  |      5 }
t        j                  | j                  |      5 }	 |	j                  |
|       	 d d d        d d d        y # t        j                  $ r t        t        d            w xY w# 1 sw Y   =xY w# 1 sw Y   y xY w)Nc                     | j                  ||      }| |j                            j                         }| j                  j	                  dd      }t        j
                         |z
  }|d   |k  S )zCheck if the file node is older than a limit.
        Unless a limit is specified in the config the default limit is taken.
        )fileidr   s   nodettlr   )filectxlinkrevdater%   r   time)r+   r   noder   filetimettlr   s          r   isoldz_runrepack.<locals>.isold  sf     ,,x,5)*//1gg 0*=		c!{U""r   r   s   gcrepack)gcr   r6   s3   skipping repack - another repack is already running)r   r   r%   r'   repackerr   mutabledatapackr   mutablehistorypackrunr   LockHeldr   r   )r+   datahistoryrD   r   r   r6   r   garbagecollectpackerdpackhpacks               r   r>   r>     s       (3
# WW''(8+FN	F 
	!	!$''8	4 
++DGGX> 		%

5%(		
 
 >> *. 		 		
 
s6   7!C5C)B>-C5>(C&&C))C2	.C55C>c           	         |st               }n|}g d}| j                  j                  ddd      }|r|j                  d|z         | j                  j                  ddd      }|r|j                  d|z         dj	                  |      }d|z  g}t        j                  | |      }t               }d}t        |j                        D ]%  }	| |	   j                         j                         |v r"| |	   j                         j                         }
n8|r#| |	   j                         j                  |      }
n| |	   j                         }
| |	   j                         }|j                  |	       t!        |
      t"        u r@|
j%                         D ],  \  }}|d	   d	   |j                   |||d	   d	                . |
j%                         D ]  \  }}|j                   |||              ( |S )
a  Computes a keepset which is not garbage collected.
    'keyfn' is a function that maps filename, node to a unique key.
    'lastkeepkeys' is an optional argument and if provided the keepset
    function updates lastkeepkeys with more keys and returns the result.
    )   .s   draft()s   parents(draft())r   s   pullprefetchNs   (%s)s   bgprefetchrevs   +s   sort((%s), "topo")r   )setr%   configr$   r_   r
   revrangereversed_listp1revmanifestctx	readdeltamanifestdiffaddtypedictitems)r+   keyfnlastkeepkeyskeepkeysrevsprefetchrevskeep	processedlastmanifestrmr   r   filenodes                 r   keepsetr    s    5 3D77>>"2OTJLGl*+77>>"24EtLLGl*+99T?D!D()DD$'DIL djj! 87::<* Q##%//1A G$$&++L9G$$&Aw'')a 7d? #$'') >$71:)LLxa!<=>
 '(ggi 8"(U8X678186 Or   c                   <    e Zd ZdZ	 	 	 d	dZd Zd Zd Zd Zd Z	y)
r   z^Class for orchestrating the repack of data and history information into a
    new format.
    Nc	                     || _         || _        || _        || _        t	        j
                  |      | _        || _        || _        | j                  r'|st        d      t        |d       | _        || _        y y )Ns*   Function 'isold' is not properly specifiedc                 
    | |fS rS   r   )r   r   s     r   r   z#repacker.__init__.<locals>.<lambda>  s
    1v r   )r+   r   r   r   r   getunitsunitr   r6   
ValueErrorr  r   r   )	selfr+   r   r   r   r   r   r   r6   s	            r   __init__zrepacker.__init__  su     		&&&x0	  !NOO#D*=>DMDJ r   c                    t               }t        j                  t        | j                        dd d      5  | j                  j                  d       | j                  j                  || j                         | j                  j                  || j                         | j                  ||       | j                  ||       |j                  D ]  }|j                  |        	 d d d        y # 1 sw Y   y xY w)Ns
   repacklockr   )desctimeouts	   prerepackr5   )repackledgerlockmodr   repacklockvfsr+   hookr   
markledgerr6   r   
repackdatarepackhistorysourcescleanup)r	  
targetdatatargethistoryledgersources        r   r   zrepacker.run  s    \\$))$m$
 	' IINN<( II   >LL##FDLL#A OOFJ/v}5 !.. 'v&'	' 	' 	's   B0C11C:c                     |s|S d fd	}t        |      }t        t        ||d            }|j                  r<|j                  ddj	                  |D cg c]  }t        |       c}      fz         t        |      D ]>  \  }}	|dk(  r j                  j                  df||	<   '||dz
     }
|
||
   d   dz   f||	<   @ |D cg c]	  }||vs| }}||z  }|S c c}w c c}w )	aq  Reorderes ``orphans`` into a single chain inside ``nodes`` and
        ``deltabases``.

        We often have orphan entries (nodes without a base that aren't
        referenced by other nodes -- i.e., part of a chain) due to gaps in
        history. Rather than store them as individual fulltexts, we prefer to
        insert them as one chain sorted by size.
        r   c                     j                   j                  |       }t        j                  |v r|t        j                     S |S rS   )r   getmetar   METAKEYSIZE)r   defaultmetar   r	  s      r   getsizez'repacker._chainorphans.<locals>.getsize2  s=    99$$Xt4D$$,I1122r   T)r   r   s   %s: orphan chain: %s
s   , r   )r   )	r   re   	debugflagro   r_   r   r   r+   nullid)r	  r%   r   nodesorphans
deltabasesr!  r   r   r   parentr   s   ` `         r   _chainorphanszrepacker._chainorphans&  s	    L	 /vg7DAB<<HH)UZZ7(Caq(CDEF !) 	GGAtAv$(II$4$4a#8
4  Q$*Jv,>q,AA,E#F
4 	G "6qQg%566 )D 7s   C	C$C$c           	      b  ' | j                   j                  }|j                  ddd      }i }|j                  j	                         D ]8  }|j
                  s||j                  |j                  i       |j                  <   : d}|j                  t        d      | j                  t        |            }t        |j                               D ]  \  }	}
|j                  |       i }t!        d |
D              'g }|j                  t        d      d	t        '            }t#        '      D ]I  \  }}||v r|j                  |       	 |j                  | j$                  j'                  |	||
             K |j-                          t!        t/        | j1                  |                  }t        |      dkD  r|j3                  dt        |      z         |j5                  t        |             t!        t7        'fd|            }| j8                  rTg }|D ]K  }|	|f| j:                  vr(| j=                  | j                   |	|      rd|
|   _        ;|j+                  |       M |}i }tA               }tA               }tA        '      '|j                  t        d      d	t        |            }t#        |      D ]  \  }}|j                  |       |jC                  |d       }|E| j                   jD                  d}}| j                   jD                  df||<   |jG                  |       n|\  }}|jG                  |       |jC                  |      }|s|\  }}}}|r| j                   jD                  }||k  s|| j                   jD                  k7  r
||dz   f||<   || j                   jD                  k7  s||dz   f||<   	 |jI                  dd      r||z
  }| jK                  ||	|||      }t#        |      D ]V  \  }}||   \  }}|| j                   jD                  k7  r| jL                  jO                  |	|      }|\  } }!}"}#|#jC                  tP        jR                        }$|!|	k7  s|"|k7  s|$| jL                  jC                  |	|      }%| jL                  jC                  |	|      }&t        |&      }$tU        jV                  |%|&      } nC| jL                  jC                  |	|      } t        |       }$| jL                  jY                  |	|      }#tP        jR                  |#vr|$|#tP        jR                  <   |jG                  |	||| |#       d|
|   _-        Y |j-                          |dz  } |j-                          |j]                  |       y # t(        $ r |j+                  |       Y w xY w)Nrk   s   maxchainleni  r   s   repacking datar  totalc              3       K   | ]  }|  y wrS   r   r`   r   s     r   rb   z&repacker.repackdata.<locals>.<genexpr>`       2$2   s   building historys   nodesknowns%   repackdata: %d nodes without history
c                     | v S rS   r   )r   r$  s    r   r   z%repacker.repackdata.<locals>.<lambda>  s    DEM r   Ts   processing nodesr   r   s   chainorphansbysizer  )/r+   r%   r   entriesvaluesrB   
setdefaultr   r   makeprogressr   r  r   r   r   updatere   r   r   getancestorsKeyErrorr$   completer   	_toposortro   r   filterr   r   r   gcedr   getr#  r   r'   r(  r   getdeltar   r  r   textdiffr  datarepackedclose)(r	  r  targetr%   maxchainlenbyfileentrycountrepackprogressr   r4  	ancestors	nohistorybuildprogressr   r   orderednodesneworderednodesr&  nobase
referencedprocessprogress
deltatuple	deltabasechainlenancestorinfor   p2linknodecopyfromr%  
deltaentrydeltadeltabasenameorigdeltabaser   r   deltabasetextoriginalr$  s(                                          @r   r  zrepacker.repackdataO  s   YY\\ll8^TB^^**, 	JEDI!!%.."5ejjA	J  tyyF ) 
 "(!7 J	Hg!!%(I2'22EIOO%&XSZ , M %U+ +49$$$Q'
+$$((55$d) 6 + ""$  	)B CDL9~!=IN y 12  1<@L
 """$( 1D !$'t}}<		8TB .2* #**401  / JUFJJE oo%&XS=N . O %\2 "B4&&q) (^^D$7
%*.))*:*:AxI(,		(8(8!'<Jt$JJt$*4'IxNN9-  )}}T21=.BHh
  !YY--+- !1!11.2HqL-AJrN!1!11.2HqL-AJrNE"BJ }}Y(=> :-#11, 
 %\2 24&0&6#	8
 		 0 00!%!3!3Hd!CJ@J=E=-88I$9$9:D%1(I5<(,		h	(J#'99==4#@"8} %}h G IIMM(D9Eu:D99,,Xt<D ((426D../

8T9eTB-1*;2> $$&QJEUJ	X 	!F#u   + $$T*	+s   	-VV.-V.c           
          | j                   j                  }i }|j                  j                         D ]8  }|j                  s||j                  |j                  i       |j                  <   : |j                  t        d      | j                  t        |            }t        |j                               D ]2  \  }}i }	t        d |D              }
|
D ]4  }||	v r|	j                  | j                   j#                  |||	             6 t%        | j'                  |	            }t)               }|D ]  }|	|   \  }}}}||v r^||vrZ|| j                   j*                  k7  r||k7  r|j-                  |       || j                   j*                  k7  r|j-                  |       o|r|j-                  |       |j-                  ||||||       ||v sd||   _         |j1                          5 |j3                          |j5                  |       y )Ns   repacking historyr*  c              3       K   | ]  }|  y wrS   r   r-  s     r   rb   z)repacker.repackhistory.<locals>.<genexpr>  r.  r/  r0  Tr3  )r+   r%   r4  r5  rC   r6  r   r   r7  r   r  r   r   r   re   r8  r   r9  r   r<  r   r#  r   historyrepacked	incrementr;  rC  )r	  r  rD  r%   rF  rG  progressr   r4  rJ  r$  r   rM  dontprocessr   rV  rW  rX  s                     r   r  zrepacker.repackhistory  s   YY\\^^**, 	JE""DI!!%.."5ejjA	J ??"#$))3v; # 
 "(!7 ,	!HgI2'22E 9$  LL--hI-N $DNN9$=>L %K$ 9-6t_*B( ;&4w+> TYY---(h2F#+TYY---#+OOB'

8T2r8XF7?48GDM1598  Y,	!\ 	F#r   c                 ^      fd}t        j                  j                         |      }|S )Nc                     |    \  }}}}g }|j                   j                  k7  r|j                  |       |j                   j                  k7  r|j                  |       |S rS   )r+   r#  r$   )r   r   rV  rW  rX  parentsrJ  r	  s         r   
parentfuncz&repacker._toposort.<locals>.parentfunc(  s[    )24&BHhGTYY%%%r"TYY%%%r"Nr   )r   	sortnodeskeys)r	  rJ  rh  sortednodess   ``  r   r<  zrepacker._toposort'  s)    	 "++INN,<jIr   )FNN)
r   r   r   __doc__r
  r   r(  r  r  r<  r   r   r   r   r     s4     2'('RZ$x:$xr   r   c                   .    e Zd ZdZd Zd Zd Zd Zd Zy)r  zStorage for all the bookkeeping that happens during a repack. It contains
    the list of revisions being repacked, what happened to each revision, and
    which source store contained which revision originally (for later cleanup).
    c                 >    i | _         i | _        t               | _        y rS   )r4  r  r   created)r	  s    r   r
  zrepackledger.__init__;  s    ur   c                     | j                  ||      }d|_        | j                  j                  |      }|st	               }|| j                  |<   |j                  |       y)z`Mark the given filename+node revision as having a data rev in the
        given source.
        TN)_getorcreateentryrB   r  r?  r   r   r	  r  r   r   rG  r4  s         r   markdataentryzrepackledger.markdataentry@  sV     &&x6,,""6*eG#*DLL Er   c                     | j                  ||      }d|_        | j                  j                  |      }|st	               }|| j                  |<   |j                  |       y)zcMark the given filename+node revision as having a history rev in the
        given source.
        TN)rq  rC   r  r?  r   r   rr  s         r   markhistoryentryzrepackledger.markhistoryentryL  sV     &&x6",,""6*eG#*DLL Er   c                 ~    ||f}| j                   j                  |      }|st        ||      }|| j                   |<   |S rS   )r4  r?  repackentry)r	  r   r   r   values        r   rq  zrepackledger._getorcreateentryX  sB      %$/E %DLLr   c                 :    | j                   j                  |       y rS   )ro  r   )r	  rx  s     r   
addcreatedzrepackledger.addcreateda  s    r   N)	r   r   r   rl  r
  rs  ru  rq  rz  r   r   r   r  r  5  s     



 r   r  c                       e Zd ZdZdZd Zy)rw  zFSimple class representing a single revision entry in the repackledger.r   r   rB   rC   rB  ra  r>  c                 f    || _         || _        d| _        d| _        d| _        d| _        d| _        y )NFr|  )r	  r   r   s      r   r
  zrepackentry.__init__r  s6     	"!$	r   N)r   r   r   rl  	__slots__r
  r   r   r   rw  rw  e  s    PIr   rw  c                     t        | d      r9t        j                  | t        j                        }t        j
                  |      S | j                  S )Nname)r8   r   r<   r   r=   r   rW   )r+   sharedcachepaths     r   r  r    sD    tV &66)--
 ww''yyr   )TFrS   )FN)NN).r]   r   mercurial.i18nr   mercurial.noder   	mercurialr   r   r   r  r   r	   r
   r   r   mercurial.utilsr    r   r   r   r   r   r   	importmodr   Abortr   r1   rM   rQ   r@   ri   r}   rP   r   r   r   r   r>   r  r   r  rw  r  r   r   r   <module>r     s    	    	 	 	 %  
		(	#	5;; 	N"5
p)
X&OL ;|4*42";~ HL)X;|~ ~B
-  - ` 8	r   