
    	^cy                     |   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j        d          Z G d	 d
ej                  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-dS )%    N)_short)encodingerrorlockmdiffpolicyscmutilutilvfs)procutil   )	constantscontentstoredatapackhistorypackmetadatastoreshallowutilosutilc                       e Zd ZdS )RepackAlreadyRunningN)__name__
__module____qualname__     </usr/lib/python3/dist-packages/hgext/remotefilelog/repack.pyr   r      s        Dr   r   TFc                    t          j                    d| j        dg}t          d          }|r$|                    d           t          d          }|r|                    d           | j                            |           i }| j                            dd          r| j        j        |d	<   t          j	        |t          j        fd
di| d S )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   backgroundrepackr2   !   s     ""E4=)
DC
,
-
-C >

#$$$<== #

>"""GLLFw($<== / $}#x/MMUMfMMMMMr   c                 p   t          j        | d          rgt          j        | j         }t          j        | j        ddi}t          j	        | t          j                  }t          | |||t          j        |           t          j        | 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        |           dS dS )zIIf ``packsonly`` is True, stores creating only loose objects are skipped.shareddatastoresallowincompleteToptions	datastoreN)r   safehasattrr   unioncontentstorer4   r   unionmetadatastoresharedhistorystoresr   getcachepackpathr   FILEPACK_CATEGORY
_runrepackmanifestlog_getmanifeststoresTREEPACK_CATEGORY)r,   r7   
datasourcehistorysourcepackpath	localdata
shareddata	lpackpathldstoreslhstores	spackpathsdstoresshstoress                r   
fullrepackrN   2   s   011 
!3T5JK
%8%
7;
 
 /)-
 
 	'	
 	
 	
 	
 (+66 !
 24 8 8	:(1%	8X(2%	8X "3X>
%8
'+
 
 	'	
 	
 	
 	
 "3
'+
 

 &8
'+
 
 	'	
 	
 	
 	
 	
 	
5!
 !
r   c           	         t          j        | d          rHt          j        | t          j                  }t          | | j        | j        |t          j        |           t          j        | j	        d          r_t          |           \  }}|\  }}}|\  }}	}
t          | |	|
|t          j        |           t          | |||t          j        d|           dS dS )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.
    r4   r6   r8   T)allowincompletedatar7   N)r   r9   r   r=   r   r>   _incrementalrepackr4   r<   r@   rA   rB   )r,   r7   rE   rF   rG   rH   rI   rJ   rK   rL   rM   s              r   incrementalrepackrR   j   s    011 
/)-
 
 	!$'	
 	
 	
 	
 (+66 
 24 8 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@   r4   localdatastoresr<   localhistorystoresr   r=   r   rB   getlocalpackpathsvfsr   base)r,   r4   rU   r<   rV   sharedpackpathlocalpackpaths          r   rA   rA      s    '8&6O*>)< 1i) N  0	I7 M
 
);<	)+>? r   c                 v     t           fd|D                       }t          fd|D                       }|S )Nc              3   X   K   | ]$}t           j                            |          V  %d S rT   )ospathjoin).0prE   s     r   	<genexpr>z_topacks.<locals>.<genexpr>   s3      ::qh**::::::r   c              3   .   K   | ]} |          V  d S rT   r   )ra   rb   constructors     r   rc   z_topacks.<locals>.<genexpr>   s+      //AQ//////r   )list)rE   filesre   pathspackss   ` `  r   _topacksrj      sM    ::::E:::::E/////////ELr   c                   	 | j                             dd          dk    r|S ddgfd|D             		D ]}t          j                            ||          }D ]c}||z   }| j                             d|t          j        t          j        |          j	                  fz             t          j
        |           d	fd|D             S )	zsDeletes packfiles that are bigger than ``packs.maxpacksize``.

    Returns ``files` with the removed files omitted.   packss   maxpacksizer   s	   .datapacks   .dataidxc                     h | ]]\  }}}|j         k    t          j                            |          d          v 8t          j                            |          d         ^S )r   r   )st_sizer^   r_   splitext)ra   r_   ftypestat	VALIDEXTSmaxsizes       r   	<setcomp>z"_deletebigpacks.<locals>.<setcomp>   sj       D%L7""(8(8(>(>q(AY(N(N 	q!(N(N(Nr   s#   removing oversize packfile %s (%s)
c                 b    g | ]+}t           j                            |d                    v)|,S r   )r^   r_   basename)ra   row	oversizeds     r   
<listcomp>z#_deletebigpacks.<locals>.<listcomp>   s7    NNNCBG$4$4SV$<$<I$M$MC$M$M$Mr   )r&   configbytesr^   r_   r`   debugr   	bytecountrq   rn   unlink)
r,   folderrg   	rootfnamerootpathextr_   rr   rs   ry   s
          @@@r   _deletebigpacksr      s    g!!(N;;G!|| {+I    !&  I   	7<<	22 	 	Cc>DGMM7(=>>?@   IdOOOO	 ONNN5NNNNr   c                     t          j        | j        |           t                              |d          }t          | ||          }t          |t          | j        |          t          j                  }|	                    d |D                        t          |t          | j        |          t          j                  }	|		                    d |D                        t          |t          j        t          j                  }
t          |d |
D             t          j                  }|	                    d |D                        t          | t!          j        |d|it%          j        |	ddi||t%          j        |ddi|           d S )	NT)rq   c              3   N   K   | ] }t          |t          j                  |V  !d S rT   )
isinstancer   datapackstorera   ss     r   rc   z%_incrementalrepack.<locals>.<genexpr>   sH        Jq(2H$I$I	     r   c              3   N   K   | ] }t          |t          j                  |V  !d S rT   r   r   historypackstorer   s     r   rc   z%_incrementalrepack.<locals>.<genexpr>   sI        ![9::	     r   c              3   "   K   | ]
\  }}}|V  d S rT   r   )ra   fmoderq   s       r   rc   z%_incrementalrepack.<locals>.<genexpr>   s(      00}q$000000r   c              3   N   K   | ] }t          |t          j                  |V  !d S rT   r   r   s     r   rc   z%_incrementalrepack.<locals>.<genexpr>   sI        ![9::	     r   r5   )fullhistoryr7   )r   mkstickygroupdirr&   r   listdirr   rj   _computeincrementaldatapackr   extend_computeincrementalhistorypackr   _allpackfileswithsuffix
PACKSUFFIXINDEXSUFFIXr?   r   r:   r   r;   )r,   r8   historystorerE   categoryrP   r7   rg   	datapackshistorypacksallhistoryfilesallhistorypackss               r   rQ   rQ      s     (333NN8$N//ED(E22E-dgu==x?P I         &tw66 L
         .{%{'> O 00000 O
        
 &	
(;	
 	
 	(,MMM!4
.2
 
      r   c                 D   |                      dd          |                     dd          |                      dd          |                     dd          |                     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
configlistr{   r   r   r   r   _computeincrementalpackr&   rg   opts	packfiless       r   r   r     s    ,,'79NOO&68KLL<<4
 
 !nn7
 
 NN5
 
 D (x"H$8 I #9d333r   c                 J   |                      dd          |                     dddg          |                      dd          |                     ddd          |                     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   r{   r   r   r   r   r   r   s       r   r   r   "  s    ,,6
 
 4xj
 
 <<7
 
 !nn:H
 
 NN8
 
 D$ ({%{'> I #9d333r   c                     g }d | D             }| D ]T\  }}}|                     |          s|d t          |                    }||z   |vr<|                    |||f           U|S )Nc                     h | ]\  }}}|	S r   r   )ra   fnr   rq   s       r   rt   z*_allpackfileswithsuffix.<locals>.<setcomp>=  s    ...nb$r...r   )endswithlenr%   )	rg   
packsuffixindexsuffixresultfilesetfilenamer   rq   prefixs	            r   r   r   ;  s    F.....G % 	, 	,$  ,, 	,S__,,- [ 00vtT*++++Mr   c           	         t          t          d |d         D             d                    }|                    d           g }t          t	          |                    D ]}|                    g            i | D ]W\  }}}|j        }||d         k    r||<   t          |          D ](\  }}	||	k    r||                             |            n)Xg }
t          |          D ]T\  }}	t	          ||                   |d         k    r0|
                    t          ||         dfd	                      nU|
d
d         }|
dd
         }
t          fd|D                       }||d         k     rz|
rxt	          |          |d         k     r_|                    |
	                                           ||d                  z  }||d         k     r|
rt	          |          |d         k     _|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   >   K   | ]}t          j        |          V  d S rT   )r   	sizetointr   s     r   rc   z*_computeincrementalpack.<locals>.<genexpr>W  s,      @@aq!!@@@@@@r   r   T)reverser   r   r   c                     |          S rT   r   )xsizess    r   <lambda>z)_computeincrementalpack.<locals>.<lambda>w  s    58 r   )r   keyNc              3   (   K   | ]}|         V  d S rT   r   )ra   nr   s     r   rc   z*_computeincrementalpack.<locals>.<genexpr>~  s'      33!U1X333333r   r   r   )
rf   sortedr%   ranger   rn   	enumerater   sumpop)rg   r   limitsgenerationsir   r   rq   sizelimitgenpackschosenpacks
repacksizer   s                @r   r   r   L  si    @@4+?@@@$OOO F MM! K3v;;  2E# 	 	d|$+,,,f!&)) 	 	HAue||A%%f---  Hf%%  5{1~&6!777OO{1~t9K9K9K9KLLL   E 8 233-K}H3333{33333JT,--- 	.t$56668<<>>***eKO,,
 	T,--- 	.t$5666
 r   c           
         t          j        | j        |           d }| j                            dd          }|s|}t	          | |||||||          }	t          j        | j        |          5 }
t          j        | j        |          5 }	 |		                    |
|           n/# t          j        $ r t          t          d                    w xY w	 d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nc                    |                      ||          }| |                                                                         }| 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  sp     ,,x,55))*//11g 0*==	c!{U""r   r   s   gcrepack)gcr   r7   s3   skipping repack - another repack is already running)r   r   r&   r(   repackerr   mutabledatapackr   mutablehistorypackrunr   LockHeldr   r   )r,   datahistoryrE   r   r   r7   r   garbagecollectpackerdpackhpacks               r   r?   r?     s     (333
# 
# 
# W''(8+FFN 	 	 	F 
	!$'8	4	4 
+DGX>> 		%

5%((((>   *.    )		 		 		 		 		 		 		 		 		 		 		 		 		 		 		
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sN   .C6	CB"!C",CCC6C"	"C6%C"	&C66C:=C:c           	         |st                      }n|}g d}| j                            ddd          }|r|                    d|z             | j                            ddd          }|r|                    d|z             d                    |          }d|z  g}t          j        | |          }t                      }d}t          |j                  D ]{}	| |	         	                                
                                |v r-| |	                                                                         }
nJ|r.| |	                                                             |          }
n| |	                                         }
| |	                                         }|                    |	           t!          |
          t"          u rU|
                                D ]>\  }}|d	         d	         +|                     |||d	         d	                              ?B|
                                D ]$\  }}|                     |||                     %}|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    sU      55 322D7>>"2OTJJL ,Gl*+++7>>"24EtLLL ,Gl*+++99T??D!D()DD$''DIL dj!! 8 87::<<** Q##%%//11AA  'G$$&&++L99G$$&&Aw''))a 77d?? #$'')) > >$71:)LLxa!<!<===>
 '(ggii 8 8"(UU8X6677778 Or   c                   >    e Zd ZdZ	 	 	 d
dZd Zd Zd Zd Zd	 Z	dS )r   z^Class for orchestrating the repack of data and history information into a
    new format.
    FNc	                     || _         || _        || _        || _        t	          j        |          | _        || _        || _        | j        r0|st          d          t          |d           | _        || _        d S d S )Ns*   Function 'isold' is not properly specifiedc                 
    | |fS rT   r   )r   r   s     r   r   z#repacker.__init__.<locals>.<lambda>  s
    1v r   )r,   r   r   r   r   getunitsunitr   r7   
ValueErrorr  r   r   )	selfr,   r   r   r   r   r   r   r7   s	            r   __init__zrepacker.__init__  s     		&&x00	  	 P !NOOO#D*=*=>>DMDJJJ	 	r   c                    t                      }t          j        t          | j                  dd d          5  | j                            d           | j                            || j                   | j	                            || j                   | 
                    ||           |                     ||           |j        D ]}|                    |           	 d d d            d S # 1 swxY w Y   d S )Ns
   repacklockr   )desctimeouts	   prerepackr6   )repackledgerlockmodr   repacklockvfsr,   hookr   
markledgerr7   r   
repackdatarepackhistorysourcescleanup)r  
targetdatatargethistoryledgersources        r   r   zrepacker.run  sD   \$)$$m$
 
 
 	' 	' INN<((( I   >>>L##FDL#AAA OOFJ///v}555 !. ' 'v&&&&'	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	's   B(C//C36C3c                     s|S d
 fd	}t                    t          t          |d                    |j        r7|                    dd                    d D                       fz             t                    D ]>\  }}|dk    r j        j        df||<   |dz
           }	|	||	         d         dz   f||<   ?fd	|D             }|z  }|S )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                             |           }t          j        |v r|t          j                 S |S rT   )r   getmetar   METAKEYSIZE)r   defaultmetar   r  s      r   getsizez'repacker._chainorphans.<locals>.getsize2  s;    9$$Xt44D$,,I122r   T)r   r   s   %s: orphan chain: %s
s   , c                 ,    g | ]}t          |          S r   r   r   s     r   rz   z*repacker._chainorphans.<locals>.<listcomp>A  s    (C(C(Caq(C(C(Cr   r   c                     g | ]}|v|	S r   r   )ra   r   orphanss     r   rz   z*repacker._chainorphans.<locals>.<listcomp>K  s#    666qQg%5%5%5%5%5r   rv   )r   rf   	debugflagr|   r`   r   r,   nullid)
r  r&   r   nodesr*  
deltabasesr'  r   r   parents
   ` ` `     r   _chainorphanszrepacker._chainorphans&  sA     	L	 	 	 	 	 	 	 //vg7DAAABB< 	HH)UZZ(C(C7(C(C(CDDEF   !)) 	G 	GGAtAvv$(I$4a#8
4   Q$*Jv,>q,AA,E#F
4  6666E666r   c           	        ' | j         j        }|                    ddd          }i }|j                                        D ],}|j        r#||                    |j        i           |j        <   -d}|	                    t          d          | j        t          |                    }t          |                                          D ]\  }	}
|                    |           i }t!          d |
D                       'g }|	                    t          d          d	t          '                    }t#          '          D ]u\  }}||v r
|                    |           	 |                    | j                            |	||
                     Q# t(          $ r |                    |           Y rw xY w|                                 t!          t/          |                     |                              }t          |          dk    r%|                    dt          |          z             |                    t          |                     t!          t7          'fd|                    }| j        rSg }|D ]L}|	|f| j        vr*|                     | j         |	|          rd|
|         _        7|                    |           M|}i }tA                      }tA                      }tA          '          '|	                    t          d          d	t          |                    }t#          |          D ]\  }}|                    |           |!                    |d           }|5| j         j"        d}}| j         j"        df||<   |#                    |           n|\  }}|#                    |           |!                    |          }|rO|\  }}}}|r| j         j"        }||k     r4|| j         j"        k    r
||dz   f||<   || j         j"        k    r
||dz   f||<   |$                    dd          r||z
  }| %                    ||	|||          }t#          |          D ]S\  }}||         \  }}|| j         j"        k    r| j&        '                    |	|          }|\  } }!}"}#|#!                    tP          j)                  }$|!|	k    s|"|k    s|$Z| j&        !                    |	|          }%| j&        !                    |	|          }&t          |&          }$tU          j+        |%|&          } nE| j&        !                    |	|          } t          |           }$| j&        ,                    |	|          }#tP          j)        |#vr|$|#tP          j)        <   |#                    |	||| |#           d|
|         _-        U|                                 |dz  }|                                 |.                    |           d S )Nrl   s   maxchainleni  r   s   repacking datar  totalc              3      K   | ]}|V  d S rT   r   ra   r   s     r   rc   z&repacker.repackdata.<locals>.<genexpr>`  "      22$222222r   s   building historys   nodesknowns%   repackdata: %d nodes without history
c                     | v S rT   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valuesrC   
setdefaultr   r   makeprogressr   r  r   r   r   updaterf   r   r   getancestorsKeyErrorr%   completer   	_toposortr|   r   filterr   r   r   gcedr   getr,  r   r(   r0  r   getdeltar   r$  r	   textdiffr#  datarepackedclose)(r  r  targetr&   maxchainlenbyfileentrycountrepackprogressr   r;  	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   Y\ll8^TBB^**,, 	J 	JE JDI!!%."55ejA  tyF ) 
 
 "(!7!7 J	 J	Hg!!%(((I22'22222EIOO%&&XSZZ ,  M %U++ + +49$$$$Q'''
+$$(55$d) 6     
   + + + $$T*****	+
 ""$$$  	)B)B C CDDL9~~!!=IN   y 1 1222  1111<@@ L
 " /"$( 1 1D !$'t}<<	8TB B< .2* #**40000. JUUFJJJE oo%&&XS=N=N .  O %\22 "B "B4&&q))) (^^D$77
%*.)*:AxI(,	(8!'<Jt$JJt$$$$*4'IxNN9---  )}}T22 B1=.BHh
   .!Y-+-- !111.2HqL-AJrN!111.2HqL-AJrN }}Y(=>>  :-#11,   
 %\22 2 24&0&6#	8
 	 000!%!3!3Hd!C!CJ@J=E=-88I$9::D%11(I55<(,	h	(J(J#'9==4#@#@"8}} %}h G G IMM(D99Eu::D9,,Xt<<D (4426D./

8T9eTBBB-1**$$&&&QJEE!!!F#####s    0FF32F3c           
      N   | j         j        }i }|j                                        D ],}|j        r#||                    |j        i           |j        <   -|                    t          d          | j
        t          |                    }t          |                                          D ]L\  }}i }	t          d |D                       }
|
D ]7}||	v r|	                    | j                            |||	                     8t%          |                     |	                    }t)                      }|D ]}|	|         \  }}}}||v rU||vrQ|| j         j        k    r||k    r|                    |           || j         j        k    r|                    |           h|r|                    |           |                    ||||||           ||v rd||         _        |                                 N|                                 |                    |           d S )Ns   repacking historyr2  c              3      K   | ]}|V  d S rT   r   r5  s     r   rc   z)repacker.repackhistory.<locals>.<genexpr>  r6  r   r7  Tr:  )r,   r&   r;  r<  rD   r=  r   r   r>  r   r  r   r   r   rf   r?  r   r@  r   rC  r   r,  r   historyrepacked	incrementrB  rJ  )r  r  rK  r&   rM  rN  progressr   r;  rQ  r-  r   rT  dontprocessr   r]  r^  r_  s                     r   r  zrepacker.repackhistory  sc   Y\^**,, 	J 	JE" JDI!!%."55ejA??"##$)3v;; # 
 
 "(!7!7 ,	! ,	!HgI22'22222E  9$$  L--hI-NN   
 $DNN9$=$=>>L %%K$ 9 9-6t_*B( ;&&4w+>+> TY---(h2F2F#+++TY---#+++ (OOB'''

8T2r8XFFF7??48GDM1    F#####r   c                 d      fd}t          j                                        |          }|S )Nc                     |          \  }}}}g }|j         j        k    r|                    |           |j         j        k    r|                    |           |S rT   )r,   r,  r%   )r   r   r]  r^  r_  parentsrQ  r  s         r   
parentfuncz&repacker._toposort.<locals>.parentfunc(  sc    )24&BHhGTY%%%r"""TY%%%r"""Nr   )r   	sortnodeskeys)r  rQ  ro  sortednodess   ``  r   rC  zrepacker._toposort'  sF    	 	 	 	 	 	 "+INN,<,<jIIr   )FNN)
r   r   r   __doc__r  r   r0  r  r  rC  r   r   r   r   r     s             2' ' '(' ' 'RZ$ Z$ Z$x:$ :$ :$x    r   r   c                   0    e Zd ZdZd Zd Zd Zd Zd ZdS )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                 H    i | _         i | _        t                      | _        d S rT   )r;  r  r   created)r  s    r   r  zrepackledger.__init__;  s    uur   c                     |                      ||          }d|_        | j                            |          }|st	                      }|| j        |<   |                    |           dS )z`Mark the given filename+node revision as having a data rev in the
        given source.
        TN)_getorcreateentryrC   r  rF  r   r   r  r   r   r   rN  r;  s         r   markdataentryzrepackledger.markdataentry@  sk     &&x66,""6** 	+eeG#*DL Er   c                     |                      ||          }d|_        | j                            |          }|st	                      }|| j        |<   |                    |           dS )zcMark the given filename+node revision as having a history rev in the
        given source.
        TN)rx  rD   r  rF  r   r   ry  s         r   markhistoryentryzrepackledger.markhistoryentryL  sk     &&x66",""6** 	+eeG#*DL Er   c                 z    ||f}| j                             |          }|st          ||          }|| j         |<   |S rT   )r;  rF  repackentry)r  r   r   r   values        r   rx  zrepackledger._getorcreateentryX  sI      %% 	&$//E %DLr   c                 :    | j                             |           d S rT   )rv  r   )r  r  s     r   
addcreatedzrepackledger.addcreateda  s    r   N)	r   r   r   rs  r  rz  r|  rx  r  r   r   r   r  r  5  si         
  

 
 

 
 
           r   r  c                       e Zd ZdZdZd ZdS )r~  zFSimple class representing a single revision entry in the repackledger.r   r   rC   rD   rI  rh  rE  c                 h    || _         || _        d| _        d| _        d| _        d| _        d| _        d S )NFr  )r  r   r   s      r   r  zrepackentry.__init__r  s:     	"!$			r   N)r   r   r   rs  	__slots__r  r   r   r   r~  r~  e  s0        PPI    r   r~  c                     t          j        | d          r3t          j        | t          j                  }t          j        |          S | j        S )Nname)r   r9   r   r=   r   r>   r   rX   )r,   sharedcachepaths     r   r  r    sM    f%%  &6)-
 
 w'''yr   )TFrT   )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   r2   rN   rR   rA   rj   r   rQ   r   r   r   r   r?   r  r   r  r~  r  r   r   r   <module>r     s   				                   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 % $ $ $ $ $                
	(	#	#	 	 	 	 	5; 	 	 	N N N N"5
 5
 5
 5
p)
 )
 )
 )
X  &  O O OL ; ; ; ;|4 4 4*4 4 42  "; ; ;~ HL) ) ) )X; ; ; ;|~ ~ ~ ~ ~ ~ ~ ~B
-  -  -  -  -  -  -  - `       8	 	 	 	 	r   