
    6h_                   ^   S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
r
S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SKrS SKrSSKJr  SSKJrJrJrJr  SSKJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r1J2r2J3r3J4r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r=J>r>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrFJGrGJHrHJIrIJJrJJKrKJLrMJNrNJOrOJPrPJQrRJSrSJTrTJUrVJWrWJXrX  SSKYJZrZ  SSK[J\r\  SS	K]J^r^J_r_J`r`JaraJbrbJcrc  SS
KdJerfJgrgJhrhJiri  \1R                  rj0 rk\kR                  \KR                  R                  5        \>R                  " \k5      rm\m" S/ \" S5      SS9S 5       ro\m" S/ 5      S 5       rp\m" S/ S5      S 5       rq\m" S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"5      5           GSS$ j5       rrGSS% jrsGSS& jrtGSS' jruS( rvGSS) jrw\m" S*S+S,S\" S-5      4SS./ \" S/5      4SS0S\" S15      4/\" S5      SS29GSS3 j5       rx\m" S4/ \" S55      SS29S6 5       ry\m" S7S8/S95      S: 5       rz\m" S;/ S5      S< 5       r{\m" S=SS>S\" S?5      4/S@5      SA 5       r|SB r}SC r~\m" SD/ S5      SE 5       r\m" SFSGSHS\" SI5      4SJSKS\" SL5      4SSMS\" SN5      4SOSPS\" SQ5      4/\" SR5      SS9GSSS j5       r\m" ST\GR                  \" SU5      5      GSSV j5       r\m" SWSXSYS\" SZ5      4/\" S[5      SSS\9GSS] j5       r\m" S^S_S`/ \" Sa5      4SSbS#\" Sc5      4SSdS\" Se5      4SSfS\" Sg5      4SShS\" Si5      4/\GR                  -   \GR                  -   \" Sj5      SS9GSSk j5       r\m" Sl\GR                  \GR                  -   SSmSn\" So5      4/-   \" SU5      SS9GSSp j5       r\m" SqSSrS\" Ss5      4SStS\" Su5      4SSvS\" Sw5      4SSxS#\" Sy5      4SS,S#\" Sz5      4/\" S{5      5      S| 5       r\m" S}/ \" S5      5      S~ 5       r\m" SSSS\" S5      4SSS\" S5      4SS`/ S4SSS/\GR                  -   \GR                  -   \" S5      5      GSS j5       rSr\m" SSSS\" S5      4/SS9GSS j5       r\m" S\GR                  / SS9S 5       r\m" SS_S`S\" S5      \" S95      4SSS#\" S5      4SOSS\" S5      4SS/ \" S5      \" S5      4/\" S5      5      S 5       r\m" SSSS\" S5      \" S5      4SSS\" S5      \" S5      4SSS#\" S5      4/\GR                  -   5      S 5       r\m" S/ \GR                  -   S5      S 5       r\m" S/ \" S5      SS29GSS j5       r\m" SSS/ \" S5      \" S5      4SS/ \" S5      \" S5      4SGSS\" S5      \" S5      4/\" S5      SS29GSS j5       r\m" S/ S5      S 5       r\m" S\GR                  \GR                  -   \" Sj5      5      GSS j5       r\m" S\GR                  \" Sj5      SS9GSS j5       r\m" S/ 5      S 5       r\m" S/ \GR                  -   SSS29S 5       r\m" S/ \" S5      SS29S 5       r\m" S/ \" S5      5      S 5       r\m" SSSS\" S5      4SSS\" S5      4SOSS\" S5      4SSS\" S5      4/\" S{5      5      S 5       r\m" SSSS#\" S5      4S+S/ \" S5      \" S5      4/S5      GSS j5       r\m" S/ \GR:                  -   S5      S 5       r\m" S/ \" S5      5      S 5       r\m" S\GR                  SSS#\" S5      4SSS#\" S5      4SSS#\" S5      4SSS#\" S5      4/-   \" Sj5      5      GSS j5       r\m" SSSS \" S5      4SSS#\" S5      4S_S`/ \" S5      4SSS#\" S5      4SSS#\" S5      4SS/ \" S5      4/\GRB                  -   \GR                  -   \" S5      5      GSS j5       r\m" SS_S`S\" S5      \" S95      4/\" S5      5      S 5       r\m" SS_S`S\" S5      \" S95      4/\" S5      5      GS  5       r\m" GSGSSnS\" GS5      4SGSS\" GS5      4S+GSS\" GS5      4S_GSS\" GS	5      4/\" GS
5      5      GS 5       r\m" GS\GRL                  GSSGS9GS 5       r\m" GS/ \" S55      SS29GS 5       r\m" GSS_S`S\" GS5      \" S95      4SGSS\" GS5      4/\GRL                  -   \GRR                  -   \" GS5      SGS9GS 5       r\m" GS/ \" GS5      SS29GS 5       r\m" GS/ \" GS5      5      GSGS j5       r\m" GSS_S`S\" GS5      \" S95      4SGS S\" GS!5      4/\" S5      5      GS" 5       r\m" GS#SGS$S#\" GS%5      4/S5      GS& 5       r\m" GS'S_S`S\" S5      \" S95      4/\" GS(5      5      GS) 5       r\m" GS*/ S5      GS+ 5       r\m" GS,\GR                  GS-GS.S#\" GS/5      4/-   \" Sj5      SS9GSGS0 j5       r\m" GS1\GR                  GSGS2S \" GS35      \" GS45      4/-   \" GS55      SS9GSGS6 j5       r\m" GS7SGS8S\" GS95      4SGS:S\" GS;5      4SOGS<S\" GS=5      4SS/ \" S5      \" S5      4SGS>S#\" GS?5      4SGS@S#\" GSA5      4/GSB5      GSC 5       r\m" GSDSGSES#\" GSF5      4SGSGS\" GSH5      4SGSIS\" GSJ5      4/S5      GSK 5       r\m" GSL/ \" GSM5      5      GSGSN j5       r\m" GSO\GR                  \" SU5      5      GSGSP j5       r\m" GSQ/ GSRSS9GSGSS j5       r\m" GSTGSUGSVGSW\" GSX5      \" GSY5      4/S95      GSZ 5       r\m" GS[GSUGSVGS\\" GSX5      \" GSY5      4SOGS]S#\" GS^5      4/S95      GS_ 5       r\m" GS`GSa/\GRt                  -   \" GSb5      5      GSc 5       r\m" GSdS_S`S\" GSe5      \" S95      4/\" GSf5      5      GSGSg j5       r\m" GShGSiGSjS\" GSk5      \" GSl5      4/\" GSm5      SS9GSn 5       r\m" GSoGSiGSpS\" GSq5      4SGSrS\" GSs5      4GSGStS\" GSu5      4/\GR                  -   5      GSv 5       r\m" GSwSGSxS#\" GSy5      4/\" GSz5      5      GS{ 5       r\m" GS|/ 5      GS} 5       r\m" GS~S_S`/ \" GS5      \" S95      4GSGS/ \" GS5      \" GS5      4/\" GS5      SS9GS 5       r\m" GSSGSS\" GS5      \" GS5      4/\" GS5      SS29GSGS j5       r\m" GSSGSS\" GS5      \" GS5      4/\" GS5      SS29GSGS j5       r\m" GS/ 5      GS 5       r\m" GSSGS8/ \" GS5      \" S5      4SGSS#\" GS5      4SGSS\" GS5      4SGSpS\" GS5      4SGSrS\" GS5      4SGStS\" GS5      4/5      GSGS j5       r\m" GS/ \" GS5      \mGR                  GS9GS 5       r\m" GS\GRL                  \" GS5      SGS9GS 5       r\m" GS/ \" S95      5      GS 5       r\m" GS/ GSQ\GR                  -   \" GS5      SS29GS 5       rGS r\m" GSSGSS#\" GS5      4SGSS\" GS5      4SGSS#\" GS5      4SGSS#\" GS5      4/\GR                  -   \" S5      SS9GSGS j5       rg(      )annotationsN   )_)binhexnullrevshort)8bundle2
bundlerepochangegroupcmdutilcolorcontextcopies	dagparserdirstateutilsencodingerrorexchange
extensionsfilelog	filemergefilesetlang	formatterhghttppeer	localrepolock
logcmdutilmanifest
mergestatemetadataobsoleteobsutilpathutilphasespolicypvecpycompat	registrarrepairrepoviewrequirementsrevlogrevset
revsetlangscmutilsetdiscoverysimplemergesshpeersslutilstreamclonestriptags	templatertreediscoveryupgradeurlutilverifyvfswireprotoframingwireprotoserver)
repository)stabletailsort)cborutilcompressiondateutilprocutil
stringutilurlutil)debugnodemaprewritesidedatas   debugancestors   [INDEX] REV1 REV2T)optionalrepoc                :   [        U5      S:X  aO  Uu  p4n[        R                  " [        R                  " [        R
                  " 5       SS9U5      nUR                  nOq[        U5      S:X  aC  U(       d  [        R                  " [        S5      5      eUu  pEUR                  nUR                  nO[        R                  " [        S5      5      eUR                  U" U5      U" U5      5      nU R                  SUR                  U5      [        U5      4-  5        g)	z<find the ancestor revision of two revisions in a given index   Faudit   5   there is no Mercurial repository here (.hg not found)s&   either two or three arguments requireds   %d:%s
N)lenr.   vfsmodr?   r   getcwdlookupr   Abortr   	changelogancestorwriterevr   )	uirepoargsindexrev1rev2rrX   as	            9/usr/lib/python3/dist-packages/mercurial/debugcommands.pydebugancestorrg   w   s     4yA~ TMM&**X__%6eDeL	Ta++JK  
NNkk!EFGG	

6$<.AHHZ1558SV,,-    s   debugantivirusrunningc                D   UR                   R                  SS5       nUR                  [        R                  " S5      5        SSS5        [
        R                  " S5        [        R                  " UR                   R                  S5      5        g! , (       d  f       NT= f)z?attempt to trigger an antivirus scanner to see if one is actives   eicar-test-file.coms   wbsU   ST#=}P$fV?P+K%yP+C|uG$>GBDK|qyDK~v2MM*<JQY}+dK~6+LQba95PE<)&Nm5l)EmTEQR4qnHOhq9iNGnJxNrS   )	cachevfsopenr\   r=   	b85decodetimesleepunlinkjoin)r^   r_   fs      rf   debugantivirusrunningrr      so     
		2E	:a	NN1	
 
; 	JJqMKK""#9:; 
;	:s   &B
Bs   debugapplystreamclonebundles   FILEc                    [         R                  " X5      n[        R                  " XU5      nUR	                  U5        g)z apply a stream clone bundle fileN)r   openpathr   
readbundleapply)r^   r_   fnamerq   gens        rf   debugapplystreamclonebundlery      s/     	BA


bU
+CIIdOrh      debugbuilddag   ms   mergeable-files!   add single file mergeable changes   os   overwritten-files"   add single file all revs overwrite   ns   new-files   add new file at each revrh   s   from-existings$   continue from a non-empty repositorys   [OPTION]... [TEXT]Fc                
  ^'^( Uc4  U R                  [        S5      5        U R                  R                  5       nUR                  n[        U5      S:  a&  U(       d  [        R                  " [        S5      5      eSn[        R                  " U5       H  u  pU	S:X  d  M  US-  nM     U(       a4  Sn[        SX-  5       Vs/ s H  nSU-  PM
     nnUR                  S	5        / nU R                  [        S
5      [        S5      US9nU R                  SS5      nU   UR                  5          UR                  5          UR!                  S5         SnSn/ nSnUR#                  U5        [        R                  " U5       GH  u  pU	S:X  Ga  U R%                  S[&        R(                  " U
5      -  5        U
u  nn/ n0 m'SnU(       Ga
  Sm(UUS      n[        U5      S:  a  UUS      nUR+                  U5      nU(4S jUUU4 5       u  nnn[,        R.                  " UUUUS9n[,        R0                  " U5      S    Vs/ s H  nUR3                  5       PM     nnUR                  S	5        O+US:  a#  UT(   R5                  5       R7                  S5      nOWnUUW-  ==   SU-  -  ss'   SR9                  U5      n UR                  T(5        U T'T('   U(       a  Sm(UR                  T(5        SU-  T'T('   U(       a  SU-  m(UR                  T(5        SU-  T'T('   [        U5      S:  aW  U(       d  UUS      nU HB  m(T(R;                  S5      (       d  M  UR                  T(5        UT(   R5                  5       T'T('   MD     U'4S jn![        U5      S:X  d	  US   S:  a  SS/n"O/[        U5      S:X  a  UUS      S/n"OU V#s/ s H  n#UU#   PM
     n"n#[<        R>                  " UU"SU-  UU!US4SSU0S 9n$URA                  U$5      n%UR                  U%5        UnOtU	S!:X  aR  U
u  nn&U R%                  S"U&-  5        UR                  S#[C        UR                  RE                  U5      5      U&4-  5        OU	S$:X  a  U R%                  S%U
-  5        U
nUR#                  U5        GM      U(       a+  URF                  RI                  S&S	R9                  U5      5        SSS5        SSS5        SSS5        SSS5        gs  snf s  snf s  sn#f ! , (       d  f       N6= f! , (       d  f       N?= f! , (       d  f       NH= f! , (       d  f       g= f)'a  builds a repo with a given DAG from scratch in the current empty repo

The description of the DAG is read from stdin if not given on the
command line.

Elements:

 - "+n" is a linear run of n nodes based on the current default parent
 - "." is a single node based on the current default parent
 - "$" resets the default parent to null (implied at the start);
       otherwise the default parent is always the last node created
 - "<p" sets the default parent to the backref p
 - "*p" is a fork at parent p, which is a backref
 - "*p1/p2" is a merge of parents p1 and p2, which are backrefs
 - "/p2" is a merge of the preceding node and p2
 - ":tag" defines a local tag for the preceding node
 - "@branch" sets the named branch for subsequent nodes
 - "#...\n" is a comment up to the end of the line

Whitespace between the above elements is ignored.

A backref is either

 - a number n, which references the node curr-n, where curr is the current
   node, or
 - the name of a local tag you placed earlier using ":tag", or
 - empty to denote the default parent.

All string valued-elements are either strictly alphanumeric, or must
be enclosed in double quotes ("..."), with "\" as escape character.
Ns   reading DAG from stdin
r   s   repository is not emptyr}   r   rS   s   %drh   s   buildings	   revisions)unittotals   experimentals   relaxed-block-sync-merges   builddag   defaults   node %s
s   mfc              3  H   >#    U  H  oT   R                  5       v   M     g 7fN)data).0xfns     rf   	<genexpr> debugbuilddag.<locals>.<genexpr>  s      .2>QbEJJLL,   ")relaxed_sync   
s    r%is   ofs   r%i
s   nf%is   nfc                H   > UT;   a  [         R                  " XUTU   5      $ g r   )r   
memfilectx)r_   cxpathfilecontents      rf   fctxfndebugbuilddag.<locals>.fctxfn@  s/    {*&11 dK,=    rh      r%irz      branch)dateuserextra   ls   tag %s
   %s %s
   as
   branch %s
s	   localtags)%statusr   finreadrZ   rU   r   rY   r   parsedagrangeappendmakeprogress
configboolwlockr   transactionupdate
notenoi18nr)   bytestrr[   r3   
Merge3Textrender_minimizedr7   r   splitrp   
startswithr   memctx	commitctxr   noder?   r\   ))r^   r_   textmergeable_fileoverwritten_filenew_filefrom_existingclr   typer   linesperreviinitialmergedlinesr8   progressmerge_relaxed_syncatatbranchnodeidsidpsfilesp2p1pabaselocalotherm3lml
mergedtextr   parspr   nodeidnamer   r   s)                                          @@rf   debugbuilddagr      s   D |
		!/01vv{{}	B
2w{=kk!6788 E((.
4<QJE / 16q%:M1NO1NAeai1NO!!#&D	+Q|_E  H # 
4::<d.>.>{.K#,,T2JDt|lX-=-=d-CCDB !BbeB2w{!"Q%[[[_.35r2,.*eU )33 !!);	 &1%A%A"%Ea%H%H GGI%H   		#aV[[]007/rK'(GbL8(!&BJLL$&0KO#BLL$&.mKO 2BLL$&.mKO2w{!!%beB"$B!}}U33 %R 024R&++-B #%
  r7a<2a519 $<DW\#BqEND1D0231GAJD3^^RKa)$h/	 +v&DkD01J#dnn.A.A".E*F)MMNnt34OOBq 3t HHNN<$8C /L< PRV 4S /L.K<<s   S6T8.T'?TC/T	 S;C7T	A,T	T DT	TT'%T8;
T	
TT
T$ T''
T5	1T88
Uc           	     (  ^ ^^ SU-  mU(       aw  T R                  ST-  5        UUU 4S jnTR                  5         U" S5        TR                  5         U" S5        [        TR                  0 5       H  nUS   nU" U5        M     g [        T[        R                  5      (       a  [        R                  " [        S5      5      eTR                  5         TR                  5        H*  nUu  pppnnT R                  ST[        U	5      4-  5        M,     g )	N    s3   %sformat: id, p1, p2, cset, delta base, len(delta)
c                  > TR                  STU 4-  5        T
R                  5        H[  nUu  p#pEpgpTR                  ST[        U5      [        U5      [        U5      [        U5      [        U5      [        U5      4-  5        M]     g )Ns   
%s%s
s   %s%s %s %s %s %s %d
)r\   	deltaiterr   rU   )named	deltadatar   r   r   cs	deltabasedeltaflagsrM   rx   indent_stringr^   s             rf   
showchunks%_debugchangegroup.<locals>.showchunkso  s}    HH[M5#99: ]]_	FOC")E,%D	BBBIE
	 -rh   	   changelog   manifests   filenames   use debugbundle2 for this file   %s%s
)writenoi18nchangelogheadermanifestheaderiterfilelogheader
isinstancer
   
unbundle20r   rY   r   r   r\   r   )r^   rx   allindentoptsr   	chunkdatarw   r   r   r   r   r   r   r   r   rM   r   s   ``               @rf   _debugchangegroupr   g  s    6MM

C	

	" 	< ;c//4Ik*Eu 5 c7--..++a ABCCIBK?DbixHHY-T!;;< )rh   c                n   UR                  5       nSU-  n [        R                  " U5      u  pgSnXU[        U5      4-  nU R	                  U5        U R                  S[        R                  " U5      5      n	[        U5       HQ  n
[        R                  " SU
5      nU	R                  5         U	R                  U5        [        R                  " X5        MS     U	R                  5         g! [         R"                   a7  nSnXUR$                  [        U5      4-  nU R	                  U5         SnAgSnAff = f)/display version and markers contained in 'data'r   s   %sversion: %d (%d bytes)
   debugobsoleteNs%   %sunsupported version: %s (%d bytes)
)r   r#   _readmarkersrU   r\   r   r)   byteskwargssortedr$   marker	startitemplainr   
showmarkerendr   UnknownVersionversion)r^   partr   r   r   r   r   markersmsgfm	rawmarkermexcs                rf   _debugobsmarkersr    s    99;D6MM#006 ,gs4y00
\\*H,@,@,FGItY/ALLNHH]#r%	 )
 	  7ckk3t944
s   C) )D4=-D//D4c                    SU-  n[         R                  " U5      n[         R                   HO  nXE    HD  nU R                  U5        U R                  S[	        U5      [         R
                  U   4-  5        MF     MQ     g)r   r   r   N)r&   binarydecode	allphasesr\   r   
phasenames)r^   r   r   r   headsbyphasephaseheads          rf   _debugphaseheadsr
    si    6MM&&t,L!! 'DHH]#HHZ3t9f.?.?.F"GGH ( "rh   c                   ^  [        T [        [        R                  [        R
                  45      (       a'  SSR                  U 4S j[        T 5       5       5      -  $ [        R                  " [        T 5      5      $ )Ns   {%s}   , c              3  8   >#    U  H  nS UTU   4-  v   M     g7f)s   %s: %sN )r   kthings     rf   r   _quasirepr.<locals>.<genexpr>  s     H-QyAuQx=0-s   )r   dictr=   sortdictcollectionsOrderedDictrp   r   r)   r   repr)r  s   `rf   
_quasireprr    s[    %${/F/FGHHJJH&-HH
 	
 DK((rh   c                Z   [        U[        R                  5      (       d  [        R                  " [        S5      5      eU R                  S[        UR                  5      -  5        UR                  S/ 5      nUR                  5        GH  nU(       a  UR                  U;  a  M  SnU R                  XeR                  [        UR                  5      UR                  4-  5        UR                  S:X  aS  UR                  R                  SS5      n[        R                  " XuS5      nU R                  (       d  [!        X4US	S
.UD6  UR                  S:X  a  U R                  (       d  [#        X4SS	0UD6  UR                  S:X  d  GM  U R                  (       a  GM  [%        XS	S9  GM"     g)zlists the contents of a bundle2s   not a bundle2 files   Stream params: %s
	part_types   %s -- %s (mandatory: %r)
s   changegroups   versions   01s   UN   )r   r   s
   obsmarkersr   s   phase-heads)r   N)r   r
   r   r   rY   r   r   r  paramsget	iterpartsr   	mandatoryr   getunbundlerquietr   r  r
  )	r^   rx   r   r   	parttypesr   r   r   cgs	            rf   _debugbundle2r#    s8   c7--..kk!1233NN)Jszz,BBCb)I)3+
99j5t~~FF	
 99&kkooj%8G))'?B88!"Dc!DtD99%88 <!<t<99&888 !4#  rh   s   debugbundler      alls   show all detailss	   part-types   show only the named part types   specs"   print the bundlespec of the bundle)norepoc                   [         R                  " X5       nU(       a4  [        R                  " X5      nU R	                  SU-  5         SSS5        g[        R
                  " XU5      n[        U[        R                  5      (       a  [        X4SU0UD6sSSS5        $ [        X4SU0UD6  SSS5        g! , (       d  f       g= f)zlists the contents of a bundle   %s
Nr   )r   rt   r   getbundlespecr\   ru   r   r
   r   r#  r   )r^   
bundlepathr   specr   rq   rx   s          rf   debugbundler+    s     
R	$))"0DHHWt^$	 
%	$ !!"4c7--.. :c:T: 
%	$ 	"3s3d3 
%	$	$s   3B7AB7 B77
Cs   debugcapabilitiess   PATHc                8   [         R                  " U [        R                  " U5      U5      n UR	                  5       nU R                  S5        [        U5       H  nU R                  SU-  5        M     [        R                  " U5      nU(       ad  U R                  S5        [        UR                  5       5       H6  u  pxU R                  SU-  5        U H  n	U R                  SU	-  5        M     M8     UR                  5         g! UR                  5         f = f)z'lists the capabilities of a remote peers   Main capabilities:
     %s
s   Bundle2 capabilities:
s       %s
N)r   peerr)   r   capabilitiesr   r   r\   r
   bundle2capsitemsclose)
r^   r   r   r.  capscb2capskeyvaluesvs
             rf   debugcapabilitiesr9    s     772x++D148D  "
./AHHY]# $$T*NN56%flln5S)AHH[1_-    6
 	



s   CD Ds   debugchangedfiles)rh   s   computeFs6   compute information instead of reading it from storages   REVc                   [         R                  " XS5      nSnUS   (       a  [        R                  " U5      nOaUR                  R                  UR                  5       5      nUR                  [
        R                  5      nUb  [        R                  " U5      nUb  [        UR                  5       H  nXR                  ;   a  Sn	O8XR                  ;   a  Sn	O&XR                  ;   a  Sn	OXR                  ;   a  Sn	OSn	Sn
SnXR                   ;   a  S	n
UR                   U   nO XR"                  ;   a  S
n
UR"                  U   nXX4nSnU R%                  X-  5        M     gg)z,list the stored files changes for a revisionNcompute   added   removeds   mergeds   salvageds   touchedrh      p1   p2s   %-8s %2s: %s, %s;
)r   	revsingler"   compute_all_files_changesrZ   rM   r]   r  SD_FILESdecode_files_sidedatar   touchedaddedremovedmergedsalvagedcopied_from_p1copied_from_p2r\   )r^   r_   r]   r   ctxr   sdfiles_blockrq   actioncopy_parentcopy_sourcer   templates                 rf   debugchangedfilesrR    s>    

t$
/CEI2237^^$$SWWY/ffX../"2226E&AKK!mm##ll""nn$$#KK(((##2215***##22158D-HHHX_%/ ' rh   s   debugcheckstatec                    [         R                  " U5      R                  5       nU(       a!  [        S5      n[        R
                  " U5      eg)z0validate the correctness of the current dirstates4   dirstate inconsistent with current parent's manifestN)r>   verifier_verify_dirstater   r   rY   )r^   r_   errorserrstrs       rf   debugcheckstaterX  2  s=     __T"335FJKkk&!! rh   s
   debugcolors   styles   show all configured styless   hg debugcolorc                    U R                  S[        R                  " U R                  5      -  5        UR	                  S5      (       a  [        U 5      $ [        U 5      $ )z&show available color, effects or styles   color mode: %s
style)r   rH   pprint
_colormoder  _debugdisplaystyle_debugdisplaycolorr^   r_   r   s      rf   
debugcolorr`  ;  sJ     NN&):):2==)IIJxx!"%%!"%%rh   c                ~   U R                  5       n U R                  R                  5         [        R                  " U 5      R                  5        H  nXR                  U'   M     U R                  (       an  U R                  S5       HY  u  p#UR                  S5      (       a  USS  U R                  U'   M/  UR                  S5      (       d  MG  USS  U R                  U'   M[     U R                  [        S5      5        [        U R                  R                  5       S S9nU H  u  pVU R                  S	U-  US
9  M     g )Ns   colors   color.   s	   terminfo.	   s   available colors:
c                $    SU S   ;   U S   U S   4$ )N   _r   r   r  )r   s    rf   <lambda>$_debugdisplaycolor.<locals>.<lambda>V  s    dadlAaD!A$5Orh   r6  r'  label)copy_stylesclearr   _activeeffectskeys_terminfoparamsconfigitemsr   r\   r   r   r1  )r^   effectr  r8  r1  	colornamerj  s          rf   r^  r^  I  s    	BJJ&&r*//1#

6 2	NN8,DA||I&& !!"

1l++ !!"

1	 -
 HHQ%&'2::##%+OPE!	
9$E2 "rh   c                *  ^  T R                  [        S5      5        T R                  (       d  g [        S T R                   5       5      n[	        T R                  R                  5       5       H  u  p#T R                  SU-  US9  U(       as  T R                  S5        T R                  S[        SU[        U5      -
  5      -  5        T R                  SR                  U 4S	 jUR                  5        5       5      5        T R                  S
5        M     g )Ns   available style:
c              3  8   #    U  H  n[        U5      v   M     g 7fr   rU   )r   ss     rf   r   %_debugdisplaystyle.<locals>.<genexpr>_  s     +
1A
      %sri  s   : r   r   r  c              3  F   >#    U  H  nTR                  X5      v   M     g 7fr   ri  )r   er^   s     rf   r   rx  f  s     H1s   !r   )	r\   r   rl  maxr   r1  rU   rp   r   )r^   widthrj  effectss   `   rf   r]  r]  [  s    HHQ$%&::+

++E !1!1!34
e,HHUOHHTSECJ$6789HHUZZHHHI
 5rh   s   debugcreatestreamclonebundlec                6   [         R                  " U5      (       a  U R                  [        S5      5        [        R
                  " U5      u  p4[        R                  " XU5        U R                  [        S5      SR                  [        U5      5      -  5        g)ar  create a stream clone bundle file

Stream bundles are special bundles that are essentially archives of
revlog files. They are commonly used for cloning very quickly.

This command creates a "version 1" stream clone, which is deprecated in
favor of newer versions of the stream protocol. Bundles using such newer
 versions can be generated using the `hg bundle` command.
s=   (warning: stream clone bundle will contain secret revisions)
s   bundle requirements: %s
r  N)r&   	hassecretwarnr   r6   generatebundlev1r   writechunksr\   rp   r   )r^   r_   rw   r-   rx   s        rf   debugcreatestreamclonebundler  j  sx     
 	
 $44T:LBU+HHQ+,uzz&:N/OOPrh   s   debugdag   ts   tagss   use tags as labels   b   branchess   annotate with branch namess   dotss   use dots for runs   ss   spacess   separate elements by spacess   [OPTION]... [FILE [REV]...]c           
     :  ^^^^^^ UR                  S5      nUR                  S5      nU(       aa  [        R                  " [        R                  " [        R
                  " 5       SS9U5      mT Vs1 s H  n[        U5      iM     snmUU4S jnOU(       a  UR                  mUR                  S5      mUR                  S5      mT(       aY  0 mUR                  5       R                  5        H5  u  pTR                  TR                  U
5      / 5      R                  U	5        M7     UUUU4S jnO[        R                  " [        S	5      5      e[         R"                  " U" 5       US
S
UUSS9 H%  nU R%                  U5        U R%                  S5        M'     gs  snf )a  format the changelog or an index DAG as a concise textual description

If you pass a revlog index, the revlog's DAG is emitted. If you list
revision numbers, they get labeled in the output as rN.

Otherwise, the changelog DAG of the current repo is emitted.
spacesdotsFrQ   c            	   3     >#    T H=  n SU [        S TR                  U 5       5       5      44v   U T;   d  M2  SU SU -  44v   M?     g 7f)Nr}   c              3  4   #    U  H  oS :w  d  M
  Uv   M     g7fr   Nr  r   r   s     rf   r   +debugdag.<locals>.events.<locals>.<genexpr>  s     $N0B12gQQ0B   		r   r   )list
parentrevs)rd   revsrlogs    rf   eventsdebugdag.<locals>.events  sN     Q$N0B$N NOOO9FQJ// s
   1AAr8   branchesc            	   3  L  >#    Sn T H  nT(       a3  TR                  TR                  U5      5      S   S   nX :w  a  SU4v   Un SU[        S TR                  U5       5       5      44v   T(       d  Mm  TR	                  U5      nU(       d  M  U H
  nSX44v   M     M     g 7f)Nr      r   r   r}   c              3  4   #    U  H  oS :w  d  M
  Uv   M     g7fr  r  r  s     rf   r   r    s     $L0@1GQQ0@r  r   )r   r   r  r  r  )	brd   newblsr   r  r   labelsr8   s	        rf   r  r    s     A772771:.q1)<Dy"Dj( Q$La0@$L LMMM4ABr!#A"&,. "$ s   A.B$5B$B$s   need repo for changelog dagTF   )	addspaces
wraplabelswrapannotationswrapnonlinearusedotsmaxlinewidthr   N)r  r.   rV   r?   r   rW   intrZ   r8   r1  
setdefaultr]   r   r   rY   r   r   dagtextlinesr\   )r^   r_   file_r  r   r  r  rd   r  r   nliner  r   r  r  r8   s      `        @@@@@rf   debugdagr    s>   & XXhF88FD}}VZZ(9GO $%1A%	0 
^^xx88J'F		))+!!"&&)R077: ,	/ 	/  kk!:;<<&& 	
G &s   1F	   debugdatas   -c|-m|FILE REVc                2   UR                  S5      (       d,  UR                  S5      (       d  UR                  S5      (       a&  Ub  [        R                  " [        S5      5      eSUp2O"Uc  [        R                  " [        S5      5      e[        R
                  " USU[        R                  " U5      5      n U R                  UR                  UR                  U5      5      5        g! [         a#    [        R                  " [        S5      U-  5      ef = f)	z)dump the contents of a data file revisionrZ   r    dirN.   cannot specify a revision with other arguments   please specify a revisionr     invalid revision identifier %s)r  r   
InputErrorr   r   openstorager)   r   r\   rawdatarX   KeyErrorrY   )r^   r_   r  r]   r   rd   s         rf   	debugdatar    s     xx 4 4?""CD  5s	q!=>??lE8#7#7#=	AF
188C=)* Fkk!=>DEEFs   9/C) )-Ds	   debugdate   es   extendeds   try extended date formatss   [-e] DATE [RANGE])r%  rN   c                ~   US   (       a&  [         R                  " U[         R                  5      nO[         R                  " U5      nU R                  SU-  5        U R                  S[         R                  " U5      -  5        U(       a4  [         R
                  " U5      nU R                  SU" US   5      -  5        gg)zparse and display a dateextendeds   internal: %d %d
s   standard: %s
s
   match: %s
r   N)rF   	parsedateextendeddateformatsr   datestr	matchdate)r^   r   r   r   dr   s         rf   	debugdater    s     JtX%A%ABt$NN'!+,NN$x'7'7'::;u%
~!A$/0 rh      debugdeltachain   rs   revz-restrict processing to these revlog revisionss   all-infoz2compute all information unless specified otherwises	   size-infoz*compute information related to deltas sizes	   dist-infoz,compute information related to base distances   sparse-infoz*compute information related to sparse reads
   -c|-m|FILEc                   SnUR                  S/ 5      nU(       a  U Vs/ s H  n[        U5      PM     nnUR                  SS5      nUR                  SS5      nUc  UnUR                  SS5      n	U	c  Un	UR                  SS5      n
U
c  Un
[        R                  " USU[        R
                  " U5      5      nU R                  S[        R
                  " U5      5      n[        R                  " UUUU	U
S	9n[        U5      nUR                  U5        U H  nS
R                  S U 5       5      nS
R                  S U 5       5      nU Vs/ s H  nUS   PM
     nnU Vs0 s H  nUS   US   _M     nnUR                  5         UR                  " UU/UQ70 UD6  UR                  S5        M     UR                  5         gs  snf s  snf s  snf )a7  dump information about delta chains in a revlog

Output can be templatized. Available template keywords are:

:``rev``:       revision number
:``p1``:        parent 1 revision number (for reference)
:``p2``:        parent 2 revision number (for reference)

:``chainid``:   delta chain identifier (numbered by unique base)
:``chainlen``:  delta chain length to this revision

:``prevrev``:   previous revision in delta chain
:``deltatype``: role of delta / how it was computed
                - base:  a full snapshot
                - snap:  an intermediate snapshot
                - p1:    a delta against the first parent
                - p2:    a delta against the second parent
                - skip1: a delta against the same base as p1
                          (when p1 has empty delta
                - skip2: a delta against the same base as p2
                          (when p2 has empty delta
                - prev:  a delta against the previous revision
                - other: a delta against an arbitrary revision

:``compsize``:  compressed size of revision
:``uncompsize``: uncompressed size of revision
:``chainsize``: total size of compressed revisions in chain
:``chainratio``: total chain size divided by uncompressed revision size
                (new delta chains typically start at ratio 2.00)

:``lindist``:   linear distance from base revision in delta chain to end
                of this revision
:``extradist``: total size of revisions not part of this delta chain from
                base of delta chain to end of this revision; a measurement
                of how much extra data we need to read/seek across to read
                the delta chain for this revision
:``extraratio``: extradist divided by chainsize; another representation of
                how much unrelated data is needed to load this delta chain

If the repository is configured to use the sparse read, additional keywords
are available:

:``readsize``:     total size of data read from the disk for a revision
                   (sum of the sizes of all the blocks)
:``largestblock``: size of the largest block of data read from the disk
:``readdensity``:  density of useful bytes in the data read from the disk
:``srchunks``:  in how many data hunks the whole revision would be read

It is possible to select the information to be computed, this can provide a
noticeable speedup to the command in some cases.

Always computed:

- ``rev``
- ``p1``
- ``p2``
- ``chainid``
- ``chainlen``
- ``prevrev``
- ``deltatype``

Computed with --no-size-info

- ``compsize``
- ``uncompsize``
- ``chainsize``
- ``chainratio``

Computed with --no-dist-info

- ``lindist``
- ``extradist``
- ``extraratio``

Skipped with --no-sparse-info

- ``readsize``
- ``largestblock``
- ``readdensity``
- ``srchunks``

--

The sparse read can be enabled with experimental.sparse-read = True
Nr]   all_infoF	size_info	dist_infosparse_infor  )r  r  r  r  r   c              3  *   #    U  H	  oS    v   M     g7f)r   Nr  r   r|  s     rf   r   "debugdeltachain.<locals>.<genexpr>  s     .1A$   c              3  *   #    U  H	  oS    v   M     g7f)r   Nr  r  s     rf   r   r    s     /AQ4r  rP   rS   r   )popr  r   
openrevlogr)   r   r   revlog_debugdebug_delta_chainnextr   rp   r   r\   r   )r^   r_   r  r   r  revs_optrd   r  r  r  r  r.   r   linesheaderentryrj  formatr|  r7  r   s                        rf   debugdeltachainr    s   z Dxxr"H ()1A)xx
E*Hd+I	d+I	((=$/K %)=)=d)CF 
((*>*>t*D	EB**E %[FHHV		.../// %&1!A$&$)*Eq!ad
E*

0040
  FFHI *> '*s   GG
#Gs   debug-delta-find   source   fulls<   input data feed to the process (full, storage, p1, p2, prev)c                   Uc  SnUnOUnUn[        U5      n[        R                  " USU[        R                  " U5      5      nUR
                  " U5      u  pUS:X  a  [        nOPUS:X  a  UR                  " U5      nO7US:X  a  U	nO.US:X  a  U
nO%US:X  a  US-
  nO[        R                  " S	U-  5      e[        R                  " XX{S
9  g)a  display the computation to get to a valid delta for storing REV

This command will replay the process used to find the "best" delta to store
a revision and display information about all the steps used to get to that
result.

By default, the process is fed with a the full-text for the revision. This
can be controlled with the --source flag.

The revision use the revision number of the target storage (not changelog
revision number).

note: the process is initiated from a full text of the revision to store.
Nr  r  s   storager>  r?  s   prevr   s   invalid --source value: %s)base_rev)r  r   r  r)   r   r  r   deltaparentr   r  r  debug_delta_find)r^   r_   arg_1arg_2sourcer   r  r]   r.   p1rp2rr  s               rf   debugdeltafindr    s    < }
c(C %)=)=d)CF   %HC	:	%%c*	5	5	7	7<vEFF!!"cErh   s   debugdirstate|debugstates   nodatess+   do not display the saved mtime (DEPRECATED)s   datess   display the saved mtimes   datesorts   sort by saved mtimes   dockets*   display the docket (metadata file) insteads9   display dirstate-v2 tree nodes that would not exist in v1s   [OPTION]...c           	     n   UR                  S5      (       Ga  UR                  R                  (       d  [        R                  " [        S5      5      eUR                  R                  R                  n[        R                  R                  R                  UR                  5      u  nnnnnn	n
U R                  [        S5      UR                  -  5        U R                  [        S5      UR                  -  5        U R                  [        S5      U-  5        U R                  [        S5      U-  5        U R                  [        S5      U-  5        U R                  [        S5      U-  5        U R                  [        S	5      U-  5        U R                  [        S
5      [         R"                  " U
5      -  5        gUS   (       + nUR                  S5      b  SnUR                  S5      nU(       a  S nOSn[%        UR                  R                  R'                  US   S95      nUR)                  US9  U H  nUu  nnnnnUS:X  a  SnOKU(       a  SnOA[*        R,                  " S[*        R.                  " U5      5      n[0        R2                  " U5      nUS-  (       a  SnOSUS-  [4        R6                  ) -  -  nU R                  SUUUUU4-  5        M     UR                  R9                  5        H;  nU R                  [        S5      UR                  R;                  U5      U4-  5        M=     g)z)show the contents of the current dirstatedockets"   dirstate v1 does not have a dockets   size of dirstate data: %d
s   data file uuid: %s
s   start offset of root nodes: %d
s   number of root nodes: %d
s   nodes with entries: %d
s   nodes with copies: %d
s   number of unused bytes: %d
s   ignore pattern hash: %s
NdatesnodatesTdatesortc                    U u  pp4nXQ4$ r   r  )r  filename_state_mode_sizemtimes         rf   keyfuncdebugstate.<locals>.keyfunc  s    491HeE$$rh   r   )r   rh  r   s   unset               s   set                 z%Y-%m-%d %H:%M:%S i    s   lnks   %3oi  s   %c %s %10d %s%s
s   copy: %s -> %s
)r  dirstate_use_dirstate_v2r   rY   r   _mapr  r   v2TREE_METADATAunpacktree_metadatar\   	data_sizeuuidbinasciihexlifyr  
debug_itersortrm   strftime	localtimer   
strtolocalr=   umaskr   copied)r^   r_   r   r  start_offset
root_nodesnodes_with_entrynodes_with_copyunused_bytes_unusedignore_patternr  r  r  entriesr  r  statemodesizer  timestrrq   s                          rf   
debugstater    s   : xx}}--++a EFGG##** **11&2F2FG	
 	12V5E5EEF
*+fkk9:
67,FG
01J>?
./2BBC
-.@A
23lBC
*+h.>.>~.NN	
 	w-Gxx	&xx
#H	%
 4==%%00T%[0ABGLLWL-2*%tUB;-G-Gmm$8$..:OPG))'2G'>DTE\TZZK78D
%dGX(NNO  ]]!!#
&'4==+?+?+BA*FFG $rh   s   debugdirstateignorepatternshashc                    UR                   R                  (       a[  UR                   R                  R                  nSnUR                  U* S nU R                  [        R                  " U5      S-   5        gg)zVshow the hash of ignore patterns stored in dirstate if v2,
or nothing for dirstate-v2
   Nr   )r  r  r  r  r  r\   r  r  )r^   r_   r   r  hash_len
hash_bytess         rf   debugdirstateignorepatternshashr  0  s`     }}%%##**))8)*5

!!*-56	 &rh      debugdiscovery   olds   use old-style discoverys   nonheadss/   use old-style discovery with non-heads includeds&   restrict discovery to this set of revs)rh   s   seeds   12323s)   specify the random seed use for discovery)rh   s   local-as-revsrh   s+   treat local has having these revisions only)rh   s   remote-as-revsrh   s.   use local as remote, with only these revisionss   [--rev REV] [OTHER]c           	     `  ^ ^^^$^%^&^' TR                  5       nTS   nTS   m'[        R                  " [        TS   5      5        T'(       d  [        R
                  " ST U5      nUR                  / 4n[        R                  " T[        R                  " T5      U5      nT R                  [        S5      [        R                  " UR                  5      -  5        OsS/ 4n[        R                   " UST'-  /5      m&[#        T&5      m&U&4S jn	U	[$        R&                  S	'   TR                  5       nUR(                  R+                  S	5      Ul        U(       aP  [        R                   " USU-  /5      m%[#        T%5      m%U%4S
 jn
U
[$        R&                  S'   TR+                  S5      m0 m$TR-                  S5      (       a  U4U$UU'UU 4S jjnOU4U$UU 4S jjn[        R.                  " TXSS9u  pTS   nT R1                  S[        R                  " T5      5      nUR2                  (       a  [4        R6                  U$U 4S j5       nO[8        R:                  nU" 5          [8        R<                  " S5       nU" X5      u  nnSSS5        SSS5        [?        W5      S:X  a  TR@                  U;   a
  [C        5       n[C        U5      n[C        W5      n[C        TRE                  5       5      nUU-  nUU-  nUU-  U-  nTRG                  S5      nTRG                  SU5      nTRG                  SU5      nTRG                  SU5      nTRG                  SU5      nTRG                  SU5      n[?        U5      [?        U5      -   [?        U5      :X  d   eTRG                  SUU5      nTRG                  SU5      n TRG                  SU5      n!UU-  n"UU-  n#WRH                  T$S'   [?        U5      T$S'   [?        U5      T$S'   [?        U5      T$S'   [?        U5      T$S'   [?        U5      T$S '   [?        U5      T$S!'   [?        U5      [?        U5      -
  T$S"'   [?        U5      T$S#'   [?        U5      [?        U5      -
  T$S$'   [?        U5      T$S%'   [?        U5      T$S&'   [?        U5      T$S''   [?        U5      T$S('   [?        U5      T$S)'   [?        U5      T$S*'   [?        U 5      T$S+'   [?        U!5      T$S,'   [?        U"5      T$S-'   [?        U#5      T$S.'   URK                  5         URL                  " SV0 [        RN                  " T$5      D6  URQ                  S/T$-  5        URQ                  S0T$-  5        S1T$;   a  URQ                  S2T$-  5        S3T$;   a  URQ                  S4T$-  5        S5T$;   a  URQ                  S6T$-  5        URQ                  S7T$-  5        S8T$;   a  URQ                  S9T$-  5        S:T$;   a  URQ                  S;T$-  5        URQ                  S<5        URQ                  S=T$-  5        URQ                  S>T$-  5        URQ                  S?T$-  5        URQ                  S@T$-  5        URQ                  SAT$-  5        URQ                  SBT$-  5        URQ                  SCT$-  5        URQ                  SDT$-  5        URQ                  SET$-  5        URQ                  SFT$-  5        URQ                  SGT$-  5        URQ                  SHT$-  5        URQ                  SIT$-  5        URQ                  SJT$-  5        URQ                  SKT$-  5        URQ                  SLT$-  5        URQ                  SMT$-  5        URQ                  SNT$-  5        URQ                  SOT$-  5        URQ                  SPT$-  5        URQ                  SQT$-  5        URQ                  SRT$-  5        T RR                  (       a3  URQ                  SSSTRU                  [W        SU U 5       5      5      -  5        URY                  5         g! , (       d  f       GN= f! , (       d  f       GN= f)WaZ  runs the changeset discovery protocol in isolation

The local peer can be "replaced" by a subset of the local repository by
using the `--local-as-revs` flag. In the same way, the usual `remote` peer
can be "replaced" by a subset of the local repository using the
`--remote-as-revs` flag. This is useful to efficiently debug pathological
discovery situations.

The following developer oriented config are relevant for people playing with this command:

* devel.discovery.exchange-heads=True

  If False, the discovery will not start with
  remote head fetching and local head querying.

* devel.discovery.grow-sample=True

  If False, the sample size used in set discovery will not be increased
  through the process

* devel.discovery.grow-sample.dynamic=True

  When discovery.grow-sample.dynamic is True, the default, the sample size is
  adapted to the shape of the undecided set (it is set to the max of:
  <target-size>, len(roots(undecided)), len(heads(undecided)

* devel.discovery.grow-sample.rate=1.05

  the rate at which the sample grow

* devel.discovery.randomize=True

  If andom sampling during discovery are deterministic. It is meant for
  integration tests.

* devel.discovery.sample-size=200

  Control the initial size of the discovery sample

* devel.discovery.sample-size.initial=100

  Control the initial size of the discovery for initial change
local_as_revsremote_as_revsseedr  s   comparing with %s
Ns   not (::(%s))c                   > T$ r   r  )r   remote_filtered_revss    rf   remote_func#debugdiscovery.<locals>.remote_func  s	    ''rh      debug-discovery-remote-filterc                   > T$ r   r  )r   local_filtered_revss    rf   
local_func"debugdiscovery.<locals>.local_func  s	    &&rh   s   debug-discovery-local-filteroldc           	     (  > [        US5      (       dL  [        R                  " UR                  5       5      nT
(       a!  UR                  R                  S5      nX2l        [        R                  " TUSTS9u  pEn[        U5      nT	R                  S5      (       dr  TR                  SSR                  [        S U 5       5      5      -  5        TR                  R                  nTR                  S	U5      nU Vs1 s H
  o7" U5      iM     nnXF4$ s  snf )
Nr  r!  T)forcerR   nonheadss   unpruned common: %s
r   c              3  8   #    U  H  n[        U5      v   M     g 7fr   r	   r   r  s     rf   r   /debugdiscovery.<locals>.doit.<locals>.<genexpr>  s     &@AuQxxry  s   heads(::%ln))hasattrr   locallegacypeerr   _repofilteredr:   findcommonincomingsetr  r   rp   r   rZ   r   r  )
pushedrevsremoteheadsremoterd   common_inhdsclnoder   r   remote_revsr_   r^   s           rf   doitdebugdiscovery.<locals>.doit  s    6:.."226<<>B--.NOA#$L,??fD F [F88J'',ii&@&@ @AB
 ,,?F;-34V&)V4; 5s   9Dc           	        > S nU (       a:  [         R                  " T
U 5      nU Vs/ s H  nT
U   R                  5       PM     nn[        R                  " TT
UUT	SS9u  pgnXh4$ s  snf )NF)ancestorsofrR   abortwhenunrelated)r   revranger   r2   findcommonheads)r4  r5  r6  nodesr  rd   r7  anyr9  r   r_   r^   s            rf   r<  r=    sq    E!**4<156Aa6+;;!#( F ; 7s   A$)r  r]   c               3  \   >#    TR                  5         S v   TR                  5       T S'   g 7f)N   output)
pushbuffer	popbuffer)r   r^   s   rf   may_capture_output*debugdiscovery.<locals>.may_capture_output  s!     MMO llnDOs   ),zdebug-discoveryr   s   all()s   ::%lns   roots(::%ld)s	   not ::%lds
   heads(%ld)s
   roots(%ld)s   not (::%ln or %ln::)s   elapseds   nb-common-headss   nb-common-heads-locals   nb-common-heads-remotes   nb-common-heads-boths   nb-common-rootss   nb-head-locals   nb-head-local-missings   nb-head-remotes   nb-head-remote-unknowns   nb-revss   nb-revs-commons   nb-revs-missings   nb-missing-headss   nb-missing-rootss
   nb-ini_unds   nb-ini_und-headss   nb-ini_und-rootss   nb-ini_und-commons   nb-ini_und-missings#   elapsed time:  %(elapsed)f seconds
s-   round-trips:           %(total-roundtrips)9d
s   total-round-trips-headss5     round-trips-heads:    %(total-round-trips-heads)9d
s   total-round-trips-branchess;     round-trips-branches:    %(total-round-trips-branches)9d
s   total-round-trips-betweens9     round-trips-between:    %(total-round-trips-between)9d
s*   queries:               %(total-queries)9d
s   total-queries-branchess3     queries-branches:    %(total-queries-branches)9d
s   total-queries-betweens2     queries-between:     %(total-queries-between)9d
s   heads summary:
s,     total common heads:  %(nb-common-heads)9d
s2       also local heads:  %(nb-common-heads-local)9d
s3       also remote heads: %(nb-common-heads-remote)9d
s1       both:              %(nb-common-heads-both)9d
s*     local heads:         %(nb-head-local)9d
s2       common:            %(nb-common-heads-local)9d
s2       missing:           %(nb-head-local-missing)9d
s+     remote heads:        %(nb-head-remote)9d
s3       common:            %(nb-common-heads-remote)9d
s3       unknown:           %(nb-head-remote-unknown)9d
s$   local changesets:      %(nb-revs)9d
s+     common:              %(nb-revs-common)9d
s,       heads:             %(nb-common-heads)9d
s,       roots:             %(nb-common-roots)9d
s,     missing:             %(nb-revs-missing)9d
s-       heads:             %(nb-missing-heads)9d
s-       roots:             %(nb-missing-roots)9d
s'     first undecided set: %(nb-ini_und)9d
s-       heads:             %(nb-ini_und-heads)9d
s-       roots:             %(nb-ini_und-roots)9d
s.       common:            %(nb-ini_und-common)9d
s/       missing:           %(nb-ini_und-missing)9d
s   common heads: %s
r   c              3  8   #    U  H  n[        U5      v   M     g 7fr   r+  r,  s     rf   r   !debugdiscovery.<locals>.<genexpr>U  s     >AuQxxry  r  )-
unfilteredrandomr  r  rI   get_unique_pull_path_objbranchr   r.  r)   r   r   r   hidepasswordlocr   rA  	frozensetr,   filtertabler0  r1  r  addbranchrevsr   strict_format
contextlibcontextmanagerr=   nullcontextmanagertimedcmrU   nullidr3  headsr  elapsedr   r   	strkwargsr   verboserp   r   r   )(r^   r_   	remoteurlr   unfi
local_revsr   r  r6  r  r$  r<  
remoterevs	_checkout	localrevsr   rI  tr7  r9  heads_commonheads_remoteheads_localheads_common_localheads_common_remoteheads_common_bothr   roots_commonmissingheads_missingroots_missinginitial_undecidedheads_initial_undecidedroots_initial_undecidedcommon_initial_undecidedmissing_initial_undecidedr   r#  r  r;  s(   `` `                                @@@@rf   debugdiscoveryrv  @  s   R ??D o&J'(K KKDL!"//r9
 KK$x33D94@
		!*+g.B.B488.LLM":)22?[01 
  ))=>	( BM=>||,,-MN(11?Z/0
 ((;<	' AK<=}}<=Dxx17 	 	0 28 	 	 ,,T6$OJUI	')=)=d)C	DB			"	"	- 
#	- "44		\\+,y5KFC - 

 6{aDKK61v;Ls8Ldjjl#K &3&5$|3kA
))H
CYYx(F99_f5Liif-GIImW5MIImW5Mv;W%S111		!46H #ii7HI"ii7HI069 1G ;yyD"<0D	%();%<D	!"&)*=&>D	"#$'(9$:D	 !"<0D	 -D	%(%5<N8O%OD	!"!,/D	&),&7#; 'D	"# 3xD!&kD	"7|D	 #M 2D	 #M 2D	/0D #$; <D	 #$; <D	!$%=!>D	"%&?"@D	LLNGG'h  &'HH4t;<HH>EF!T)
EL	
 %,
K	
 $t+
IDP	
 HH;dBC D(
H4OP4'
G$NOHH !HH=DEHHCdJKHHDtKLHHBTIJHH;dBCHHCdJKHHCdJKHH<tCDHHDtKLHHDtKLHH5<=HH<tCDHH=DEHH=DEHH=DEHH>EFHH>EFHH84?@HH>EFHH>EFHH?$FGHH@4GH	zz
!ii>>>?@	
 FFHU -, 
	s$   `1`=`
`	`
`-i   s   debugdownloadrF  s   pathc                h   [         R                  " XU5      nU nU(       a  [        US[        5      n UR                  [        5      nU(       a/  UR	                  U5        UR                  [        5      nU(       a  M/  U(       a  UR                  5         gg! U(       a  UR                  5         f f = f)z4download a resource using Mercurial logic and configwbN)urlmodrk   
_chunksizer   r\   r2  )r^   r_   r<   outputr   fhdestr   s           rf   debugdownloadr~  ]  s     
Rf	%BDFD*-wwz"JJt77:&D d JJL 6JJL s   A	B B1   debugextensionsc                   [         R                   " U 5      n[        R                  " 5       nU R                  S[        R
                  " U5      5      n[        U[        R                  " S5      S9 GHL  u  pg[         R                  " U5      nSn	[        US5      (       a!  [        R                  " UR                  5      n	O&[        [        SS5      (       a  [        R                  n	U(       a  / n
O[        USS	5      R!                  5       n
[        US
S5      nUR#                  5         U R$                  (       d  U R&                  (       a  UR)                  SSU5        OlUR)                  SSU5        U(       d  XJ;   a  UR+                  S5        O;U
(       d  UR+                  [-        S5      5        OU
S   nUR+                  SU-  5        UR/                  U R&                  =(       a    U	S[-        S5      U	=(       d    S	5        U R&                  (       a"  UR+                  [-        S5      SS/U   -  5        UR1                  US9  UR/                  U R&                  =(       a    U
S[-        S5      UR3                  U
SS95        UR/                  U R&                  =(       a    US[-        S5      U=(       d    S	5        GMO     UR5                  5         g)z(show information about active extensionsr  r   rh  N__file__oxidizedF
testedwithrh   buglink   namer'  rz  r   s    (untested!)
r   s    (%s!)
r  s     location: %s
s     bundled: %s
   no   yes)bundleds
   testedwiths     tested with: %s
s   verr   s   buglinks     bug reporting: %s
)r   r=   r   r   r)   r   r   operator
itemgetterismoduleinternalr.  fsencoder  getattrsyssysexecutabler   r   r   r_  r\   r   r   	condwriter   
formatlistr   )r^   r_   r   extshgverr   extnameextmod
isinternal	extsourceexttestedwith
extbuglinklasttestedversions                rf   debugextensionsr  u  s$      $DLLNE	((*>*>t*D	EB!$H,?,?,BC008
	6:&& ))&//:IS*e,, ..IM#FL#>DDFMVY5

88rzzHHWgw/HHWeW-U3",-.$1"$5!'889
JJ$9!"		
 ::HHQ)*eV_Z-HHI

#
JJ(=$%MM-fM5		
 	JJ%:&'#		
] Dj FFHrh   s   debugfilesets#   apply the filespec on this revisions	   all-filess3   test files from all revisions and working directorys   show-matchers(   print internal representation of matcher   ps
   show-stages$   print parsed tree at the given stages   NAMEs+   [-r REV] [--all-files] [OPTION]... FILESPECc           	        SSK Jn  UR                    [        R                  " XR                  S5      S5      nS[        R                  4S[        R                  4S[        R                  4/nU VVs1 s H  u  pxUiM	     n	nn[        5       n
U R                  (       a  US   (       d  U
R                  S5        US   S	/:X  a  U
R                  U	5        OGUS    H*  nXy;  d  M
  [        R                   " [#        S
5      U-  5      e   U
R                  US   5        [        R$                  " U5      nU H^  u  pxU" U5      nXz;   d  M  US   (       d  US:w  a  U R'                  SU-  5        U R'                  [        R(                  " U5      S5        M`     [        5       nUS   (       aG  U HA  nX   nUR                  UR+                  5       5        UR                  UR,                  5        MC     US   (       d  UR/                  5       cs  US   nUR                  UR0                  R3                  [4        R6                  " U5      [9        UR,                  5      SSS95        UR                  UR,                  5        O:UR                  UR+                  5       5        UR                  UR,                  5        UR;                  UR=                  5       U5      nUS   (       d  US   c8  U R                  (       a'  U R?                  S[@        RB                  " U5      S5        [E        U5       H&  nU" U5      (       d  M  U R'                  SU-  5        M(     gs  snnf )z'parse and apply a fileset specificationr   )filesetr]   N   parsed   analyzed	   optimized
show_stager$     invalid stage name: %s   * %s:
r   	all_filesT)subreposunknownignoredshow_matcher   * matcher:
r'  )# r  symbolsr   r@  r  r)   identityr   analyzeoptimizer3  r_  addr   r   rY   r   parser\   prettyformatr   substater]   r  walkr1   matchallr  matchfilesetrW   r   rH   
prettyreprr   )r^   r_   exprr   r  rK  stagesr  rq   
stagenames
showalwaystreer   rd   r4  wctxr   s                    rf   debugfilesetr    s   D OO


tXXe_d
;C 
H%%&	k))*	{++,F
 !''!J'J	zz$|,y!LfX%*%l#A"kk!$=">"BCC $ 	$|,-T"Dw?L!Q)^a(HH[--d3U;  EEKAALL#LL$  KCGGI-DzMM  &dmm,	  	
 	T]]#SYY[!S\\"-AN^ 4 <

(=(=a(@%HE]tt
1 ] (s   3Ms   debug-repair-issue6528s	   to-reports1   build a report of affected revisions to this files   from-reports+   repair revisions listed in this report files   paranoids3   check that both detection methods do the same thingc           	     p   [         R                  " USSS/5        UR                  S5      nUR                  S5      nUR                  S5      nUR                  S5      n[        R                  UR                  ;  a!  Sn[
        R                  " [        U5      5      e[        R                  " U UUUUUS9  g)a  find affected revisions and repair them. See issue6528 for more details.

The `--to-report` and `--from-report` flags allow you to cache and reuse the
computation of affected revisions for a given repository across clones.
The report format is line-based (with empty lines ignored):

```
<ascii-hex of the affected revision>,... <unencoded filelog index filename>
```

There can be multiple broken revisions per filelog, they are separated by
a comma with no spaces. The only space is between the revision(s) and the
filename.

Note that this does *not* mean that this repairs future affected revisions,
that needs a separate fix at the exchange level that was introduced in
Mercurial 5.9.1.

There is a `--paranoid` flag to test that the fast implementation is correct
by checking it against the slow implementation. Since this matter is quite
urgent and testing every edge-case is probably quite costly, we use this
method to test on large repositories as a fuzzing method of sorts.
	to_reportfrom_reportdry_runparanoids9   can only repair revlogv1 repositories, v2 is not affected)r  r  r  r  N)
r   check_incompatible_argumentsr  r-   REVLOGV1_REQUIREMENTr   rY   r   rL   repair_issue6528)r^   r_   r   r  r  r  r  r   s           rf   debug_repair_issue6528r    s    d ((kM95 hhy!G%I((=)Kxx
#H ((0A0AAJkk!C&!!
rh      debugformats   [PATTERN] ... [PATTERN]c           	       ^ [        S [        R                   5       5      m[        [        S5      T5      mU4S jnU R	                  S[
        R                  " U5      5      nUR                  5       (       a  S nO[
        R                  nUR                  S5        UR                  ST[        S5      -
  -  5        UR                  S5        U R                  (       a  UR                  S5        UR                  S	5        [        R                   GH5  nU(       a  U H  nXR                  ;   d  M    O   M'  UR                  5         UR                  U5      n	UR                  U5      n
X:w  a  S
nSnOXR                  :w  a  SnSnOSnSnUR!                  SU" UR                  5      UR                  US9  UR!                  SSU" U	5      US9  UR                  U
:w  a  SnOSnUR#                  U R                  SSU" U
5      US9  UR#                  U R                  SSU" UR                  5      SS9  UR                  S	5        GM8     UR%                  5         g)zdisplay format information about the current repository

Use --verbose to get extra information about current config value and
Mercurial default.

If patterns are specified, only format matching at least one of these
pattern will be displayed.
c              3  L   #    U  H  n[        UR                  5      v   M     g 7fr   )rU   r   )r   fvs     rf   r   debugformat.<locals>.<genexpr>l  s     K2JB3rww<<2Js   "$s   format-variantc                ,   > SST[        U 5      -
  -  -   $ )Ns   %s:r   rv  )r   maxvariantlengths    rf   makeformatname#debugformat.<locals>.makeformatnameo  s    !1CI!=>??rh   r  c                :    [        U S5      (       a  U $ U (       a  gg)Nr   r  r  )r.  values    rf   formatvalue debugformat.<locals>.formatvalueu  s    ul++rh   r   s    repos    config defaultr   s!   formatvariant.name.mismatchconfigs!   formatvariant.repo.mismatchconfigs"   formatvariant.name.mismatchdefaults"   formatvariant.repo.mismatchdefaults   formatvariant.name.uptodates   formatvariant.repo.uptodater  ri  s   repos    %3ss   formatvariant.config.specials   formatvariant.config.defaults   configs    %6sr   s    %7ss   formatvariant.defaultN)r}  r;   allformatvariantrU   r   r)   r   isplainr  r   r_  r   r   fromrepo
fromconfigdefaultr\   r  r   )r^   r_   patternsr   r  r   r  r  r   	repovalueconfigvalue	namelabel	repolabelconfiglabelr  s                 @rf   debugformatr  ^  s    K'2J2JKK3013CD@ 
nh&:&:4&@	AB	zz||	 ''HHHHT%,=(>>?@HHX	zz
#$HHUO&&<  
KK%	mmD)#<I<I**$=I=I6I6I
.1277)L
';y#9K::$9K9K
JJ$ 	 	
 	JJ

#* 	 	
 	W 'X FFHrh   s   debugfsinfos   [PATH]c                \   U R                  SU-  5        U R                  S[        R                  " U5      =(       d    S-  5        U R                  S[        R                  " U5      =(       a    S=(       d    S-  5        U R                  S[        R                  " U5      =(       d    S-  5        U R                  S[        R
                  " U5      =(       a    S=(       d    S-  5        U R                  S	[        R                  " U5      =(       a    S=(       d    S-  5        Sn [        R                  " S
US9 n[        R                  " UR                  5      =(       a    S=(       d    SnSSS5        U R                  SU-  5        g! , (       d  f       N#= f! [         a     N2f = f)z2show information detected about current filesystems	   path: %s
s   mounted on: %s
s	   (unknown)s	   exec: %s
r  r  s   fstype: %s
s   symlink: %s
s   hardlink: %s
s   .debugfsinfo)prefixr  Ns   case-sensitive: %s
)r   r=   getfsmountpoint	checkexec	getfstype	checklink
checknlinkr)   namedtempfilefscasesensitiver   OSError)r^   r   casesensitiverq   s       rf   debugfsinfor    s?    NN=4'(NNt33D9I\J NN=DNN4$8$CV$LuMNNN?dnnT&:&JlKLNNDNN40;VDuE NNT__T2=vFG !M##?E 008CVLuM F NN*]:;	 FE s0   (F =3F0F 
FF F 
F+*F+s   debuggetbundle   Hs   heads   id of head nodes   ID   Cs   commons   id of common nodes   type   bzip2s   bundle compression type to uses   TYPEs   REPO FILE [-H|-C ID]...c                   [         R                  " U [        R                  " U5      U5      nUR	                  S5      (       d  [
        R                  " S5      e0 nU(       a  U Vs/ s H  n[        U5      PM     snUS'   U(       a  U Vs/ s H  n[        U5      PM     snUS'   SUS'   UR                  " S0 UD6n	UR                  SS5      R                  5       n
S	S
SSS.nUR                  U
5      n
U
[        R                  ;  a  [
        R                  " [        S5      5      e[        R                  " X	X*5        gs  snf s  snf )zwretrieves a bundle from a repo

Every ID must be a full-length hex node id string. Saves the bundle to the
given file.
s	   getbundles.   getbundle() not supported by target repositoryr7  r\  N
bundlecapsr   r  s   HG10UNs   HG10BZs   HG10GZs   HG20)s   noner  s   gzips   bundle2s)   unknown bundle type specified with --type)s   debug)r   r.  r)   r   capabler   rY   r   	getbundler  lowerr
   bundletypesr   writebundle)r^   repopathr)  r	  r7  r   r_   r`   rw  bundle
bundletypebtypess               rf   debuggetbundler    s   , 772x++D18<D<<%%kkKLLD*01&Q#a&&1X)-.AQ.WD^^--F&(+113J	F J'J,,,kk!HIJJJ;# 2.s   &EEs   debugignores	   [FILE]...c                   UR                   R                  nU(       d)  U R                  S[        R                  " U5      -  5        g[
        R                  " US   US9n[
        R                  " USS9nUR                  5        GH7  n[        R                  " U5      nSn	Sn
US:w  at  U" U5      (       a  Un	UR                   R                  U5      n
OI[        R                  " U5       H/  nU" U5      (       d  M  Un	UR                   R                  U5      n
  O   U	(       au  X:X  a$  U R                  [        S5      U" U5      -  5        O%U R                  [        S5      U" U5      U	4-  5        U
u  pnU R                  [        S	5      XU4-  5        GM  U R                  [        S
5      U" U5      -  5        GM:     g)a  display the combined ignore pattern and information about ignored files

With no argument display the combined ignore pattern.

Given space separated file names, shows if the given file is ignored and
if so, show the ignore rule (file and line number) that matched it.
r'  N)patsT)legacyrelativevalue   .s   %s is ignored
s1   %s is ignored because of containing directory %s
s#   (ignore rule in %s, line %d: '%s')
s   %s is not ignored
)r  _ignorer\   r)   bytereprr1   matchgetuipathfnr   r=   normpath_ignorefileandliner%   finddirsr   )r^   r_   r   r   ignorer   uipathfnrq   nfr  
ignoredatar   
ignorefilelinenor  s                  rf   debugignorer    s    ]]""F
8,,V445MM$t*51&&tFAq!BGJTz":: G!%!A!A"!EJ%..r2!!99&'G)-)I)I!)LJ!	 3
 =HHQ12Xa[@AHH9 $A;0	1 ,6(
D=>!401
 12Xa[@A? rh   s   debug-revlog-index|debugindexc                    [         R                  " U5      n[        R                  " USX#5      nU R	                  SU5      n[        USU5      n[        R                  " U UUUU R                  S9$ )zdump index data for a revlogs
   debugindex_revlog)r   r.   	full_node)	r)   r   r   r  r   r  r  debug_index	debugflag)r^   r_   r  r   storer   r.   s          rf   
debugindexr  .  sl     %DmUAE	mT	*BUIu-F##
,, rh      debugindexdotc                   [         R                  " USU[        R                  " U5      5      nU R	                  S5        U H  nUR                  U5      nUR                  U5      nU R                  SUR                  US   5      U4-  5        US   UR                  :w  d  Mb  U R                  SUR                  US   5      U4-  5        M     U R                  S5        g)z(dump an index DAG as a graphviz dot filer  s   digraph G {
s
   	%d -> %d
r   r   s   }
N)
r   r  r)   r   r   r   parentsr\   r]   r[  )r^   r_   r  r   rd   r   r   pps           rf   debugindexdotr  E  s     	x';';D'A	A NN#$vvayYYt_
AEE"Q%L!#445a5DKKHH_bea'889  HHVrh   s   debugindexstatsc                f   UR                   R                  UR                  S5        UR                   R                  n[	        US5      (       d  [
        R                  " [        S5      5      e[        UR                  5       R                  5       5       H  u  p4U R                  SX44-  5        M     g)z)show stats related to the changelog indexr   statss-   debugindexstats only works with native C codes   %s: %d
N)rZ   shortestr[  ra   r.  r   rY   r   r   r  r1  r\   )r^   r_   ra   r  r8  s        rf   debugindexstatsr  Z  s     	NNDKK+NN  E5'""kk!LMNNu{{}**,-
v%& .rh      debuginstallc                   SnU R                  S[        R                  " U5      5      nUR                  5         UR	                  SS[
        R
                  5        Sn [        R                  " [        R                  " [
        R
                  5      5        UR                  USSU5        Sn[        [        S	5      (       aB  [        R                  R!                  [        R"                  " [        R$                  5      5      nO&['        [(        S
S5      (       a  [        R*                  nUR	                  S[-        S5      [        R*                  =(       d    [-        S5      5        UR	                  S[-        S5      [        R.                  " [0        R2                  " 5       5      5        UR	                  S[-        S5      S[(        R4                  SS -  5        UR	                  S[-        S5      U=(       d    [-        S5      5         SSKJn  UR:                    [?        [@        RB                  5      n[@        RD                  (       a  URG                  S5        UR	                  S[-        S5      URI                  [K        U5      SSSS95        SU;  a  URM                  [-        S 5      5        SU;  a  URM                  [-        S!5      5        URM                  [-        S"Uc  S#OS$-  5      5        [N        RP                  " 5       n	UR	                  S%[-        S&5      U	RS                  S'5      S   5        UR	                  S([-        S)5      S'RU                  U	RS                  S'5      SS 5      5        Sn
[        [(        RV                  [X           S	5      (       a8  [        R                  R!                  [        R"                  " [$        5      5      n
O&['        [(        S
S5      (       a  [        R*                  n
UR	                  S*[-        S+5      [Z        RZ                  5        UR	                  S,[-        S-5      U
=(       d    [-        S5      5        [Z        RZ                  S.;   nUn[Z        RZ                  S/;   =(       d    UnU=(       d    UnU(       ay  Sn U(       a6  SS0K.J/nJ0nJ1nJ2n  [g        U5      [g        U5      [g        U5      [g        U5      4  U(       a  SS1KJ4nJ5n  [g        U5      [g        U5      4  UR                  US2S3U5        [N        Rn                  Rp                  Rs                  5       nUR	                  S4[-        S55      URI                  [K        S6 U 5       5      S7SS8S95        UR	                  S9[-        S:5      URI                  [K        S; U 5       5      S7SS8S95        [t        Rn                  Rw                  [t        Rx                  5      nUR	                  S<[-        S=5      URI                  U Vs/ s H*  nUR{                  5       (       d  M  UR}                  5       PM,     snS7SS8S95        S#n[N        R~                  " 5       (       a  S>nURM                  [-        S?5      U-  5        UR                  [        [N        R                  5      S@9  [        R                  " 5       nUR	                  SASBU=(       d    SC5        UR                  U(       + SC[-        SD5      5        U(       a  [        R                  " SE5      u  nnU(       a7  Sn [        R                  R                  U5        UR                  USFS3U5        OSnUR                  USG[-        SH5      U5        UR                  U(       + SI[-        SJ5      SK5        U(       d  US-  nUR                  U(       + SC[-        SL5      5        U R                  5       n[N        R                  " U5      n[        R                  " U5      S   nUR	                  SM[-        SN5      U5        [        R                  " U5      nUR                  U(       + =(       a    USO:H  SP[-        SQ5      U(       + =(       a    USO:H  =(       a    U5        UR                  U(       + =(       a    USO:g  SR[-        SS5      U(       + =(       a    U5        U(       d  USO:w  a  US-  nSnSn U R                  5       nUR                  UST[-        SU5      U5        UR                  USV[-        SW5      U5        [        R                  " 5        H#  u  nn ['        U SXS5      n!U!c  M  UU!" X5      -  nM%     UR                  U(       + SC[-        SY5      5        U(       d  UR                  USZ9  UR                  US[[-        S\5      U5        UR                  5         U$ ! [         a&  n[        R                  " U5      nUS-  n SnAG	NDSnAff = f! [<         a    Sn GNf = f! [l         a&  n[        R                  " U5      nUS-  n SnAGN+SnAff = fs  snf ! [l         a#  n[        R                  " U5      nSn SnAGN!SnAff = f! [        R                   a  nUR                  nUS-  n SnAGNSnAff = f)]z3test Mercurial installation

Returns 0 on success.
r   r   s   encodings   checking encoding (%s)...
Nr   s   encodingerrors.    %s
 (check that your locale is properly set)
r  r  Fs	   pythonexes    checking Python executable (%s)
s   unknowns   pythonimplementations$   checking Python implementation (%s)
s	   pythonvers   checking Python version (%s)
s   %d.%d.%drP   s	   pythonlibs   checking Python lib (%s)...
)rustexts   snis   pythonsecuritys&   checking Python security support (%s)
s   protocolrz     ,)r   fmtseps   tls1.2sT     TLS 1.2 not supported by Python install; network connections lack modern security
sV     SNI not supported by Python install; may have connectivity issues with some servers
s   checking Rust extensions (%s)
   missings	   installeds   hgvers    checking Mercurial version (%s)
   +s
   hgverextras%   checking Mercurial custom build (%s)
s   hgmodulepolicys   checking module policy (%s)
s	   hgmoduless#   checking installed modules (%s)...
)s   rust+cs   rust+c-allow)   cs   allow)base85bdiffmpatchosutil)r[   r  s   extensionserrors    %s
s   compenginess-   checking registered compression engines (%s)
c              3  @   #    U  H  oR                  5       v   M     g 7fr   r  r  s     rf   r   debuginstall.<locals>.<genexpr>  s     1[6688[   s
   compenginer  s   compenginesavails,   checking available compression engines (%s)
c              3  n   #    U  H+  oR                  5       (       d  M  UR                  5       v   M-     g 7fr   )	availabler   r  s     rf   r   r.    s      B[KKM816688[s   55s   compenginesservers>   checking available compression engines for wire protocol (%s)
s	   availables"   checking "re2" regexp engine (%s)
)re2s   templatedirss   checking templates (%s)...
rh   s    no template directories found
s   map-cmdline.defaults   defaulttemplateerrors   defaulttemplates   checking default template (%s)
s   defaulttemplatenotfounds    template '%s' not found
r   s5    (templates seem to have been installed incorrectly)
s   editors   checking commit editor... (%s)
s   vis
   vinotfoundsf    No commit editor set and can't find %s in PATH
 (specify a commit editor in your configuration file)
s   editornotfoundsV    Can't find editor '%s' in PATH
 (specify a commit editor in your configuration file)
s   usernames   checking username (%s)
s   usernameerrorsJ   checking username...
 %s
 (specify a username in your configuration file)
debuginstalls   no problems detected
)problemss   problemss1   %d problems detected, please check your install!
)Rr   r)   r   r   r\   r   codecsrX   sysstrLookupErrorrH   forcebytestrr  r.  osr   dirnamer  r  r  r  r  r   sysbytesplatformpython_implementationversion_infor  r"  __doc__ImportErrorr3  r5   supportedprotocolshassnir  r  r   r   r=   r   r   rp   modules__name__r'   cextr)  r*  r+  r,  r  r[   r  	Exceptioncompengines_enginesr7  rE   supportedwireengines
SERVERROLEwireprotosupportr   has_re2r   bool_re2r9   templatedirtry_open_templatefrommapfile	geteditor
expandpathrG   
shellsplitfindexeusernamer   rY   messager   r   )"r^   r   r4  r   errinst	pythonlibr"  securityr  	hgmodulesrustandcrE  nopurer)  r*  r+  r,  r[   r  rG  wirecompenginesr|  r2  r   r   fpeditor	editorbincmdpathrV  r   modhandlers"                                     rf   r3  r3  e  s    H	ox';';D'A	BBLLN HH[8(:K:KL
Chooh&7&789 LL;	 Ir:GGOOH$5$5bkk$BC		j%	(	(**	HH	
.//!J-
 HH	
23(88:;
 HH	
+,	s''+	+
 HH	
*+"Qz] 7--.H~~VHH	
45
fX&[eN  
>	
 X
;	
 HH	.$_z,@	
 LLNEHH!895;;t;LQ;O HH	
34		%++d#AB'( Is{{8$j11GGOOH$5$5h$?@		j%	(	(**	HH1=> HH	
12"Qz] }} <<HG==,,8D_WF	  E
CKVc&kA
 Hs8}, 	S,h<""++224KHH	
;<
1[11	 	 	
	 HH	
:;
B[BB	 	 	
	 "--BBO HH	(	
 	.G!!2D2D2FXQVVXG	 	 	
 C||~~HHQ56<=GGTYYG  	AHH_=qxCHLLQQBCD--.DEBC##//2 LL5xEA
!1%H#I1	
 	E&+,		
 ALLsAOP
 \\^F__V$F##F+A.IHHY=>	Jy)GLL'%		

 5%5I	 LL'%		

 !		 vA H
C;;=
 LL+q!<=x LL	B	
 	  **,	c#~t4'H -
 LLXsA&?$@A
"LL	
?@	 FFHOo  %%d+AT  t  	))$/CMH	H H.   --d3n ;; iiAs   8f. g! A"g4 :h'h'h, i .
g8gg!g10g14
h$>hh$,
i6iij0jjs
   debugknowns
   REPO ID...c           
        [         R                  " U [        R                  " U5      U5      nUR	                  S5      (       d  [
        R                  " S5      eUR                  U Vs/ s H  n[        U5      PM     sn5      nU R                  SSR                  U Vs/ s H  ow=(       a    S=(       d    SPM     sn5      -  5        gs  snf s  snf )ztest whether node ids are known to a repo

Every ID must be a full-length hex node id string. Returns a list of 0s
and 1s indicating unknown/known.
s   knowns*   known() not supported by target repositoryr'  rh      1   0N)r   r.  r)   r   r  r   rY   knownr   r\   rp   )r^   r  idsr   r_   rw  r   rq   s           rf   
debugknownrk    s     772x++D18<D<<!!kkGHHJJ,1A,-EHHWe!De*"4"4e!DEFG -!Ds   (C
Cs   debuglabelcompletes   LABEL...c                    [        X/UQ76   g)zEbackwards compatibility with old bash completion scripts (DEPRECATED)N)debugnamecomplete)r^   r_   r`   s      rf   debuglabelcompletern    s     b&&rh   s
   debuglocks   Ls   force-free-locks   free the store lock (DANGEROUS)   Ws   force-free-wlocks'   free the working state lock (DANGEROUS)s   set-locks    set the store lock until stopped   Ss	   set-wlocks(   set the working state lock until stoppedc                  ^ ^
 UR                  S5      (       a  UR                  R                  S5        UR                  S5      (       a  UR                  R                  S5        UR                  S5      (       d  UR                  S5      (       a  g/ n [        R
                  R                  S5      nU(       a<  [        US5       nUR                  S[        R                  " 5       -  5        S	S	S	5        UR                  S
5      (       a!   UR                  UR                  S5      5        UR                  S5      (       a!   UR                  UR!                  S5      5        [#        U5      (       aw   T R%                  5       (       a  [        S5      nT R'                  U5        O:SnU[#        U5      -  nT R)                  U5         [*        R,                  " S5        M   [1        U6   g [1        U6   [*        R*                  " 5       m
SnU
U 4S jn	X" UR                  SUR                   5      -  nX" UR                  SUR                  5      -  nU$ ! , (       d  f       GNm= f! [        R                   a     [        R                  " [        S5      5      ef = f! [        R                   a     [        R                  " [        S5      5      ef = f! [.         a    SnT R)                  U5         GNf = f! [1        U6   f = f)av  show or modify state of locks

By default, this command will show which locks are held. This
includes the user and process holding the lock, the amount of time
the lock has been held, and the machine name where the process is
running if it's not local.

Locks protect the integrity of Mercurial's data, so should be
treated with care. System crashes or other interruptions may cause
locks to not be properly released, though Mercurial will usually
detect and remove such stale locks automatically.

However, detecting stale locks may not always be possible (for
instance, on a shared filesystem). Removing locks may also be
blocked by filesystem permissions.

Setting a lock will prevent other commands from changing the data.
The command will wait until an interruption (SIGINT, SIGTERM, ...) occurs.
The set locks are removed when the command exits.

Returns 0 if no locks are held.

force_free_locks   lockforce_free_wlocks   wlockr   s   DAEMON_PIDSab   %d
N	set_wlockFs   wlock is already heldset_locks   lock is already helds&   ready to release the lock (y)? $$ &Yess"   %d locks held, waiting for signal
g?s    signal-received releasing locks
c                ^  >  U" S5      nU(       a  UR                  5         O U R                  U5      nT
U[        R
                     -
  n[        R                  " UR                  5      nU R                  U5      nSU;   aN  UR                  S5      u  pU[        R                  " 5       :X  a  SU=(       d    SU	4-  nOSU=(       d    SU	U4-  nTR                  SUS-   Xu4-  5        gTR                  SUS-   -  5        g	! [         R                   a    S n GNf = f! [         a     NAf = f)
NF   :s   user %s, process %ss   Nones   user %s, process %s, host %ss   %-6s %s (%ds)
r   s
   %-6s free
r   )r   LockHeldreleaselstatstatST_MTIMEr=   rV  st_uidreadlockr   socketgethostnamer   FileNotFoundError)r?   r   methodr   stager   lockerhostpidnowr^   s             rf   reportdebuglocks.<locals>.report  s#   	uA IIKYYt_Bt}}--}}RYY/d+6> &T 2IDv1133!74?7C:P!P!@ OG D "
 1TD[&4NNO 	~567 ~~ 	A	. % s#   D CD DD
D,+D,)r  svfs	tryunlinkr?   r   environrk   r\   r9  getpidr   r   r   r{  rY   r   r   rU   interactivepromptchoicer   rm   rn   KeyboardInterruptr|  )r^   r_   r   lockspidsr`  promptr   heldr  r  s   `         @rf   
debuglocksr    sg   Z xx!""		G$xx"##8$xx!""dhh/A&B&BE" ##N3dD!R299;./ " 88K  ?TZZ./ 88J>TYYu-. u::>>##HIFOOF+@C3u:%CIIcN

3 
 !   	
))+CDB 	F499gtyy11DF488Xtzz22DKM "! >> ?kk!$<"=>>?
 >> >kk!$;"<==> % :		#
 	s~   2K9 (I/K9  I' .K9  J %K9 61K 'K9 (:K 
I$K9 '4JK9 4KK9 K62K9 5K66K9 9
Ls   debugmanifestfulltextcaches   clears   clear the caches   adds)   add the given manifest nodes to the caches   NODEc                  ^ U4S jnUR                  S5      (       a1  TR                  5          U" 5       nUR                  SS9   SSS5        gU(       af  TR                  5          TR                  nUR	                  S5      nU H(  n XgR                  U5         n	U	R                  " 5         M*      SSS5        gU" 5       n[        U5      (       d  U R                  [        S	5      5        gU R                  [        S
5      [        U5      4-  5        SnU Hb  nUR                  U5      n[        U5      nXS-   -  nU R                  [        S5      [        U5      [         R"                  " U5      4-  5        Md     UR$                  R'                  S5      R(                  nU R                  [        S5      [         R"                  " U5      [         R"                  " U5      4-  5        g! , (       d  f       GN= f! [        R                   a#  n
[        R                  " [        U
5      SS9eSn
A
ff = f! , (       d  f       GN= f)z@show, clear or amend the contents of the manifest fulltext cachec                    > TR                   R                  S5      n  U R                  $ ! [         a"    [	        S5      n[
        R                  " U5      ef = f)Nrh   sO   Current revlog implementation doesn't appear to have a manifest fulltext cache
)manifestlog
getstorage_fulltextcacheAttributeErrorr   r   rY   )rd   r   r_   s     rf   getcache,debugmanifestfulltextcache.<locals>.getcache7	  sY    '',	#### 	#-C ++c""	#s	   * ,Arm  T)clear_persisted_dataNrh   s   Check your manifest node idhints   cache empty
sF   cache contains %d manifest entries, in order of most to least recent:
r      s   id: %s, size %s
s   manifestfulltextcaches%   total cache data size %s, on-disk %s
)r  r   rm  r  r  rX   r   r7  rY   bytesr   rU   r\   r   peekr   r=   	bytecount_openerr~  st_size)r^   r_   r  r   r  cacher   r  r  r    r|  	totalsizer   r   r  ondisks    `              rf   debugmanifestfulltextcacher  &	  s   "	# xxZZ\JEKKTK2 \
 ZZ\  ALL%E a1H
    \ JEu::
#$%
# 5zm		
 	F::f%Dt9D"IHH&'3v;t8L*MM  ##$<=EE
78~~i($..*@AB	
Q \ (( ++a'E  \s;   G,&#H8
G>H8,
G;>H5H00H55H88
I   debugmergestatec                B	   U R                   (       a  [        R                  " U5      nUR                  5       nUR	                  5       nU(       d  U(       d  ORU(       d  U R                  S5        O9UR                  XV5      (       a  U R                  S5        OU R                  S5        US   (       d  SUS'   [        R                  R                  U5      nU R                  S[        R                  " U5      5      nUR                  5         UR                  S5      nUR                  5       (       a  SUR                  S	4S
UR                  S44 H  u  pnUR                  5         UR!                  U	S9  UR!                  [#        U
5      S9  UR$                  (       d  MP  ['        UR$                  5      U:  d  Mk  UR!                  UR$                  U   S9  M     UR)                  5         UR                  S5      nUR                  5       (       Ga  U GH  nUR                  5         UR!                  US9  UR*                  U   nUR!                  US	   S9  US	   [        R,                  [        R.                  4;   a  UR!                  US   S9  UR!                  US   S9  UR!                  US   S9  UR!                  US   S9  UR!                  US   S9  UR!                  US   S9  UR!                  US   S9  OKUS	   [        R0                  [        R2                  4;   a$  UR!                  US   S9  UR!                  US   S 9  UR                  S!5      n[5        UR7                  U5      R9                  5       5       H4  u  nnUR                  5         UR!                  US"9  UR!                  US#9  M6     UR)                  5         GM     UR)                  5         UR                  S!5      n[5        UR;                  5       R9                  5       5       Hd  u  nnX;   a  M  UR9                  5        HC  u  nnUR                  5         UR!                  US$9  UR!                  US"9  UR!                  US#9  ME     Mf     UR)                  5         UR)                  5         g%)&zhprint merge state

Use --verbose to print out information about whether v1 or v2 merge state
was chosen.s   no version 2 merge state
s!   v1 and v2 states match: using v2
s$   v1 and v2 states mismatch: using v1
rQ  s  {if(commits, "", "no merge state found
")}{commits % "{name}{if(label, " ({label})")}: {node}
"}{files % "file: {path} (state \"{state}\")
{if(local_path, "  local path: {local_path} (hash {local_key}, flags \"{local_flags}\")
  ancestor path: {ancestor_path} (node {ancestor_node})
  other path: {other_path} (node {other_node})
")}{if(rename_side, "  rename side: {rename_side}
  renamed path: {renamed_path}
")}{extras % "  extra: {key} = {value}
"}"}{extras % "extra: {file} ({key} = {value})
"}r  s   commitss   localr   s   otherr   r  r   ri  s   files)r   )r  )	local_keyrS   )
local_pathrP   )ancestor_pathr  )ancestor_noder  )
other_pathrb  )
other_node   )local_flags)renamed_path)rename_sides   extrasrh  r  )fileN)r_  mergestatemodr!   _readrecordsv1_readrecordsv2r   
_v1v2matchr   r   r)   r   r   nestedactiver   r   r   r   _labelsrU   r   r  MERGE_RECORD_UNRESOLVEDMERGE_RECORD_RESOLVEDMERGE_RECORD_UNRESOLVED_PATHMERGE_RECORD_RESOLVED_PATHr   extrasr1  	allextras)r^   r_   r`   r   ms	v1records	v2recordsr   
fm_commitsr   r   label_indexfm_filesrq   r  	fm_extrasr  r8  r  s                      rf   debugmergestater  q	  s    
zz%%d+ %%'	%%'	NN89]]900NN@ANNCD
> 	Z$ 
	!	!	&	&t	,B	((*>*>t*D	EBLLN:&J	yy{{rxx#rxx#(
#D   "OOO&OOTO+zzzc"**o;bjj&=>(
 NNyy"H	yy{{A MMqM!IIaLEMMaM)Qx5533  a1q2E!H5E!H5q2q2%(3q::88  584%(3 	2Iryy|11341##%1%Q' 5 MMO7 : LLN		)$Ir||~++-.17GGIDAq!NNN"NNqN!NNN#	 	 / MMOFFHrh   s   debugnamecompletes   NAME...c                  ^ [        5       nUR                  R                  5        H-  u  pEUS:w  d  M  UR                  UR	                  U5      5        M/     UR                  S UR                  5       R                  5        5       5        [        5       nU(       d  S/nU H  mUR                  U4S jU 5       5        M      U R                  SR                  [        U5      5      5        U R                  S5        g)z:complete "names" - tags, open branch names, bookmark namesr  c              3  >   #    U  H  u  pp4U(       a  M  Uv   M     g 7fr   r  )r   tagr\  tipcloseds        rf   r   $debugnamecomplete.<locals>.<genexpr>	  s!      )H%S 	)Hs   	rh   c              3  V   >#    U  H  oR                  T5      (       d  M  Uv   M      g 7fr   )r   )r   r  re   s     rf   r   r  	  s     ?e||A11es   )	)r   N)
r3  namesr1  r   	listnames	branchmapiterbranchesr\   rp   r   )r^   r_   r`   r  r   nscompletionsre   s          @rf   rm  rm  	  s     EE JJ$$&;LLd+, ' 
LL )-)9)F)F)H 
 %Ku?e?? HHUZZ{+,-HHUOrh      debugnodemaps   dump-news1   write a (new) persistent binary nodemap on stdouts	   dump-disks   dump on-disk data on stdouts   checks-   check that the data on disk data are correct.s   metadatas-   display the on disk meta data for the nodemapc                   UR                  S5      (       d,  UR                  S5      (       d  UR                  S5      (       a#  Ub  [        R                  " [        S5      5      eOUc  SUS'   [        R
                  " UR                  5       SU[        R                  " U5      5      n[        U[        R                  [        R                  45      (       a  UR                  nUS   (       ah  [        UR                  S	5      (       a  UR                  R!                  5       nO ["        R$                  " UR                  5      nU R'                  U5        gUS
   (       a3  ["        R(                  " U5      nUb  Uu  puU R'                  USS 5        ggUS   (       a?  ["        R(                  " U5      nUb%  Uu  pu["        R*                  " XR                  U5      $ gUS   (       a  ["        R(                  " U5      nUb  Uu  puU R'                  SUR,                  -  5        U R'                  SUR.                  -  5        U R'                  S[1        UR2                  5      -  5        U R'                  SUR4                  -  5        U R'                  SUR6                  -  5        UR6                  S-  UR4                  -  nU R'                  SU-  5        ggg)z!write and inspect on disk nodemaprZ   r    r  Ns*   cannot specify a file with other argumentsTr  dump_newnodemap_data_all	dump_diskcheckr"   s   uid: %s
s   tip-rev: %d
s   tip-node: %s
s   data-length: %d
s   data-unused: %d
g      Y@s   data-unused: %2.3f%%
)r  r   r  r   r   r  rM  r)   r   r   r    manifestrevlogr   r  r.  ra   r  rK   persistent_datar\   persisted_data
check_datauidtip_revr   tip_nodedata_lengthdata_unused)	r^   r_   r  r   rd   r   nm_datar  unused_percs	            rf   debugnodemapr  	  sR   < xx 4 4""?@   
 [?E83G3G3M	A !h--w?@@IIJ177.//77++-D**1773D
	k	((+"LFHHT!W  
g((+"LF%%b''488  
j	((+"LFHHlfjj01HH&&..89HH'3v+??@HH*f.@.@@AHH*f.@.@@A ,,u4v7I7IIKHH/;>?  
rh   r   s   flagss   markers flags   record-parentss+   record parent information for the precursors   display markers relevant to REVs	   exclusives0   restrict display to markers only relevant to REVs   indexs   display index of the markers   deletes#   delete markers specified by indicess   [OBSOLETED [REPLACEMENT ...]]c                Z	  ^^^ U4S jmUR                  S5      (       a  / nUR                  S5       H  n UR                  [        U5      5        M      TR                  5       (       a  [        R                  " [        S5      5      eTR                  5          [        R                  " TR                  U5      nU R                  [        S5      U-  5        SSS5        gUGb  US	   (       a  [        R
                  " S
5      e0 n[        R                  " US   =(       d    U R!                  5       5      US'   [#        U4S jU 5       5      n	TR                  5       n
 TR%                  S5      n UR                  S5      nU(       a  [&        R(                  " U5      nOSnT" U5      nSnUS   (       a]  UTR+                  5       ;  a  [        R                  " S5      eTR+                  5       U   R-                  5       n[#        S U 5       5      nTR                  R/                  UUU	US   UUUU S9  UR1                  5          UR7                  5          U
R7                  5         gUS	   (       ap  [8        R:                  " TUS	   5      nU Vs/ s H  nTU   R=                  5       PM     nn[?        [@        RB                  " TUUS   S95      nURE                  S S9  O[@        RB                  " T5      nUnS nUR                  S	5      (       a=  UR                  S5      (       a'  [@        RB                  " T5      n[G        U5      mU4S jnU RI                  S[J        RL                  " U5      5      n[O        U5       HU  u  nnU" U5      (       d  M  URQ                  5         UR                  S5      (       a  UOSn[R        RT                  " UUUS9  MW     URW                  5         g! [         a+    [        R
                  " [        S5      U-  [        S5      S9ef = f! , (       d  f       g= f! [         a;  n[        R                  " [        S5      [2        R4                  " U5      -  5      eSnAff = f! UR7                  5         f = f! U
R7                  5         f = fs  snf )z_create arbitrary obsolete marker

With no arguments, displays the list of obsolescence markers.c                   >  [        U 5      n[        U5      TR                  R                  :w  a  [        eU$ ! [         a    [
        R                  " S5      ef = f)Ns>   changeset references must be full hexadecimal node identifiers)r   rU   nodeconstantsnodelen
ValueErrorr   r  )rw  r  r_   s     rf   parsenodeid"debugobsolete.<locals>.parsenodeidY
  s]    	 AA1v++333  H 	""$ 	s	   59 !Adeletes   invalid index value: %rs   use integers for indicesr  s6   cannot delete obsmarkers in the middle of transaction.s    deleted %i obsolescence markers
Nr]   s+   cannot select revision when creating markerr   s   userc              3  4   >#    U  H  nT" U5      v   M     g 7fr   r  )r   succr  s     rf   r    debugobsolete.<locals>.<genexpr>
  s     ?JDk$''Js   r   r   record_parentss2   cannot used --record-parents on unknown changesetsc              3  @   #    U  H  oR                  5       v   M     g 7fr   r  r  s     rf   r   r  
  s     #>gFFHHgr/  r   )r  r   r"   r^   s   bad obsmarker input: %s	exclusive)rC  r  c                    U R                   $ r   )_datar   s    rf   rf  debugobsolete.<locals>.<lambda>
  s    qwwrh   rh  c                    g)NTr  )r   s    rf   rf  r  
  s    trh   ra   c                   > U T;   $ r   r  )r   	markersets    rf   rf  r  
  s	    1	>rh   )ra   ),r  r   r  r  r   r  r   currenttransactionrY   r   r+   deleteobsmarkersobsstorer\   r   	fromlocalrV  tupler   rF   r  rM  r  creater2  rH   r8  r|  r   rA  r   r  r$   
getmarkersr  r3  r   r)   r   	enumerater   r   r   r   )r^   r_   	precursor
successorsr   indicesr8  r  r"   succsr   trr   precr  r  r  rd   rC  r   markerstoiter
isrelevantr   r   r   indr  r  s    `                        @@rf   debugobsoleter  <
  s   : xx(#As1v& $ ""$$++KL  YY[''w?AHHQ;<q@A  	;"">  $..tF|/Lr{{}M?J??IIK$	!!"23B xx'#--d3DD"9-()4??#44#kk2  #oo/5==?G##>g#>>G$$M#% % 	 
 

IIK;&&tT%[9D-12TT!W\\^TE2""k1BG
 LL.L/((.G#
88E??txx00#..t4MGI1J\\*H,@,@,FGm,DAqa== LLNxx((!dCr1C0 - 	C  &&01A567  [ 	P  kk01J4K4KC4PP 
 

IIK 3sZ   O-?P% R 2CP6 R R(-5P"%
P36
Q; 6Q66Q;;Q> >RR R%s   debugp1copiess   revision to debugs   [-r REV]c                    [         R                  " XR                  S5      SS9nUR                  5       R	                  5        H  u  pEU R                  SXT4-  5        M     g)z$dump copy information compared to p1r]   Nr  	   %s -> %s
)r1   r@  r  p1copiesr1  r\   r^   r_   r   rK  dstsrcs         rf   debugp1copiesr  
  L     

D((5/4
@CLLN((*
#+, +rh   s   debugp2copiesc                    [         R                  " XR                  S5      SS9nUR                  5       R	                  5        H  u  pEU R                  SXT4-  5        M     g)z$dump copy information compared to p2r]   Nr  r  )r1   r@  r  p2copiesr1  r\   r  s         rf   debugp2copiesr#  
  r   rh   s   debugpathcomplete   fs   complete an entire paths   normals   show only normal filesr<  s   show only added filesr=  s   show only removed filess   FILESPEC...c                  ^^^ UU4S jnSnTS   (       a  US-  nTS   (       a  US-  nTS   (       a  US-  nTR                  5       mU(       d  S	/n[        5       [        5       pvU H8  nU" X=(       d    S
5      u  pUR                  U	5        UR                  U
5        M:     UR                  U5        U R                  SR	                  UU4S j[        U5       5       5      5        U R                  S5        g)a  complete part or all of a tracked path

This command supports shells that offer path name completion. It
currently completes only files already known to the dirstate.

Completion extends only to the next path segment unless
--full is specified, in which case entire paths are used.c                  > TR                   n[        R                  R                  [        R                  R	                  [
        R                  " 5       U 5      5      nTR                  [        R                  -   nUTR                  :w  a  UR                  U5      (       d  / / 4$ [        R                  R                  U5      (       a  US-  nU[        U5      S  n[        R                  S:g  nU(       a   UR                  [        R                  S5      n[        U5      nTS   n[        5       [        5       pU	R                  UR                  pUR!                  5        H  u  pUR                  U5      (       d  M  UR"                  U;   d  M/  U(       a   UR                  S[        R                  5      nU(       a
  U" U5        Mg  UR%                  [        R                  U5      nUS:  a  U
" US U 5        M  U" U5        M     X4$ )N   /fullr   )r  r9  r   r  rp   r   rW   rootr)   ossepr   isdirrU   replacer3  r  r1  r  find)r   
acceptabler  r*  rootdirfixpathsspeclen	fullpathsr   dirsadddiraddfilerq   r  rw  r   r_   s                  rf   complete#debugpathcomplete.<locals>.complete
  sr   ==wwX__-> EF))hnn,499T__W%=%=r6M77==DLDCLN#>>T)<<5Dd)L	eSUt((EII^^%EA||D!!bhh*&<		$7AAJFF8>>7361Ra5MAJ & {rh   rh   normals   nmrE  r   rF  r  r  s   nmarr   c              3  H   >#    U  H  nTR                  UT5      v   M     g 7fr   )pathto)r   r   cwdr_   s     rf   r   $debugpathcomplete.<locals>.<genexpr>-  s     C]As++]r   N)rW   r3  r   r\   rp   r   )r^   r_   specsr   r6  r.  r   r3  r*  rq   r  r;  s    ` `       @rf   debugpathcompleter>  
  s    &< JH~e
G}d
Id

++-C%43G4QA  
LLHHUZZCVE]CCDHHUOrh   s   debugpathcopiess#   hg debugpathcopies REV1 REV2 [FILE])	inferrepoc                "   [         R                  " X5      n[         R                  " X5      n[         R                  " XdU5      n[        [        R
                  " XgU5      R                  5       5       H  u  pU R                  SX4-  5        M     g)z!show copies between two revisionsr  N)r1   r@  r  r   r   
pathcopiesr1  r\   )r^   r_   rb   rc   r  r   ctx1ctx2r   r  r  s              rf   debugpathcopiesrD  1  so     T(DT(Dd$'A6,,T;AACD
#+, Erh   s	   debugpeerc                Z   SS0nU R                  U5         [        R                  " U 0 U5      n UR                  5       SLnUR	                  5       nU R                  [        S5      UR                  5       -  5        U R                  [        S5      U(       a  [        S5      O
[        S5      -  5        U R                  [        S5      U(       a  [        S5      O
[        S5      -  5        UR                  5          SSS5        g! UR                  5         f = f! , (       d  f       g= f)	z+establish a connection to a peer repository)s   devels   debug.peer-requestTNs   url: %s
s
   local: %s
r  r  s   pushable: %s
)	configoverrider   r.  r   canpushr\   r   r<   r2  )r^   r   	overridesr.  r   rG  s         rf   	debugpeerrI  @  s     	*4I 
		9	%wwr2t$
	JJL,EllnGHHQ|_txxz12HHQ~&u!F)!E(KLHH#$W&	!E(K JJL 
&	% JJL 
&	%s#   DB=D-DDD
D*s   debugpickmergetools    check for files in this revisions   changedeletes!   emulate merging change and deletes   [PATTERN]...c                   0 nUS   (       a3  US   US'   U R                  S[        R                  " US   5      -  5        U R                  US5         [        R
                  R                  S5      nUb(  U R                  S[        R                  " U5      -  5        U R                  SS	5      nU(       a(  U R                  S
[        R                  " U5      -  5        [        R                  " XR                  S5      5      n[        R                  " Xr[        R                  " U5      5      nUS   n	UR                  U5       H  n
Xz   nU R                  (       d  U R                  SS9O[        R                   " 5          ["        R$                  " UU U
UR'                  5       SUR)                  5       ;   U	5      u  pSSS5        U R+                  SU
W4-  5        M     SSS5        g! , (       d  f       N1= f! , (       d  f       g= f)a  examine which merge tool is chosen for specified file

As described in :hg:`help merge-tools`, Mercurial examines
configurations below in this order to decide which merge tool is
chosen for specified file.

1. ``--tool`` option
2. ``HGMERGE`` environment variable
3. configurations in ``merge-patterns`` section
4. configuration of ``ui.merge``
5. configurations in ``merge-tools`` section
6. ``hgmerge`` tool (for historical reason only)
7. default tool for fallback (``:merge`` or ``:prompt``)

This command writes out examination result in the style below::

    FILE = MERGETOOL

By default, all files known in the first parent context of the
working directory are examined. Use file patterns and/or -I/-X
options to limit target files. -r/--rev is also useful to examine
files in another context without actual updating to it.

With --debug, this command shows warning messages while matching
against ``merge-patterns`` and so on, too. It is recommended to
use this option with explicit file patterns and/or -I/-X options,
because this option increases amount of output per file according
to configurations in hgrc.

With -v/--verbose, this command shows configurations below at
first (only if specified).

- ``--tool`` option
- ``HGMERGE`` environment variable
- configuration of ``ui.merge``

If merge tool is chosen before matching against
``merge-patterns``, this command can't show any helpful
information, even with --debug. In such case, information above is
useful to know why a merge tool is chosen.
tool)   uis
   forcemerges   with --tool %r
s   debugmergepatternss   HGMERGENs   with HGMERGE=%r
rL  s   merges   with ui.merge=%r
r]   changedeleteT)r   r   s   %s = %s
)r   r)   r   rF  r   r  r  configr1   r@  r  r   r  r  silentr=   rY  r   	_picktoolisbinaryr   r\   )r^   r_   r  r   rH  hgmergeuimergerK  r   rM  r   fctxrK  toolpaths                 rf   debugpickmergetoolrV  Y  s   j IF|,0L	()
)X-=-=d6l-KLM			9&;	<""&&z2MM.(2B2B72KLM))E8,MM/83C3CG3LMNhhuo6MM#X%9%9$%?@N+HHQKD9D \\   '+'>'>'@A "+!4!4MMODJJL( "A HH\T4L01   
=	<A A 
=	<s%   D.G9 =G(="G9(
G62G99
Hs   debugpushkeys   REPO NAMESPACE [KEY OLD NEW]c           	        [         R                  " U 0 U5      n U(       a  Uu  pgnUR                  5        n	U	R                  SUUUUS.5      R	                  5       n
SSS5        U R                  [        R                  " W
5      S-   5        U
(       + UR                  5         $ [        UR                  U5      R                  5       5       HC  u  pU R                  S[        R                  " U5      [        R                  " U5      4-  5        ME      UR                  5         g! , (       d  f       N= f! UR                  5         f = f)zaccess the pushkey key/value protocol

With two args, list the keys in the given namespace.

With five args, set a key to new if it currently is set to old.
Reports success or failure.
s   pushkey)s	   namespaces   keyr  s   newNr   s   %s	%s
)r   r.  commandexecutorcallcommandresultr   r)   r   r2  r   listkeysr1  r\   rH   	escapestr)r^   r  	namespacekeyinfor   targetr6  r&  newr|  rd   r  r8  s                rf   debugpushkeyra    s    WWRX&F#MCc'')QMM&/ # # #	 &(  * IIh&&q)E125 	 vy9??AB!++A.
0D0DQ0GHI C 	) *)( 	s)   D5 &D$6D5 #A/D5 $
D2.D5 5Es	   debugpvecs   A Bc                   [         R                  " X5      n[         R                  " X5      n[        R                  " U5      n[        R                  " U5      nXg:X  a  SnOXg:  a  SnOXg:  a  SnOXg-  (       a  SnU R	                  [        S5      U-  5        U R	                  [        S5      U-  5        U R	                  [        S5      UR                  UR                  4-  5        U R	                  [        S5      [        UR                  UR                  -
  5      [        R                  " UR                  UR                  5      UR                  U5      W4-  5        g )	N   =   >   <   |s   a: %s
s   b: %s
s   depth(a): %d depth(b): %d
s.   delta: %d hdist: %d distance: %d relation: %s
)r1   r@  r(   ctxpvecr\   r   _depthabs_hamming_vecdistance)	r^   r_   re   r  cacbr   pbrels	            rf   	debugpvecrq    s   			4	#B			4	#B	b	B	b	B	x			HHQz]R HHQz]R HHQ-."))RYY1GGHHH	
<=		BII%&MM"''277+KKO	
	
rh   s&   debugrebuilddirstate|debugrebuildstates   revision to rebuild tos   minimalsE   only rebuild files that are inconsistent with the working copy parentc                   [         R                  " X5      nUR                  5          UR                  5       b  Sn[        R
                  " U5      eUR                  nSnUR                  S5      (       aq  [        UR                  5       R                  5       5      n[        U5      n	X-
  n
X-
  nU Vs1 s H&  oR                  U5      R                  (       a  M$  UiM(     nnX-  nUR                  U5         UR                  UR                  5       UR                  5       U5        SSS5        SSS5        gs  snf ! , (       d  f       N= f! , (       d  f       g= f)a  rebuild the dirstate as it would look like for the given revision

If no revision is specified the first current parent will be used.

The dirstate will be set to the files of the given revision.
The actual working directory content or existing dirstate
information such as adds or removes is not considered.

``minimal`` will only rebuild the dirstate status for files that claim to be
tracked but are not in the parent manifest, or that exist in the parent
manifest but are not in the dirstate. It will not change adds, removes, or
modified files that are in the working copy parent.

One use of this command is to make the next :hg:`status` invocation
check the actual file content.
Ns-   rebuild the dirstate outside of a transactionminimal)r1   r@  r   r  r   ProgrammingErrorr  r  r3  r    ro  	get_entryrE  changing_parentsrebuildr   )r^   r_   r]   r   rK  r   r  changedfilesmanifestfilesdirstatefilesmanifestonlydsonlyrq   
dsnotaddeds                 rf   debugrebuilddirstater~    s   B 

D
&C	""$0BC((--==88I 3 3 56MMM(8L"2F%+OV3E3Ea3H3N3N!VJO'4L&&t,SXXZF - 
 P -, 
s<   BE3#D8D8 E70D='E8E=
E	E
Es   debugrebuildfncaches	   only-datas*   only look for wrong .d files (much faster)c                P    [         R                  " XUR                  S5      5        g)zrebuild the fncache file	only_dataN)r+   rebuildfncacher  r_  s      rf   debugrebuildfncacher  $  s     "DHH[$9:rh   s   debugrenames   [-r REV] [FILE]...c           
         [         R                  " XR                  S5      5      n[         R                  " XB[        R
                  " U5      5      nUR                  U5       H  nXF   nUR                  5       R                  UR                  5       5      nUR                  U5      n	U(       a0  U R                  [        S5      XS   [        US   5      4-  5        M|  U R                  [        S5      U	-  5        M     g)zdump rename informationr]   s   %s renamed from %s:%s
r   r   s   %s not renamed
N)r1   r@  r  r  r)   r   r  r   renamedfilenoder:  r\   r   r   )
r^   r_   r  r   rK  r   ri  rT  orp  s
             rf   debugrenamer  5  s     

D((5/
2Cc!5!5d!;<Axx{xLLN""4==?3kk#HHQ12cQ4QqT5KKLHHQ*+c12 rh   s   debugrequires|debugrequirementsc                d    [        UR                  5       H  nU R                  SU-  5        M     g)z#print the current repo requirementsr'  N)r   r-   r\   )r^   r_   rd   s      rf   debugrequirementsr  I  s)     D%%&
1 'rh      debugrevlog   ds   dumps   dump index datac                    [         R                  " USU[        R                  " U5      5      nUR	                  S5      (       a  [
        R                  " X5        g[
        R                  " X5        g)z'show data and statistics about a revlogr  dumpr   )r   r  r)   r   r  r  r  debug_revlog)r^   r_   r  r   rd   s        rf   debugrevlogr  P  s_     	neX%9%9$%?	A xx"   	!!"(rh      debugrevlogindexs   formats   revlog formats   FORMATs   [-f FORMAT] -c|-m|FILEc                0   [         R                  " USU[        R                  " U5      5      nUR	                  SS5      nUS;  a"  [
        R                  " [        S5      U-  5      eU R                  (       a  [        nO[        nSnU H#  n[        U" UR                  U5      5      5      n  O   US:X  a{  U R                  (       a5  U R                  SSR                  U5      S	R                  U5      4-  5        OU R                  S
SR                  U5      S	R                  U5      4-  5        O^US:X  aX  U R                  (       a$  U R                  SSR!                  U5      -  5        O#U R                  SSR!                  U5      -  5        U GH  nUR                  U5      n	US:X  a   UR#                  U	5      n
U R                  (       ab  U R)                  SUUR+                  U5      UR-                  U5      UR/                  U5      U" U	5      U" U
S   5      U" U
S   5      4-  5        M  U R)                  SUUR/                  U5      U" U	5      U" U
S   5      U" U
S   5      4-  5        M  US:X  d  M  UR1                  U5      nU R                  (       aw  U R)                  SUUR3                  U5      UR+                  U5      UR-                  U5      UR5                  U5      UR/                  U5      US   US   U" U	5      4	-  5        GM  U R)                  SUUR3                  U5      UR5                  U5      UR/                  U5      US   US   U" U	5      4-  5        GM     g! [$         a    UR&                  UR&                  /n
 GNf = f)z#dump the contents of a revlog indexr  r  r   )r   r   s   unknown format %d   s*      rev    offset  length linkrev %s %s p2
s   nodeidr>  s      rev linkrev %s %s p2
r   s?      rev flag   offset   length     size   link     p1     p2 %s
s-      rev flag     size   link     p1     p2 %s
s   % 6d % 9d % 7d % 7d %s %s %s
s   % 6d % 7d %s %s %s
s+   % 6d %04x % 8d % 8d % 8d % 6d % 6d % 6d %s
s!   % 6d %04x % 8d % 6d % 6d % 6d %s
N)r   r  r)   r   r  r   rY   r   r  r   r	   rU   r   r_  r   ljustrjustr  rF  r[  r\   startlengthlinkrevr  r   rawsize)r^   r_   r  r   rd   r  shortfnidlenr   r   r  prs               rf   debugrevlogindexr  c  s5    	!5(*>*>t*D	A XXh"FVkk!01F:;;	|| EGAFF1I&'  {::NN>??5)5;;u+=>?
 NN,??5)5;;u+=>? 
1::NN$ //%(	) NNA//%()
 vvayQ;0YYt_ zz5
		!11	 +		!11	 q[aBzzC

		!		!11
 9
		!		!11	c 
  0kk4;;/0s   .M//"NNs   debugrevspecs   optimizes/   print parsed tree after optimizing (DEPRECATED)s	   show-revss(   print list of result revisions (default)s   show-sets+   print internal representation of result sets   no-optimizeds"   evaluate tree without optimizations   verify-optimizeds   verify optimized results   REVSPECc                	  ^ ^ T R                  S5      mSS 4SUU 4S j4S[        R                  4S[        R                  4S[        R                  4/nUS	   (       a  US
S nUS   (       a)  US	   (       a  [
        R                  " [        S5      5      eU VVs1 s H  u  pVUiM	     nnn[        5       n[        5       n	T R                  (       aI  US   (       d?  UR                  S5        U	R                  SS/5        US   (       a  UR                  S5        US   (       a)  US   (       a  [
        R                  " [        S5      5      eUS   S/:X  a  UR                  U5        OGUS    H*  nXW;  d  M
  [
        R                  " [        S5      U-  5      e   UR                  US   5        0 n
S
n[        R                  " U[        R                  " U5      S9nU Hp  u  pVU" U5      =X'   nXX;   d  XY;   d  M  X:w  d  M$  US   (       d  US:w  a  T R                  SU-  5        T R                  [        R                   " U5      S5        UnMr     US   (       Ga  [        R"                  " U
S   5      " U5      n[        R"                  " U
S   5      " U5      nUS   (       d  US   c_  T R                  (       aN  T R%                  S[&        R(                  " U5      S5        T R%                  S[&        R(                  " U5      S5        [+        U5      n[+        U5      nX:X  a  gT R%                  SSS9  T R%                  SSS9  [,        R.                  " S
X5      nUR1                  5        H{  u  nnnnnUS;   a  UUU  H  nT R                  S U-  S!S9  M     US";   a  UUU  H  nT R                  S#U-  S$S9  M     US%:X  d  M[  UUU  H  nT R                  S&U-  5        M     M}     g'[        R"                  " U5      nU" U5      nUS   (       d  US   c8  T R                  (       a'  T R%                  S([&        R(                  " U5      S5        US)   (       d  g
U H  nT R                  S*U-  5        M     g
s  snnf )+a  parse and apply a revision specification

Use -p/--show-stage option to print the parsed tree at the given stages.
Use -p all to print tree at every stage.

Use --no-show-revs option with -s or -p to print only the set
representation or the parsed tree respectively.

Use --verify-optimized to compare the optimized result with the unoptimized
one. Returns 1 if the optimized result differs.
s   revsetaliasr  c                    U $ r   r  )r  s    rf   rf  debugrevspec.<locals>.<lambda>  s    rh   s   expandedc                H   > [         R                  " U TTR                  5      $ r   )r0   expandaliasesr  )r  aliasesr^   s    rf   rf  r  	  s    11$Irh   s   concatenatedr  r  no_optimizedNr   verify_optimizeds1   cannot use --verify-optimized with --no-optimizedr  r  s'   cannot use --optimize with --show-stager$  r  )rX   r  r   show_sets   * analyzed set:
s   * optimized set:
r   s   --- analyzed
s   diff.file_ari  s   +++ optimized
s   diff.file_b)r  r,  s   -%d
s   diff.deleted)insertr,  s   +%d
s   diff.insertedequals    %d
r   s   * set:
	show_revsrv  )rq  r0   
foldconcatr  r  r   rY   r   r3  r_  r  r   r  r/   lookupfnr\   r  makematcherr   rH   r  r  difflibSequenceMatcherget_opcodes)r^   r_   r  r   r  r  rq   r  r  showchangedtreebystageprintedtreer  arevsbrevssmr  aloahiblobhir4  funcr  r  s   `                       @rf   debugrevspecr    s   Z nn^,G	%&I	
 
*//0	j(()	z**+	F ND$8kkBC
 	
 !''!J'J%K	zz$|,y!K9:
NN<(Ld:.kk!FGHHLfX%*%l#A"kk!$=">"BCC $ 	$|,-KKD)>?D !$'?q/D4GL!Q)^a(HHZ,,T2E:K  "";{#;<TB"";|#<=dC
Z 0 8RZZNN$j&;&;E&BE NN%z'<'<U'CU UU>
(?
)@$$T58')~~'7#Cc3++s3AHHX\HA (++s3AHHX\1AHB (g~s3AHHX\* ( (8 d#D:DJD,4
{J$9$9$$?G
1 E (s   Q>
   debugserves   sshstdios*   run an SSH server bound to process handless   logiofds$   file descriptor to log server I/O tos	   logiofiles   file to log server I/O toc                R   US   (       d  [         R                  " [        S5      5      eSnUS   (       a)  US   (       a  [         R                  " [        S5      5      eUS   (       a&   [        R                  " [        US   5      SS5      nOUS   (       a  [        US   SS5      n[        R                  " XUS
9nUR                  5         g! [         aM  nUR                  [        R                  :w  a  e [        R                  " [        US   5      S	S5      n SnANxSnAff = f)zrun a server with advanced settings

This command is similar to :hg:`serve`. It exists partially as a
workaround to the fact that ``hg serve --stdio`` must have specific
arguments for security reasons.
sshstdios&   only --sshstdio is currently supportedNlogiofd	logiofiles)   cannot use both --logiofd and --logiofileru  r   rx  )logfh)r   rY   r   r9  fdopenr  r  errnoESPIPErk   rA   	sshserverserve_forever)r^   r_   r   r  r|  rw  s         rf   
debugserver  [  s    * 
kk!EFGGEI4,kk!HIJJI
	=IIc$y/2D!<E 
k	T+&a0!!"%8AOO  	=ww%,,&IIc$y/2D!<E		=s   *$C 
D&AD!!D&s   debugsetparentss   REV1 [REV2]c                   [         R                  " X5      R                  5       n[         R                  " XS5      R                  5       nUR                  5          UR	                  XE5        SSS5        g! , (       d  f       g= f)a  manually set the parents of the current working directory (DANGEROUS)

This command is not what you are looking for and should not be used. Using
this command will most certainly results in slight corruption of the file
level histories within your repository. DO NOT USE THIS COMMAND.

The command updates the p1 and p2 fields in the dirstate, without touching
anything else. This useful for writing repository conversion tools, but
should be used with extreme care. For example, neither the working
directory nor the dirstate is updated, so file statuses may be incorrect
after running this command. Use it only if you are one of the few people who
deeply understands both conversion tools and file level histories. If you are
reading this help, you are not one of those people (most of them sailed west
from Mithlond anyway).

So, one more time, DO NOT USE THIS COMMAND.

Returns 0 on success.
s   nullN)r1   r@  r   r   
setparents)r^   r_   rb   rc   node1node2s         rf   debugsetparentsr    sW    , d)..0Ed'2779E	% 
s   A55
Bs   debugsidedatac                   UR                  S5      (       d,  UR                  S5      (       d  UR                  S5      (       a&  Ub  [        R                  " [        S5      5      eSUp2O"Uc  [        R                  " [        S5      5      e[        R
                  " USU[        R                  " U5      5      n[        USU5      n UR                  UR                  U5      5      nU(       a  [        UR                  " 5       5      nUR                  " 5         U R!                  S
[#        U5      -  5        U H_  u  pxU R!                  SU[#        U5      4-  5        U R$                  (       d  M7  U R!                  S[&        R(                  " U5      -  5        Ma     gg! [         a#    [        R                  " [        S	5      U-  5      ef = f)z_dump the side data for a cl/manifest/file revision

Use --verbose to dump the sidedata content.rZ   r    r  Nr  r  r  r  r  s   %d sidedata entries
s    entry-%04o size %d
r-  )r  r   r  r   r   r  r)   r   r  rM   rX   r  rY   r  r1  r  r   rU   r_  rH   r[  )	r^   r_   r  r]   r   rd   rM   r6  r  s	            rf   debugsidedatar    sv   
 xx 4 4?""CD  5s	q!=>??lE8#7#7#=	A 	9a AF::ahhsm, ()
/#h-?@"JCNN3sCJ6GGHzzzy:+<+<U+CCD #	   Fkk!=>DEEFs    F -G	   debugssls   [SOURCE]c                   [         R                  (       d  [        R                  " [	        S5      5      eU(       d(  U(       d  [        R                  " [	        S5      5      eSn[
        R                  " SX5      nUR                  nSSS.nUR                  U;   a8   UR                  [        UR                  =(       d    XeR                     5      4nO[        R                  " [	        S	5      5      eS
SKJn  [        R                   " ["        R"                  " 5       [        R$                  [        R&                  SS9n	 U	R)                  U5        U	R+                  S5      n
U R-                  [	        S5      UR                  -  5        UR/                  U
SS9nU(       df  U R-                  [	        S5      5        UR/                  U
5      (       d  U R-                  [	        S5      5        O5U R-                  [	        S5      5        OU R-                  [	        S5      5        U	R1                  5         g! [         a     [        R                  " [	        S5      5      ef = f! U	R1                  5         f = f)a  test a secure connection to a server

This builds the certificate chain for the server on Windows, installing the
missing intermediates and trusted root via Windows Update if necessary.  It
does nothing on other platforms.

If SOURCE is omitted, the 'default' path will be used.  If a URL is given,
that server is used. See :hg:`help urls` for more information.

If the update succeeds, retry the original operation.  Otherwise, the cause
of the SSL error is likely another issue.
s6   certificate chain building is only possible on Windowss>   there is no Mercurial repository here, and no server specifiedr   r  i     )   httpss   sshs   malformed port number in URLs,   only https and ssh connections are supportedr   )win32N)ssl_version	cert_reqsca_certsTs&   checking the certificate chain for %s
F)builds-   certificate chain is incomplete, updating... s   failed.
s   done.
s$   full certificate chain is available
)r)   	iswindowsr   rY   r   rI   rO  r<   schemer  r  portr  r  r  sslwrap_socketr  PROTOCOL_TLS	CERT_NONEconnectgetpeercertr   checkcertificatechainr2  )r^   r_   r  r   r   r<   defaultportaddrr  rw  certr6  s               rf   debugsslr    s    kkGH
 	
 ++(  ++KDD
((C "-K
zz[ 	BHHc#(("Ek**.EFGD kk!KLMM$$--		A			$}}T"
		!>?#((JK..t5.AIIaHIJ..t44		!L/*		!J-(IIa@AB		A  	B++a ?@AA	B@ 	
	s   6H1  C I 1*II0s   debug::stable-tail-sort   Ts   templates   {rev}
s   display with templates   TEMPLATEc                    [         R                  " X5      R                  5       nUR                  n[         R                  " XU5      n[
        R                  " Xe5      nU H  n	UR                  X   5        M     g)z=display the stable-tail sort of the ancestors of a given nodeN)r   r@  r]   rZ   maketemplaterrC   _stable_tail_sort_naiveshow)
r^   r_   revspecrQ  r   r]   r   	displayersorted_revsancestor_revs
             rf   debug_stable_tail_sortr    sa     

t
-
1
1
3C	B((8<I 88AK#t)* $rh   s   debug::stable-tail-sort-leapss   {rev}s   specifics   restrict to specific leapsc                p   [         R                  " X5      R                  5       nU(       a  [        R                  nO[        R
                  n[         R                  " XU5      nU" UR                  U5       H<  u  pUR                  X   5        UR                  X   5        U R                  S5        M>     g)zAdisplay the leaps in the stable-tail sort of a node, one per liner   N)
r   r@  r]   rC   _find_specific_leaps_naive_find_all_leaps_naiver  rZ   r  r\   )r^   r_   rspecrQ  specificr   r]   	get_leapsr  r  r_  s              rf   debug_stable_tail_sort_leapsr  &  s      

t
+
/
/
1C"==	"88	((8<I#DNNC8t|$t|$
 9rh      debugbackupbundle)rh   s   recoverrh   s7   brings the specified changeset back into the repositorys%   hg debugbackupbundle [--recover HASH]c                Z  ^^^ [        [        [        R                  R                  [
        R
                  " TR                  R                  S5      S-   5      5      5      nUR                  S SS9  STS'   STS	'   [        R                  " [        R                  " T5      5      mUUU4S
 jnTR                  S5      nU(       a;  [        R                  " TU5      (       a  U R!                  [#        S5      U-  5        gO>U(       a  [#        S5      nU R%                  USS9  OU R%                  [#        S5      5        gU GH  n[        R                  R'                  U[(        R*                  " 5       5      n	[,        R.                  " SU U	5      n
 [0        R2                  " T[        R                  " T5      U
5      nU
R>                  TR                  S/ 5      4n[0        R@                  " TXTR                  S5      5      u  nnU(       a!  U Vs/ s H  nURC                  U5      PM     nnU RE                  5           [F        RH                  " U TXTS   TS	   5      u  nnn SSS5         W(       d   W" 5         GM>  U(       Ga/  TRK                  5          TRM                  S5       n[        R                  " X5      (       a  U R%                  [#        S5      U-  5        [0        RN                  " X
R8                  5      n[P        RR                  " U UU
R8                  5      n[U        U[V        RX                  5      (       a&  [V        RZ                  " TUUSSU
R8                  -   S9  O UR]                  TSSU
R8                  -   5         SSS5        SSS5        W" 5           g SSS5        SSS5        GO[(        R^                  " [`        Rb                  " S[`        Rd                  " [        R                  Rg                  U
R8                  5      5      5      5      nU R%                  SURi                  S5      -  5        U Rj                  (       a0  U R%                  SSRi                  S5      U
R8                  4-  5        OS TS!'   [        Rl                  " X[        R                  " T5      S"5      nU" UUU5        URo                  5         W" 5         GM     g! [4        R6                   aT  n[#        S5      U
R8                  -  n[#        S5      [;        UR<                  5      -  nU R!                  X}S9   SnAGM  SnAff = fs  snf ! [4        R6                   a     SSS5        GM'  f = f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       N= f! W" 5         f = f)#ao  lists the changesets available in backup bundles

Without any arguments, this command prints a list of the changesets in each
backup bundle.

--recover takes a changeset hash and unbundles the first bundle that
contains that hash, which puts that changeset back in your repository.

--verbose will print the entire commit message and the bundle path for that
backup.
s   strip-backups   /*.hgc                @    [         R                  R                  U 5      $ r   )r9  r   getmtimer  s    rf   rf  #debugbackupbundle.<locals>.<lambda>b  s    rww//2rh   T)r6  reverserh   r  Nr(  c                ~  > TR                  S5      (       a  UR                  5         SnU H  nTb  UT:  a    g U R                  R                  U5       Vs/ s H  oUT	R                  :w  d  M  SPM     nnTR                  S5      (       a  [        U5      S:X  a  Mq  US-  nUR                  X   5        M     g s  snf )Nnewest_firstr   T	no_mergesrS   r   )r  r  rZ   r  r[  rU   r  )
r   chlistr  countr  r   r  limitr   r_   s
          rf   display"debugbackupbundle.<locals>.displayh  s    88N##NNA Ue^#oo55a88<L8   xx$$W):QJENN58$ s   B:.B:recovers   %s already exists in the repo
sg   Recover changesets using: hg debugbackupbundle --recover <changeset hash>

Available backup changesets:s   status.removedri  s   no backup changesets found
r  s"   
warning: unable to open bundle %ss   
(missing parent rev %s)
r  rP  r]   s   unbundles   Unbundling %s
s   bundle:)r  r<   z%a %H:%M, %Y-%m-%ds   
%s
2   r      s8   {label('status.modified', node|short)} {desc|firstline}
rQ  F)8r  filterr9  r   isfileglobr?   rp   r  r   getlimitr)   r   r  r1   isrevsymbolr  r   r   relpathr   rW   rI   rO  r   r.  r   r7  rR  r	   r   rP  rU  rX   rO  r   getremotechangesr   r   rt   r   ru   r   r
   r   applybundlerv   r  rm   r   r  r  r  r_  changesetdisplayerr2  )r^   r_   r  r   backupsr  recovernoder   backupr  r   r   exr  r  r  checkoutr]   r  	cleanupfnr  rq   rx   
backupdater  r  s    ` `                     @rf   debugbackupbundler  D  sv   2 GGNNDIIdhhmmO&Dx&OP	
G
 LL2DLADNDM 4 4T :;E% ((9%Kt[11GGA89KGH 2 
@
 			#.	/
		!345):;// 

	GGD("6"6t"<dCE KK(B!78))%488E?
h 156#ELL%D6YY[+5+F+Fe4>4=,(vy (	L KK YY[$"2"2;"?2**5>>		!$6"7;"GHKKHH5&11"aB%c7+=+=>>#// $ # "'2$.$9  IIdKdhh9NO #@[H KG ? #@[[" &00MM,rww'7'7'AB
 		)z'7'7';<=::IIi:+;+;B+?*JJK U " '99x33D95	 vy1!KO     	:;dhhFC34uRWW~EDGGCG#		 7 $$  [
 [ #@"?[[H Ks   ,SU=U,?$U-V!?V!V)C!U>
VV!$V,DV!U ,AT;;U U)U,(U))U,,
U;	>
VV
V	V!!	V*s   debugsubs   revision to checks   [-r REV] [REV]c                   [         R                  " XS 5      n[        UR                  R	                  5       5       HG  u  pEU R                  SU-  5        U R                  SUS   -  5        U R                  SUS   -  5        MI     g )Ns   path %s
s    source   %s
r   s    revision %s
r   )r1   r@  r   r  r1  r   )r^   r_   r]   rK  r  r8  s         rf   debugsubr    sq     

Dt
,Cs||))+,
|a'(
(1Q4/0
(1Q4/0 -rh   s
   debugshellr(     commands   program passed in as a strings   COMMANDs   [-c COMMAND]c                   SSK nU US.n[        [        SS5      S:X  a5   SSKnUR	                  5         UR                  5         UR                  5         UR                  S5      nU(       aD  UR                  [        R                  " U5      5      nUR                  US9R                  U5        gUR                  US9  g! [         a    Sn Nzf = f)	zrun an interactive Python interpreter

The local namespace is provided with a reference to the ui and
the repo instance (if available).
r   N)r^   r_   frozenconsole_execommand)locals)r   )coder  r  sitesetcopyright	sethelpersetquitr@  r  compile_commandr   strfromlocalInteractiveInterpreterruncodeinteract)r^   r_   r   r   imported_objectsr!  r  compileds           rf   
debugshellr,    s    (   sHd#}4	NNLLN hhy!G''(=(=g(FG##+;#<DDXNMM(M)  	D	s   4C   CC   debug-revlog-statsr   s   Display changelog statisticsr   s   Display manifest statisticss   filelogss   Display filelogs statisticsc                    US   nUS   nUS   nUc  Uc	  Uc  SnSnSnUR                  5       nU R                  S[        R                  " U5      5      n[        R
                  " XX4U5        UR                  5         g)z-display statistics about revlogs in the storerZ   r    filelogsNTr-  )rM  r   r)   r   r  debug_revlog_statsr   )r^   r_   r   rZ   r    r/  r   s          rf   r0  r0    s     [!IJHJHX-(2B	??D	+X-A-A$-G	HB##Di8LFFHrh   s   debugsuccessorssetss   closests#   return closest successors sets onlys   [REV]c                   0 n[         n[        n[        R                  " X5       H  nX   nU R	                  SU" U5      -  5        [
        R                  " XR                  5       US   US9 Hz  n	U	(       a_  U R	                  S5        U R	                  U" U	S   5      5        U	SS  H+  n
U R	                  S5        U R	                  U" U
5      5        M-     U R	                  S	5        M|     M     g)
a%  show set of successors for revision

A successors set of changeset A is a consistent group of revisions that
succeed A. It contains non-obsolete changesets only unless closests
successors set is set.

In most cases a changeset A has a single successors set containing a single
successor (changeset A replaced by A').

A changeset that is made obsolete with no successors are called "pruned".
Such changesets have no successors sets at all.

A changeset that has been "split" will have a successors set containing
more than one successor.

A changeset that has been rewritten in multiple different ways is called
"divergent". Such changesets have multiple successor sets (each of which
may also be split, i.e. have multiple successors).

Results are displayed as follows::

    <rev1>
        <successors-1A>
    <rev2>
        <successors-2A>
        <successors-2B1> <successors-2B2> <successors-2B3>

Here rev2 has two possible (i.e. divergent) successors sets. The first
holds one element, whereas the second holds three (i.e. the changeset has
been split).
r'  closest)r2  r  s       r   r   Nr   r   )r  r	   r   rA  r\   r$   successorssetsr   )r^   r_   r  r   r  ctx2strnode2strr]   rK  succssetr   s              rf   debugsuccessorssetsr7  *  s    L EGH""4.i
73<'(..((*d9oU
H !(1+./$QRLDHHTNHHXd^, ) HHUO
 /rh   s   debugtagscachec                p   [         R                  " UR                  5       5      nUR                  S5      nU H{  nX   R	                  5       nUR                  USS9nU(       a'  [        U5      nUR                  U5      (       d  US-  nOUc  SnOSnU R                  SU[        U5      U4-  5        M}     g)	z/display the contents of .hg/cache/hgtagsfnodes1s   .hgtagsF)computemissings    (unknown node)Nr&  s   invalids	   %d %s %s
)	tagsmodhgtagsfnodescacherM  r  r   getfnoder   hasnoder\   )r^   r_   r  flogrd   r   tagsnodetagsnodedisplays           rf   debugtagscacherA  b  s     %%doo&78E99Z Dw||~>>$u>=!(mO<<))#55(O(O
!SY!@@A rh   s   debugtemplates   apply template on changesets   Ds   defines   define template keywords	   KEY=VALUEs&   [-r REV]... [-D KEY=VALUE]... TEMPLATEc                   SnUS   (       a;  Uc  [         R                  " [        S5      5      e[        R                  " XS   5      n0 nUS    H6  n S UR                  SS5       5       u  pxU(       a  US:X  a  [        eXU'   M8     U R                  (       a  U R                  S
5      n	[        R                  " U5      n
U R                  [        R                  " U
5      S5        [        R                  " X5      nX:w  a'  U R                  S[        R                  " U5      S5        Uc  [         R"                  " X5      n[         R$                  " XUS9nU R                  (       aj  UR'                  5       u  pU R)                  SSR+                  [-        U5      5      -  5        U R)                  SSR+                  [-        U5      5      -  5        U R/                  UR1                  U5      5        g[        R$                  " XU5      nU R                  (       at  UR2                  R'                  5       u  pU R)                  SSR+                  [-        U5      5      -  5        U R)                  SSR+                  [-        U5      5      -  5        U H-  nUR4                  " UU   40 [6        R8                  " U5      D6  M/     UR;                  5         g! [         a#    [         R                  " [        S	5      U-  5      ef = f)zparse and apply a template

If -r/--rev is given, the template is processed as a log template and
applied to the given changesets. Otherwise, it is processed as a generic
template.

Use --verbose to print the parsed tree.
Nr]   rT   definec              3  @   #    U  H  oR                  5       v   M     g 7fr   )r7   r  s     rf   r    debugtemplate.<locals>.<genexpr>  s     8'7!GGII'7r/  rc  r   rL  s    malformed keyword definition: %ss   templatealiasr   s   * expanded:
)	resourcess   * keywords: %s
r  s   * functions: %s
)r   	RepoErrorr   r   rA  r   r  rY   r_  rq  r9   r  noter  r  r   r   templateresourcesr  symbolsuseddefaultr   rp   r   r\   renderdefaultrf  r  r)   r^  r2  )r^   r_   tmplr   r  propsr  r  r8  r  r  newtreetresrf  kwdsfuncsr  rd   s                     rf   debugtemplaterS  v  s\   $ DE{<//JK  ""4e5E(^	J8qwwtQ'78DAU
  !H  
zz..!12t$
	&&t,e4))$8?MM )"8"8"A5 |**24##B=::..0KDNN.F4L1IIJNN/%**VE]2KKL
'(,,Rt<	::#++88:KDNN.F4L1IIJNN/%**VE]2KKLANN47@h&8&8&?@ ;  	J++a CDqHII	Js   2K-L s   debuguigetpasss   prompts   prompt texts   TEXTs	   [-p TEXT]c                X    U R                  U5      nUc  SnU R                  SU-  5        g)zshow prompt to type passwordNs   <default response>   response: %s
)getpassr   r^   r  rd   s      rf   debuguigetpassrX    s.     	

6Ay!NN$q()rh   s   debuguipromptc                N    U R                  U5      nU R                  SU-  5        g)zshow plain promptrU  N)r  r   rW  s      rf   debuguipromptrZ    s$     			&ANN$q()rh   s   debugupdatecachesc                    UR                  5          UR                  5          UR                  [        R                  S9  SSS5        SSS5        g! , (       d  f       N= f! , (       d  f       g= f)z'warm all known caches in the repository)cachesN)r   r   updatecachesrB   
CACHES_ALL)r^   r_   r  r   s       rf   debugupdatecachesr_    s?     
tyy{!6!67 #{{s"   A"A A"
A	A""
A0s   debugupgraderepos   extra optimization to performs   runs   performs an upgrades   backups&   keep the old repository content arounds    select the changelog for upgrades   select the manifest for upgrades   select all filelogs for upgradec                J    [         R                  " X4U[        U5      US.UD6$ )a  upgrade a repository to use different features

If no arguments are specified, the repository is evaluated for upgrade
and a list of problems and potential optimizations is printed.

With ``--run``, a repository upgrade is performed. Behavior of the upgrade
can be influenced via additional arguments. More details will be provided
by the command output when run without ``--run``.

During the upgrade, the repository will be locked and no writes will be
allowed.

At the end of the upgrade, the repository may not be readable while new
repository data is swapped in. This window will be as long as it takes to
rename some directories inside the ``.hg`` directory. On most machines, this
should complete almost instantaneously and the chances of a consumer being
unable to access the repository should be low.

By default, all revlogs will be upgraded. You can restrict this using flags
such as `--manifest`:

  * `--manifest`: only optimize the manifest
  * `--no-manifest`: optimize all revlog but the manifest
  * `--changelog`: optimize the changelog only
  * `--no-changelog --no-manifest`: optimize filelogs only
  * `--filelogs`: optimize the filelogs only
  * `--no-changelog --no-manifest --no-filelogs`: skip all revlog optimizations
)runr  r  )r;   upgraderepor3  )r^   r_   ra  r  r  r   s         rf   debugupgradereporc    s3    \ 
CM&DH rh   s   debug::unbundles   FILE...)helpcategoryc                >    U4U-   n[         R                  " XU5        g)z~same as `hg unbundle`, but pretent to come from a push

This is useful to debug behavior and performance change in this case.
N)r   unbundle_files)r^   r_   fname1fnamess       rf   debugunbundleri    s      YF2V,rh   s	   debugwalks   [OPTION]... [FILE]...c                   [         R                  " US   U[        R                  " U5      5      nU R                  (       a'  U R                  S[        R                  " U5      S5        [        US   R                  U5      5      nU(       d  gS nU R                  SS5      (       a  [        R                  S:w  a  S nS	[        U Vs/ s H  n[        U5      PM     sn5      [        U Vs/ s H  n[        UR                  U5      5      PM     sn5      4-  nU Hc  nUUU" UR                  U5      5      UR                  U5      =(       a    S
=(       d    S4-  n	U R!                  SU	R#                  5       -  5        Me     gs  snf s  snf )z&show how files match on given patternsNr  r   c                    U $ r   r  r   s    rf   rf  debugwalk.<locals>.<lambda>)  s    2rh   rL  s   slashr'  c                .    [         R                  " U 5      $ r   )r=   r  rl  s    rf   rf  rm  +  s    t}}R(rh   s   f  %%-%ds  %%-%ds  %%ss   exactrh   r'  )r1   r  r)   r   r_  r   rH   r  r  r  r   r*  r}  rU   r:  exactr\   rstrip)
r^   r_   r  r   r   r1  rq   ri  r$  r  s
             rf   	debugwalkrq    s>   
 	d4j$(<(<T(BCA	zz

(=(=a(@%Hd#$EA	}}UH%%(..D*@(
#'#SX'(e4esSS!"e45' C dkk#GGCL%X,
 

 	4;;=()  (4s   F
,$F	s   debugwhyunstablec           	        [         R                  " U[        R                  " X5      5       HY  nSnUR	                  S5      (       a  SR                  S US    5       5      S-   nU R                  SUS   XCS   US   4-  5        M[     g	)
z$explain instabilities of a changesetrh   s   divergentnodesr   c              3  h   #    U  H(  nS UR                  5       UR                  5       4-  v   M*     g7f)s   %s (%s)N)r   phasestr)r   rK  s     rf   r   #debugwhyunstable.<locals>.<genexpr>@  s-      7 #'')S\\^!<<7s   02s   %s: %s%s %s
s   instabilitys   reasons   nodeN)r$   whyunstabler1   r@  r  rp   r\   )r^   r_   r]   r  dnodess        rf   debugwhyunstablerx  9  s     $$T7+<+<T+GH99&''		 $%67  	  	^$fI.>gOP	
 Irh   s   debugwireargs))rh      threerh   ry  )rh      fourrh   rz  )rh      fiverh   r{  s   REPO [OPTIONS]... [ONE [TWO]]c                   [         R                  " U [        R                  " U5      U5      n [        R
                   H  nU[        R                  " US   5      	 M     0 nUR                  5        H  u  pxU(       d  M  XU'   M     UR                  " U0 UD6n	UR                  " U0 UD6n
U R                  SU	-  5        X:w  a  U R                  SU
-  5        UR                  5         g ! UR                  5         f = f)Nr   r'  )r   r.  r)   r   r   
remoteoptsr6  r1  debugwireargsr\   r  r2  )r^   r  valsr   r_   optr`   r  r8  res1res2s              rf   r~  r~  L  s     772x++D18<D%%CX__SV,- &JJLDAqQ !
 !!4040!!4040
4 <GGGdN#



s   AC) ?AC) )C;c              #    #    S n/ nSnU  H  nUR                  5       nU(       d  M  UR                  S5      (       a  M4  UR                  S5      (       d  U(       a  X4v   Un/ nSnM^  U(       d  [        R                  " [	        S5      5      e[        U5      [        UR                  5       5      -
  nXS:  a$  U(       a  US==   UR                  5       -  ss'   M  UR                  U5        UnM     U(       a  X4v   g g 7f)Nr      #r   s   indented line outside of blockr   )rp  r   r   rY   r   rU   lstripr   )r|  activeaction
blocklines
lastindentr  r   s         rf   _parsewirelangblocksr  k  s     LJJ{{}??4  t$$"..LJJ ++a ABCCTS// :rNdkkm+Nd#J= B && s   D Ds   debugwireprotos   localsshs!   start an SSH server for this repos   peers(   construct a specific version of the peers   noreadstderrs%   do not read from stderr of the remotes   nologhandshakes,   do not log I/O related to the peer handshakec                  ^+ US   (       a&  U(       d  [         R                  " [        S5      5      eUS   (       a0  US   S;  a'  [         R                  " [        S5      [        S5      S9eU(       a)  US   (       a  [         R                  " [        S5      5      eU R                  5       (       a  U R	                  [        S	5      5        [        [        U R                  5      5      nS
nS
nS
nS
nS
n	US   (       Ga  [        R                  " 5       SUR                  SS/-   n
[        R                  " [        R                  " [        R                  U
5      [        R                   [        R                   [        R                   SS9nUR"                  nUR$                  nUR&                  nU R(                  (       d	  US   S:X  a`  [*        R,                  " XR"                  SSS9n[*        R,                  " XR$                  SSS9n[*        R,                  " XR&                  SSS9nSnUS   (       + nUS   S:X  a7  U R	                  [        S5      5        [.        R0                  " U UUUUUS
US9nGOUS   S:X  a  U R	                  [        S5      5        S
nGOU R	                  [        S5      5        [.        R2                  " U UUUUUUS9nGOkU(       GaD  [4        R6                  " U5      nUR8                  S;  a  [         R                  " [        S5      5      eUR;                  5       u  pSS 0nU R(                  (       a  UR=                  U S!SS"S#.S$.5        U R>                  (       a  SUS%   S&'   US   S:X  a  S"US''   [@        RB                  " X40 UD6n	US   S:X  a  U R	                  [        S5      5        S
nO{US   (       a%  [         R                  " [        S(5      US   -  5      e[4        RD                  " X5      n[F        R2                  " U UU	S)9nO[         R                  " [        S*5      5      eS
nU GHi  u  nnUS+;   a  U(       d  [         R                  " [        S,5      5      eS-RI                  S. U 5       5      n[J        RL                  " U5      nUR	                  U5        US/:X  a  URO                  5         M  M  US0:X  a8  U(       d  [         R                  " [        S15      5      eURO                  5         M  URQ                  S25      (       Ga!  U(       d  [         R                  " [        S35      5      eURS                  S4S55      S5   n0 n
U H  nURU                  5       RS                  S4S55      n[W        U5      S5:X  a  US   nS-nOUu  nnURQ                  S65      (       a  [J        RX                  " US7S
 5      nO[J        RL                  " U5      nUU
U'   M     Ub  UR[                  UU
45        GM  U R]                  [        S85      U-  5        S9U
;   a  [_        U
S9   S:5       nU
S9	 UR`                  " UU40 [        Rb                  " U
5      D6u  nnU R]                  [        S;5      [J        Rd                  " U5      -  5        U R]                  [        S<5      [J        Rd                  " U5      -  5        S
S
S
5        GM  URg                  5        nURi                  UU
5      Rk                  5       nS
S
S
5        U R]                  [        S=5      [J        Rl                  " WSS>S?9-  5        GM  US@:X  a'  Ub  [         R                  " [        SA5      5      e/ nGM/  USB:X  a  U R]                  [        SC5      [W        U5      -  5        Uc   e[o        URq                  U5      5       H9  u  nn U R]                  [        SD5      U[J        Rd                  " U 5      4-  5        M;     S
nGM  URQ                  SE5      (       Ga  U	(       d  [         R                  " [        SF5      5      eURS                  S4S>5      n![W        U!5      SG:w  a  [         R                  " [        SH5      5      eU!S5S
 u  m+n"0 n#S
n$/ n%U GH,  nURU                  5       n[r        Rt                  " SIU5      n&U&(       aQ  [        Rv                  " U&Ry                  S55      5      n[        Rv                  " U&Ry                  S>5      5      nUU#U'   M  URQ                  SJ5      (       a(  [*        Rz                  " URS                  S4S55      5      n$M  URQ                  SK5      (       a6  [|        R~                  " U[W        SK5      S
 5      n'U%R[                  U'5        GM  [         R                  " [        SL5      U-  5      e   UU"-   nU%(       a  S-RI                  SM U% 5       5      n$[@        R                  R                  [        Rv                  " U5      U$U#5      n(U+4SN jU(lB         U	R_                  U(5      nUR                  5       n$UR                  R                  SQ5      n)U)SR:X  aH  U R	                  [        SS5      [J        Rl                  " [        R                  " U$5      SS>S?9-  5        GMi  GMl  UST:X  a  Uc   eUR                  5         GM  USU:X  a`  U(       a  U(       d  [         R                  " [        SV5      5      eUR                  5         UR                  5         UR                  5         GM  USW:X  a9  U(       d  [         R                  " [        SX5      5      eUR                  5         GM/  USY:X  a9  U(       d  [         R                  " [        SZ5      5      eUR                  5         GMn  URQ                  S[5      (       aX  [        URS                  S4S55      S5   5      n*U(       d  [         R                  " [        S\5      5      eUR                  U*5        GM  URQ                  S]5      (       aX  [        URS                  S4S55      S5   5      n*U(       d  [         R                  " [        S^5      5      eUR                  U*5        GMJ  [         R                  " [        S_5      U-  5      e   Ub  [         R                  " [        S`5      5      eU(       a  UR                  5         U(       a  UR                  5         g
g
! , (       d  f       GM  = f! , (       d  f       GN= f! [*        R                  R                   a  n[        USOSP 5      " 5          S
nAG	M  S
nAff = f)aa  send wire protocol commands to a server

This command can be used to issue wire protocol commands to remote
peers and to debug the raw data being exchanged.

``--localssh`` will start an SSH server against the current repository
and connect to that. By default, the connection will perform a handshake
and establish an appropriate peer instance.

``--peer`` can be used to bypass the handshake protocol and construct a
peer instance using the specified class type. Valid values are ``raw``,
``ssh1``. ``raw`` instances only allow sending raw data payloads and
don't support higher-level command actions.

``--noreadstderr`` can be used to disable automatic reading from stderr
of the peer (for SSH connections only). Disabling automatic reading of
stderr is useful for making output more deterministic.

Commands are issued via a mini language which is specified via stdin.
The language consists of individual actions to perform. An action is
defined by a block. A block is defined as a line with no leading
space followed by 0 or more lines with leading space. Blocks are
effectively a high-level command with additional metadata.

Lines beginning with ``#`` are ignored.

The following sections denote available actions.

raw
---

Send raw data to the server.

The block payload contains the raw data to send as one atomic send
operation. The data may not actually be delivered in a single system
call: it depends on the abilities of the transport being used.

Each line in the block is de-indented and concatenated. Then, that
value is evaluated as a Python b'' literal. This allows the use of
backslash escaping, etc.

raw+
----

Behaves like ``raw`` except flushes output afterwards.

command <X>
-----------

Send a request to run a named command, whose name follows the ``command``
string.

Arguments to the command are defined as lines in this block. The format of
each line is ``<key> <value>``. e.g.::

   command listkeys
       namespace bookmarks

If the value begins with ``eval:``, it will be interpreted as a Python
literal expression. Otherwise values are interpreted as Python b'' literals.
This allows sending complex types and encoding special byte sequences via
backslash escaping.

The following arguments have special meaning:

``PUSHFILE``
    When defined, the *push* mechanism of the peer will be used instead
    of the static request-response mechanism and the content of the
    file specified in the value of this argument will be sent as the
    command payload.

    This can be used to submit a local bundle file to the remote.

batchbegin
----------

Instruct the peer to begin a batched send.

All ``command`` blocks are queued for execution until the next
``batchsubmit`` block.

batchsubmit
-----------

Submit previously queued ``command`` blocks as a batch request.

This action MUST be paired with a ``batchbegin`` action.

httprequest <method> <path>
---------------------------

(HTTP peer only)

Send an HTTP request to the peer.

The HTTP request line follows the ``httprequest`` action. e.g. ``GET /foo``.

Arguments of the form ``<key>: <value>`` are interpreted as HTTP request
headers to add to the request. e.g. ``Accept: foo``.

The following arguments are special:

``BODYFILE``
    The content of the file defined as the value to this argument will be
    transferred verbatim as the HTTP request body.

``frame <type> <flags> <payload>``
    Send a unified protocol frame as part of the request body.

    All frames will be collected and sent as the body to the HTTP
    request.

close
-----

Close the connection to the server.

flush
-----

Flush data written to the server.

readavailable
-------------

Close the write end of the connection and read all available data from
the server.

If the connection to the server encompasses multiple pipes, we poll both
pipes and read available data.

readline
--------

Read a line of output from the server. If there are multiple output
pipes, reads only the main pipe.

ereadline
---------

Like ``readline``, but read from the stderr pipe, if available.

read <X>
--------

``read()`` N bytes from the server's main output pipe.

eread <X>
---------

``read()`` N bytes from the server's stderr pipe, if available.

Specifying Unified Frame-Based Protocol Frames
----------------------------------------------

It is possible to emit a *Unified Frame-Based Protocol* by using special
syntax.

A frame is composed as a type, flags, and payload. These can be parsed
from a string of the form:

   <request-id> <stream-id> <stream-flags> <type> <flags> <payload>

``request-id`` and ``stream-id`` are integers defining the request and
stream identifiers.

``type`` can be an integer value for the frame type or the string name
of the type. The strings are defined in ``wireprotoframing.py``. e.g.
``command-name``.

``stream-flags`` and ``flags`` are a ``|`` delimited list of flag
components. Each component (and there can be just one) can be an integer
or a flag name for stream flags or frame flags, respectively. Values are
resolved to integers and then bitwise OR'd together.

``payload`` represents the raw frame payload. If it begins with
``cbor:``, the following string is evaluated as Python code and the
resulting object is fed into a CBOR encoder. Otherwise it is interpreted
as a Python byte string literal.
localsshs    --localssh requires a repositoryr.  )   raw   ssh1s   invalid value for --peers!   valid values are "raw" and "ssh1"r  s/   cannot specify --localssh with an explicit paths    (waiting for commands on stdin)
Ns   -Rr  s
   --sshstdior   )stdinstdoutstderrbufsizer     iT)logdatar|   r  s   ssh://localservernoreadstderrr  s.   creating ssh peer for wire protocol version 1
)autoreadstderrs   using raw connection to peer
s)   creating ssh peer from handshake results
)s   httpr  s7   only http:// and https:// paths are currently supported	useragents   Mercurial debugwireprotor  F)r  logdataapis)	loggingfhloggingnameloggingoptsr  r  
sendaccepts'   --peer %s not supported with HTTP peers)openers$   unsupported connection configuration)r     raw+s!   cannot call raw/raw+ on this peerrh   c              3  @   #    U  H  oR                  5       v   M     g 7fr   )r  )r   r   s     rf   r   !debugwireproto.<locals>.<genexpr>  s     61HHJJr/  r  s   flushs   cannot call flush on this peerr  s6   cannot send commands unless peer instance is availabler   r   s   eval:r  s   sending %s command
s   PUSHFILErbs   result: %s
s   remote output: %s
rU  rS   )bprefixr   s
   batchbegins   nested batchbegin not alloweds   batchsubmits#   sending batch with %d sub-commands
s   response #%d: %s
s   httprequest s+   cannot use httprequest without an HTTP peerrP   sD   invalid httprequest: expected format is "httprequest <method> <path>s   ^([a-zA-Z0-9_-]+): (.*)$s	   BODYFILE s   frame s#   unknown argument to httprequest: %sc              3  8   #    U  H  n[        U5      v   M     g 7fr   )r  )r   rq   s     rf   r   r  |  s     9&Qa&ry  c                 0   > [         R                  " T 5      $ r   )r)   r6  )r  s   rf   rf   debugwireproto.<locals>.<lambda>  s    X__V%<rh   r   c                     g r   r  r  rh   rf   rf  r    s    4rh   zContent-Typezapplication/mercurial-cbors	   cbor> %s
s   closes   readavailables(   readavailable not available on this peers   readlines#   readline not available on this peers	   ereadlines$   ereadline not available on this peers   read s   read not available on this peers   eread s    eread not available on this peers   unknown action: %ss   unclosed "batchbegin" request)Or   rY   r   r  r\   r  r  r   rG   hgcmdr)  
subprocessPopenr)   rapplytonativestrPIPEr  r  r  r_  r=   makeloggingfileobjectr4   	sshv1peer
_make_peerrI   r<   r  authinfor   r  ry  r  try_pathr   rp   rH   unescapestrflushr   r   r  rU   evalpythonliteralr   r   rk   	_callpushr^  r\  rX  rY  rZ  r[  r  _submitbatchrer  strurlgroupreadfiler@   makeframefromhumanstringurlreqrequest
get_methodr   urlerrurlerrorr  headersr  rD   	decodeallr2  readliner  kill),r^   r_   r   r   blocksprocr  r  r  r  r`   r<   r  r.  ur  
openerargs	peer_pathbatchedcommandsrN  r  r   r  r  fieldsr6  r  r|  resr{  r|  r   chunkr  httppathr  bodyframesr   framereqctr   r  s,                                              @rf   debugwireprotor    sH   V Jkk!?@AAF|V -  kk)*78
 	

 Z kk!NOPP	~~
789&rvv./FDEFFFJ ~~II	#
 
 OOH00$7//????
 

 ::f/..JJdE //KKtF //KKtF #!.11<7"HHQIJK$$-	D &\V#HHQ89:DHHQDEF%%-D 
 KK88..++LM  

4


 ::!##'#'',$	 <<7;J}%m4
 <6!',J|$r:z:<6!HHQ89:D&\++<=VL   ((2I&&r9VDD kk!CDEEO  &&kk!$H"IJJ 88666D))$/DKK  !xkk!$E"FGGKKMz**kk(  ll4+A.GD,,T15v;!# )CE!'JC##H--&88qrCE&2259E!S	   *&&7IIa/07:;d"${+T2b[)"&..#'/'9'9$'?#KC IIa0:3G3G3LLMII01J4H4H4PP 32 ))+q--6==?C , 		'( ''T!DE
 }$*kk!$D"EFF O~% II9:o&' ###%d&7&7&HI5		+,:3G3G3N/OO J
 #O//kkDE  ll4+G7|q kk8   'qr{FHGDF{{}HH8$?"//!''!*5C$OOAGGAJ7E#(GCL??<00==D!)<=D__Y//,EES^-.E MM%(++@ADH ' . /Cxx9&99--''(<dGLC
 =CNkk#&xxz 0B11m$ '' **40$q 2 x###JJL''kkAB  KKMKKMKKM{"kk!$J"KLLOO|#kk!$K"LMMOOx((T1-a01Ekk!$F"GHHKKy))T1-a01Ekk!$G"HIIKK++a 56?@@C  F "kk!<=>>

		 m 32 ,+l ;;'' 6<02s1   8Bs?$!t!t$?
t	
t!	$u!uu!)NFFFF)Nr   )r   r   )NN)Nr  )r   )r  )r  )rh   )FNT)
__future__r   r  r5  r  rW  r  r  r	  r  r9  r<  rN  r  r  r  r~  r  r  rm   i18nr   r   r   r   r   r	   r  r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   lockmodr   r    r!   r  r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r:  r9   r:   r;   r<   ry  r=   r>   r?   rV   r@   rA   
interfacesrB   stabletailgraphrC   utilsrD   rE   rF   rG   rH   rI   revlogutilsrJ   r  rK   rL   rM   r|  tabler   r  _tablerg   rr   ry   r   r   r  r
  r  r#  r+  r9  rR  rX  r`  r^  r]  r  r  debugrevlogoptsr  r  formatteroptsr  r  r  r  r}  rv  rz  r~  r  r  
dryrunoptsr  r  r  r  r  r  r  r  r3  rk  rn  r  r  templateoptsr  rm  r  commitopts2r  r  r#  r>  walkoptsrD  rI  mergetooloptsrV  ra  rq  r~  r  r  r  r  r  r  r  r  r  r  r  r  logoptsr  r  r,  r0  r7  rA  rS  rX  rZ  r_  rc  CATEGORY_IMPORT_EXPORTri  rq  rx  r~  r  r  r  rh   rf   <module>r     s	   #         	   	  
   
   9 9 9 9 9 9 9 9 9 9 9 9 9 9 9t # +   //
 U]]!! "


E
" 		2q!56TJ. K.( 		!2&< '<  		'W5 6 	 23		
 34		
 
{D!$?"@A56		
* /8 
f932f9R&=R.I)54 		vtQ234	lB"B CD	gtQDEF
 gJ	4	4 		r1W:d; <& 		
 $&$&N 		R%" &" 		8T1:;<=
&
&3$ 		("g6Q 7Q4 		wa 567	{D!$A"BC	gtQ345	y$"@ AB	 $%
9
9x 	w..2C0DEF FF& 	
Kq!=>?@
1
1 	 =>		
 BC		
 :;		
 <=		
 :;		
3@ A B C!D mK&N}O&N}@ 	 MN		
	 *F*FZ 	 <=		
 
ha :;<	k4#9!:;;<		
 JK		
, n14<H54<H~ 	&cF
7
7 		fdA89:@A		
 
fbCDN	
	
!. /0 12 7:z;:zz 
 		y#qz* " 		W22BTJ: K:z 	 45fI	
 DE		
 9:		
 56gJ	
)8 45=@>A@>B 	 BCgJ	
 <=gJ	
 DE		
, -4-54-` 			
O
Od 	Qy\$7< 8<. 		wA011U8<	y"a 45qx@/0gJ	

  ! <! <> 	\*.B +.Bb 	$g333m

$ 	m	 		R ' !' 	"w444c$Gf HfR	 	Am,T:
H ;
H 		AkN3' 4'
 		!4+M)NO89		
 
{D!$G"HI9:		
  n%(l)(l^ 	!	hq!345:;gJ	
	 :
:
z 		R'"6"66<h =hV 		r1Z=1 2. 	 FG	 ,q)G'HIBC	 BC	
	
. m58(@98(@V 		h1_-.<=		
 
vr1?@AAB		
 
hq!?@A	iQEFG!$ %& '( &'-0z10zz 	
FC/0!F)<=kN
-
- 	
FC/0!F)<=kN
-
- 		wa :;<	y$"; <=	xq!9:;	z4#=!>?	 n	9	9x 	*	-- 	r1W:d3 40 		vsAABAfIN	otQ'K%LM 	
  o
G2
G2T 	"a ?@N! O!H 	r1V9% &6 	-	vsA78!F)D+		
 kN "G! "GJ 	 ;<		
 ;;
 	
FC/0!F)<=
3
3 		+R5 6 	gua8J6KLMMm	

 	iA./9>?@ jjZ 	 @A		
 9:		
 <=		
 56gJ	
 
oua(M&NO	!5!,F*GH7: ? B`C B`F 	 ;<		
 
j#q!HIJ	lC#?!@A	 D 		R>!23& 4&8 		722A6G4HIE JE< 	b+D9C :CL 	 &'kN	
 ++ 	$ &'kN	
 
{E1%B#CD	   		
 oo ./||~ 	
FC/0!F)<=
1
1 	 ./jM	
 o"*"*J 		|T1%D#EF	{D!$B"CD	{D!$B"CD
 " 		:ua FGHIhK
0
0f 		BB  B& 		vr1<=qyI	y"a :;Q|_M /055p 		y#q0!G*= lO** 		y#q0!G*= lO** 		r"8 #8 	 ./gJ	
 
feQ567	iq!JKL	lD!$G"HI	k4#E!FG	k4#E!FG"#"D 	jM//	-- 	'""A&>$?4**0 		b!F),
 -
$ 	
  &'

(''T 		k5!$H"IJ	gsAIJK67		
 =>		
  !" iL),T-,Trh   