
    6h/                    \   % S SK Jr  S SKrS SKJr  S SKJr  S SKJrJ	r	J
r
JrJrJrJrJrJr  SSKJrJ
rJr  0 r\R0                  " \5      r\R2                  4S jrS	S
S\" S5      \" S5      4SSS\" S5      4SSS\" S5      4SSS\" S5      4SSS\" S5      4SSS\" S5      4SSS\" S5      4S S!S\" S"5      4S#S$S\" S%5      4S#S&S\" S'5      4S#S(S\" S)5      4S#S*S\" S+5      4S#S,S\" S-5      4/\R6                  -   \R8                  -   \R:                  -   \" S.5      S/S0.rS1 r\ " 5       r!\S2   \RD                  -    V s1 s H  n U S   RG                  S3S45      iM     sn r$S5\%S6'   S7 r&S8 r'S9 r(\" S:S	S
S#\" S;5      \" S5      4/\R8                  -   \" S<5      5      S= 5       r)gs  sn f )>    )annotationsN)Set)_)	commandsencodingerror
extensions
logcmdutilpatchpycompat	registrarscmutil   )contextr   	formatterc              #  d  ^ ^^#    T R                   R                  SS5      nU(       Ga  [        R                  R	                  T R                  5      n[        R                  R                  [        R                  " 5       U5      nUS:X  a  Sn[        U4S j[        R                   5       5      (       a  SnOrU Vs/ s HH  n[        R                  R                  U5      (       a  [        R                  R                  X5      OUPMJ     n	n[        UU 4S jU	 5       5      (       a  SnU(       a,  W	 H%  n[        R                  R                  WU5      v   M'     g
S n
[        R                  " T U5      n[        R                   " XTU
S	9nUR#                  U5       H  nUv   M	     g
s  snf 7f)z&generate paths matching given patterns   fastannotates   perfhack   .    c              3  L   >#    U  H  nTR                  US    5      v   M     g7f)r   Nget).0ooptss     =/usr/lib/python3/dist-packages/hgext/fastannotate/commands.py	<genexpr>_matchpaths.<locals>.<genexpr>4   s!     9'8!txx!~~'8s   !$Fc              3     >#    U  HU  nS U;   =(       dD    [         R                  R                  [        R                  " TUT5      R
                  5      (       + v   MW     g7f)s   ..N)ospathisfile	facontext
pathhelperlinelogpath)r   faoptsrepos     r   r   r   <   sW       !A QJ 77>>!,,T1e<HH 
 !s   AA c                6    [         R                  " SX4-  5      e)Ns   %s: %s)r   Abort)xys     r   bad_matchpaths.<locals>.badN   s    ++i1&011r   )badfnN)ui
configboolr    r!   dirnamerelpathr   getcwdanyr   walkoptsisabsjoinr
   	revsingler   matchwalk)r(   revpatsr   r'   perfhackreporootreldirprelpatsr-   ctxms   `  ``        r   _matchpathsrE   &   sP    ww!!/;?H 77??499-!2H=T>F9x'8'8999H A 13a0@0@,aG  
   !   ! A'',,vq)) 	2 ""4-MM#T5!AG 9s   B8F0=AF+B$F0   r   revr   s   annotate the specified revision   REV   u   users   list the author (long with -v)   f   files   list the filename   d   dates   list the date (short with -q)   n   numbers"   list the revision number (default)   c	   changesets   list the changeset   ls   line-numbers(   show line number at the first appearance   e   deleteds(   show deleted lines (slow) (EXPERIMENTAL)r   s
   no-contents'   do not show file content (EXPERIMENTAL)s	   no-follows   don't follow copies and renames   linearsE   enforce linear history, ignore second parent of merges (EXPERIMENTAL)s	   long-hashs'   show long changeset hash (EXPERIMENTAL)   rebuilds.   rebuild cache even if it exists (EXPERIMENTAL)s3   [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...T)optionssynopsis	inferrepoc           	     
  ^ U(       d  [         R                  " [        S5      5      eU R                  SS5      (       a  UR	                  5       n[
        R                  " T5      mTR                  SS5      nTR                  SS5      n[        R                  " U TSS	S
9n[        R                  " UTR                  SS5      (       + TR                  SS5      (       + S9n[        U4S jS 5       5      (       d   U R                  SSS/5       H  nS	TU'   M
     U R                  S5        TR                  S5      n	U	S:X  a  [        R                   " XT5      n
O[        R"                  " XT5      n
TR                  SS5      n[%        TR                  S5      5      (       + nTR                  SS5      nU R'                  SS5      =(       d    Un[)        [+        XUTU5      5      n[-        US5      (       a  UR/                  U5        U H  nS=n=nn  [        R0                  " UUXu5       nUR3                  UUUU=(       a    U(       + S9nU(       a*  U Vs1 s H  nUS   US   4iM     nnUR5                  XMUS9nSSS5         U(       a  Uu  nnU
R=                  UUUS9  M     U
R?                  5         gs  snf ! , (       d  f       NF= f! [6        R8                  [6        R:                  4 a    U(       a  e S	n M  f = f)a  show changeset information by line for each file

List changes in files, showing the revision id responsible for each line.

This command is useful for discovering when a change was made and by whom.

By default this command prints revision numbers. If you include --file,
--user, or --date, the revision number is suppressed unless you also
include --number. The default format can also be customized by setting
fastannotate.defaultformat.

Returns 0 on success.

.. container:: verbose

    This command uses an implementation different from the vanilla annotate
    command, which may produce slightly different (while still reasonable)
    outputs for some cases.

    Unlike the vanilla anootate, fastannotate follows rename regardless of
    the existence of --file.

    For the best performance when running on a full repo, use -c, -l,
    avoid -u, -d, -n. Use --linear and --no-content to make it even faster.

    For the best performance when running on a shallow (remotefilelog)
    repo, avoid --linear, --no-follow, or any diff options. As the server
    won't be able to populate annotate cache when non-default options
    affecting results are used.
s,   at least one filename or pattern is requiredr      unfilteredreporG   r   rW   F   annotateT)section
whitespacerV   s	   no_follow)diffoptsfollowmergefollowrenamec              3  F   >#    U  H  nTR                  U5      v   M     g 7f)Nr   )r   sr   s     r   r   fastannotate.<locals>.<genexpr>   s"      EA 	Es   !)rJ   rN   rL   rP   rR   s   defaultformatrP   s   templates   jsonrU   s
   no_contentrL   
   mainbranchprefetchfastannotateN)mastershowpath	showlinesr   r   )ri   rj   )existinglines) r   r*   r   r1   
unfilteredr   byteskwargsr   r   difffeatureoptsr#   annotateoptsr5   
configlistpagerfaformatterjsonformatterdefaultformatterboolconfiglistrE   hasattrrg   annotatecontextannotateannotatealllinesfaerrorCannotReuseErrorCorruptedFileErrorwriteend)r0   r(   r=   r   r<   rebuildr`   r'   nametemplater   showdeletedrj   ri   rh   pathsr!   resultlinesrk   als      `                  r   fastannotater      s   > kk!KLMM 
}}_&788 %D
((64
 Chhz5)G$$
D+$H ""E22,66E  E   MM-	{
D DJ

 HH_xx$H7--b=	004@	((:u-K-011Ixx'H YY6=#F TdE:;E t+,,!!%()---..tT5JaZZ%!)#,#@[	 ( F #?E(Fv!!A$!v(F!"!3!3i "4 " K  "MFE]C; < MMO% )G KJ ,,g.H.HI  "Gs<   K-,J?J:-J??K:J??
K		K.LLrX      -   _z
Set[bytes]
_knownoptsc           
     `   UR                  SS5      (       a  UR                  5       nUR                  SS5      (       a  SUS'   UR                  S5      n[        US5      (       a>  Ub;  [	        [        X%U[        R                  " U5      5      5      nUR                  U5        U " X/UQ70 UD6$ )zused by wrapdefaultr   r\   s	   forcetextTtextr<   rg   )	r1   rl   r   rx   rw   rE   r   rm   rg   )origr0   r(   r=   r   r<   r   s          r   _annotatewrapperr     s     
}}_&788  
}}_l33V ((5/Ct+,,[D(2F2Ft2LMN!!%((4(4((r   c                 @    Sn [        U 4SS0[        D6" [        5        g)z!register the fastannotate commands   fastannotate|fastblame|fa	helpbasicTN)commandfastannotatecommandargsr   )r   s    r   registercommandr     s    'DD<D<$;<\Jr   c                 X    [         R                  " [        R                  S[        5        g)z>wrap the default annotate command, to be aware of the protocolr]   N)r	   wrapcommandr   tabler    r   r   wrapdefaultr   $  s    8>>;8HIr   s   debugbuildannotatecaches!   build up to the specific revisions   [-r REV] FILE...c           	        [         R                  " U5      nUR                  S5      =(       d    U R                  SS5      nU(       d'  [        R
                  " [        S5      [        S5      S9eU R                  SS5      (       a  UR                  5       n[        R                  " X5      n[        R                  " XRU5      n[        UR                  U5      5      n[        US5      (       aG  UR                  S5      (       a  [        R
                  " [        S	5      5      eUR!                  U5        gU R#                  [        S
5      [%        U5      S9n['        U5       Hh  u  pUR)                  U	5        [*        R,                  " X5       n UR/                  U5      (       a   SSS5        MO  UR1                  XD5        SSS5        Mj     URA                  5         g! [2        R4                  [2        R6                  4 ao    U R9                  SU
-  5        UR;                  5          UR1                  XD5         Ny! [<         a)  nU R?                  [        S5      X4-  5         SnA NSnAff = ff = f! , (       d  f       GM#  = f)ay  incrementally build fastannotate cache up to REV for specified files

If REV is not specified, use the config 'fastannotate.mainbranch'.

If fastannotate.client is True, download the annotate cache from the
server. Otherwise, build the annotate cache locally.

The annotate cache will be built using the default diff and follow
options and lives in '.hg/fastannotate/default'.
rH   r   rf   s   you need to provide a revisions(   set fastannotate.mainbranch or use --rev)hintr\   rg   s   --rev cannot be used for clients   building)totalNs*   fastannotate: %s: rebuilding broken cache
s,   fastannotate: %s: failed to build cache: %r
)!r   rm   r   rv   r   r*   r   r1   rl   r
   r9   r   r:   rw   r;   rx   rg   makeprogresslen	enumerateupdater#   ry   
isuptodaterz   r|   r}   r~   debugr   	Exceptionwarncomplete)r0   r(   r=   r   r<   rC   rD   r   progressir!   actxexs                r   debugbuildannotatecacher   )  s   " %D
((6

GbiiGCkk/0>?
 	
 
}}_&788 


t
)Cc&A!Et+,,88F++a BCDD!!%( ??1[>U?D 'GAOOA**46$s++  76 MM#+	 76 (4 	'  00'2L2LM  HHFM LLNc/$ 	 !5  $j	) 	 76sU   I5G1GAI2(H;9I5;
I.	I)	#I2'I5)I.	.I22I55
J	)*
__future__r   r    typingr   mercurial.i18nr   	mercurialr   r   r   r	   r
   r   r   r   r    r   r#   r|   r   rr   cmdtabler   defaultoptsrE   
diffwsoptsr6   formatteroptsr   r   set_newopts
globaloptsreplacer   __annotations__r   r   r   r   )opts   0r   <module>r      s   # 	 
 
 
  


H
% .7-B-B .f 
vtQABAfIN	wa ABC	wa 456	wa @AB	y$"G HI	|T1%:#;<9:		
 9:		
 89		
 
lD!$F"GH,		
 89		
 ?@		
S/` a0b c1d e2f HIk6 rqh 5 (	2X5H5HHH FNN4H
J )&KJ
 	
FC?@!F)LM	99Us   F)