
    	^c&                     .   d dl mZ d dlmZmZ d dlmZmZmZm	Z	m Z m
Z
mZmZmZmZmZmZ d dlmZmZ ej        Zej        Zej        Zej        Zej        Zej        ZddZd ZdZed	z   ed
dddZed         ed<   i Z ej         e          Z  e ddh          d             Z! e dddh          d             Z" e ddh          d             Z# e ddh          d             Z$ e dddh          d             Z% e ddh          d             Z& e dddh          d              Z' e d!ddh          d"             Z( e d#dh          d$             Z) e d%dh          d&             Z* e d'd(dh          d)             Z+ e d*d(h          d+             Z, e d,dh          d-             Z- e d.dh          d/             Z.dd1Z/dd2Z0 e d3h d4          d5             Z1 e d6d7h          d8             Z2 e d9dd7h          d:             Z3 e d;dd7h          d<             Z4 e d=dd7h          d>             Z5 e d?dh          d@             Z6 e dAh dB          dC             Z7dD Z8dE Z9dF Z: e dGdH          dI             Z; e dJdH          dK             Z< e dLh dB          dM             Z=dN Z> e dOh dB          dP             Z? e dQh dB          dR             Z@dS ZAddheA_B         e dTddh          dU             ZC e dVh dW          dX             ZDdY ZE e dZddh          d[             ZF e d\ddh          d]             ZG e d^dh          d_             ZH e d`dh          da             ZI e dbd(dh          dc             ZJ e dddeh          df             ZK e dgdh          dh             ZL e diddh          dj             ZM e dkdh          dl             ZN e dmdeh          dn             ZO e doh dp          dq             ZP e drddh          ds             ZQ e dtddh          du             ZR e dvdh          dw             ZS e dxdh          dy             ZT e dzdh          d{             ZU e d|dh          d}             ZV e d~dh          d             ZW e ddh          d             ZX e dddh          d             ZY e ddh          d             ZZ e ddh          d             Z[ e ddh          d             Z\ e ddh          d             Z] e dddh          d             Z^ e dd(h          d             Z_ e ddh          d             Z` e ddh          d             Za e dd(h          d             Zb e dddh          d             Zcd Zdee                                ZfdS )   )_)hexwdirrev)diffutilencodingerrorhbisecti18nobsutilpatchpycompat	registrarscmutiltemplateutilutil)
stringutilurlutilNc                 F   |                      |d          |                      |d          |                      |d          }d}|#|d|z   z  }t          j        |          d         nt          j        ||vrdd	d	d
gfi||<   ||                                         }|g}|rp|                                }|v r|         fd                                D             }|r8                                d	         d	d t          |          D             f|<   	 fd
                                D             }t          |          dk    rN|d	         d         |d         d         k    rt          |          \  }	}
}n(fd}t          ||          \  }	}
}n|d	         \  }	}
}nW# t          $ rJ |                    |           |                    d 
                                D                        Y aw xY w|	|
dz   |f|<   |p|         S )z8return date, distance and name for the latest tag of rev   repo   ctx   caches
   latesttagsN   -       s   nullc                     g | ]=}                     |          r&                     |          d k    0 |          ;|>S )s   local)tagtype).0tmatchrepos     6/usr/lib/python3/dist-packages/mercurial/templatekw.py
<listcomp>z!getlatesttags.<locals>.<listcomp>D   sY     
 
 
Q
 %)LLOOx$?$?EE!HH$? $?$?$?    c                     g | ]}|S  r&   )r   r   s     r"   r#   z!getlatesttags.<locals>.<listcomp>J   s    0I0I0Iq0I0I0Ir$   c                 D    g | ]}|                                          S r&   rev)r   p
latesttagss     r"   r#   z!getlatesttags.<locals>.<listcomp>M   s&    @@@QZ(@@@r$   r   c                 ^   | d         d         }                                 Hd                                 D             }                    d||          }t          |          dz   }n8                    d                                 |          }t          |          }| | d         gS )Nr   r   c                 6    g | ]}|                                 S r&   r(   )r   cs     r"   r#   z.getlatesttags.<locals>.key.<locals>.<listcomp>Y   s     $D$D$DQUUWW$D$D$Dr$      only(%ld, %s)r   s   only(%d, %s))r)   parentsrevslen)xtagprevschangeschangessincetagctxr!   s        r"   keyzgetlatesttags.<locals>.keyU   s    d1g7799,$D$Dckkmm$D$D$DE&*ii0@%&M&MG.1'llQ.>OO&*iiC&P&PG.1'llO "1 0!A$77r$   )r9   c              3   >   K   | ]}|                                 V  d S Nr(   r   r*   s     r"   	<genexpr>z getlatesttags.<locals>.<genexpr>i   s*      77A777777r$   )resourcer   stringmatcherr   alwaysr)   poptagsdatesortedr0   r2   maxKeyErrorappendextend)contextmappingpatterncache	cachenamer)   todorB   ptagspdatepdistptagr9   r8   r+   r    r!   s                @@@@r"   getlatesttagsrS   *   s   GW--D


7F
+
+CWh//EITG^#	(11!4 Ay 12iy!J
''))C5D
 ,1hhjj*3i
 
 
 
 
XXZZ
 
 

  	!hhjjmQ0I0IF4LL0I0I0IIJsO	@@@@#++--@@@E5zzA~~8A;%(1+-- *-U&E5$$8 8 8 8 8 8 *-U)<)<)<&E5$$%*1X"ud 	 	 	KKKK77777777H		
  D0
3Y  ,1Z c?s   (BF6 6AH
	H
c                      t           j        }  | d          }t          t          d |                                D             t          j        |                              d                              S )z"Return a dict of log column labelss  bookmark:    %s
branch:      %s
changeset:   %s
copies:      %s
date:        %s
extra:       %s=%s
files+:      %s
files-:      %s
files:       %s
instability: %s
manifest:    %s
obsolete:    %s
parent:      %s
phase:       %s
summary:     %s
tag:         %s
user:        %s
c                 F    g | ]}|                     d d          d         S )   :r   r   )split)r   ss     r"   r#   z!getlogcolumns.<locals>.<listcomp>   s+    ???QQWWT1a ???r$   T)r   identitydictzip
splitlinesr
   r   )r   columnss     r"   getlogcolumnsr^   o   sw    Aa	 G& ??'*<*<*>*>???F7OO&&t,,	
 	
  r$   s   {rev}:{node|formatnode}    s   {name} ({source})s   {key}={value}s   {key}={value|stringescape})   parent   manifest	   file_copy   envvar   extrarb   s   filecopys   authorr   )requiresc                 "    t          | |          S )zAlias for ``{user}``)showuserrI   rJ   s     r"   
showauthorri      s     GW%%%r$   s   bisectr   c                     |                      |d          }|                      |d          }t          j        ||                                          S )z'String. The changeset bisection status.r   r   )r>   r	   labelnode)rI   rJ   r!   r8   s       r"   
showbisectrm      sH     GW--D


7F
+
+C=sxxzz***r$      branchc                 V    |                      |d          }|                                S )zMString. The name of the branch on which the changeset was
    committed.
    r   )r>   branchrI   rJ   r8   s      r"   
showbranchrr      s'    
 

7F
+
+C::<<r$      branchesc                     |                      |d          }|                                }|dk    rt          | |d|gd          S t          | |dg d          S )zList of strings. The name of the branch on which the
    changeset was committed. Will be empty if the branch name was
    default. (DEPRECATED)
    r   s   defaultrn   rs   plural)r>   rp   
compatlist)rI   rJ   r8   rp   s       r"   showbranchesrx      sp     

7F
+
+CZZ\\FWi&+
 
 
 	
 gw	2kJJJJr$   s	   bookmarksc                     |                      |d          }|                      |d          }|                                }|j        fd}t          | |d|          }t	          |||t
          j                  S )z{List of strings. Any bookmarks associated with the
    changeset. Also sets 'active', the name of the active bookmark.
    r   r   c                     | dS )N)   bookmarks   actives   currentr&   )vactives    r"   <lambda>zshowbookmarks.<locals>.<lambda>   s    aFOO r$   r{   )r>   	bookmarks_activebookmark_showcompatlist_hybridr   rY   )rI   rJ   r!   r8   r   makemapfr}   s          @r"   showbookmarksr      s|    
 GW--D


7F
+
+CI!FOOOOG+yAAA1i(*;<<<r$      childrenc                     |                      |d          }d |                                D             }t          | |d|d          S )z/List of strings. The children of the changeset.r   c                 @    g | ]}d |                                 |fz  S )s   %d:%sr(   )r   cctxs     r"   r#   z showchildren.<locals>.<listcomp>   s*    JJJ4TXXZZ..JJJr$   r   s   child)element)r>   childrenrw   )rI   rJ   r8   	childrevss       r"   showchildrenr      sV     

7F
+
+CJJ3<<>>JJJI+y(   r$   s   currentbookmarkc                 "    t          | |          S )zUString. The active bookmark, if it is associated with the changeset.
    (DEPRECATED))showactivebookmarkrh   s     r"   showcurrentbookmarkr      s     gw///r$   s   activebookmarkc                     |                      |d          }|                      |d          }|j        }|r||                                v r|S dS )zDString. The active bookmark, if it is associated with the changeset.r   r   r$   )r>   r   r   )rI   rJ   r!   r8   r}   s        r"   r   r      sZ     GW--D


7F
+
+C!F &CMMOO++3r$   s   datec                 ~    |                      |d          }t          j        |                                d          S )z<Date information. The date when the changeset was committed.r   s   %d.0%d)showfmt)r>   r   rC   rq   s      r"   showdater      s9     

7F
+
+C SXXZZ;;;;r$   s   descc                    |                      |d          }|                                }t          |t          j                  r8t          j        t          j        |                                                    S t          |t          j                  r&t          j        |                                          S |                                S )z.String. The text of the changeset description.r   )	r>   description
isinstancer   localstrtolocal	fromlocalstripsafelocalstr)rI   rJ   r8   rX   s       r"   showdescriptionr      s     

7F
+
+CA!X&''  21 5 5 ; ; = =>>>	Ax,	-	- $QWWYY///wwyyr$   s   diffstat   uic                 ^   |                      |d          }|                      |d          }t          j        |ddi          }|                    |          }t	          j        t          j        |                    }t	          j        |          \  }}}	}
}dt          |          |	|
fz  S )ziString. Statistics of changes with the following format:
    "modified files: +added/-removed lines"
    r   r   s   noprefixF)optss   %d: +%d/-%d)
r>   r   diffalloptsdiffr   diffstatdatar   	iterlinesdiffstatsumr2   )rI   rJ   uir8   diffoptsr   statsmaxnamemaxtotaladdsremovesbinarys               r"   showdiffstatr   	  s    
 
		'5	)	)B


7F
+
+C#Be(<==H888""Dt~d3344E/4/@/G/G,GXtWfSZZw777r$      envvarsc                     |                      |d          }|                                t          j        fdt	                    D                       t          | |dd          S )z5A dictionary of environment variables. (EXPERIMENTAL)r   c              3   ,   K   | ]}||         fV  d S r;   r&   )r   kenvs     r"   r=   zshowenvvars.<locals>.<genexpr>  s+      99CF999999r$   rc   r   ru   )r>   exportableenvironr   sortdictrD   
compatdict)rI   rJ   r   r   s      @r"   showenvvarsr     sn     
		'5	)	)B



 
 C
-9999VC[[999
9
9Cgw	3zJJJJr$      extrasc                 ,   |                      |d          }|                                t          j        fdt	                    D                       fdfdD             }t          | |d|d          }t          |fd          S )	zRList of dicts with key, value entries of the 'extras'
    field of this changeset.r   c              3   ,   K   | ]}||         fV  d S r;   r&   )r   r   extrass     r"   r=   zshowextras.<locals>.<genexpr>&  s+      BBaAvay>BBBBBBr$   c                     | |          dS )N)s   keys   valuer&   r   r   s    r"   r~   zshowextras.<locals>.<lambda>'  s    fQi88 r$   c                 &    g | ]} |          S r&   r&   )r   r   r   s     r"   r#   zshowextras.<locals>.<listcomp>(  s!    $$$$$$r$   rd   r   ru   c                 B    d| t          j        |                    fz  S Ns   %s=%s)r   	escapestrr   s    r"   r~   zshowextras.<locals>.<lambda>.  s     (a!5fQi!@!@AA r$   )r>   extrar   r   rD   r   r   )rI   rJ   r8   r.   r   r   r   s        @@r"   
showextrasr      s     

7F
+
+CYY[[F]BBBB6&>>BBBBBF8888G$$$$V$$$A(AiHHHA	AAAA	  r$   s
   _fast_rankc                 h    |                      |d          }|                                }|dS d|z  S )zthe rank of a changeset if cached

    The rank of a revision is the size of the sub-graph it defines as a head.
    Equivalently, the rank of a revision `r` is the size of the set
    `ancestors(r)`, `r` included.
    r   Ns   %d)r>   	fast_rank)rI   rJ   r8   ranks       r"   r   r   2  s:     

7F
+
+C==??D|t4<r$   Fc                     |                      |d          }|                      |d          }d|vs|d         |k     r5|                                                    ||||          }||d<   ||d<   |d         S )Nr      revcaches
   filestatus   filestatusall)listignored	listcleanlistunknown)r>   p1status)rI   rJ   listallr8   revcachestats         r"   _getfilestatusr   A  s    


7F
+
+C55HH$$1A(BW(L(LvvxxWW  
 
 #'%,!"M""r$   c                 $   |                      |d          }d|vs|d         |k     rbt          | ||          }i x|d<   }t          t          j        d          |          D ]&\  }|                    fd|D                        '|d         S )Nr   s   filestatusmapr   r   s   MAR!?ICc              3       K   | ]}|fV  	d S r;   r&   )r   r   chars     r"   r=   z$_getfilestatusmap.<locals>.<genexpr>S  s'      44At9444444r$   )r>   r   r[   r   iterbytestrupdate)rI   rJ   r   r   r   statmapfilesr   s          @r"   _getfilestatusmapr   M  s    55Hx''84D+E+O+Ogw@@@/11!"Wx3J??FF 	5 	5KD%NN4444e4444444$%%r$   s   file_copies>   r   r   r   r   c                 f   |                      |d          }|                      |d          }|                      |d          }|                      |d                              d          }|.d|vrt          j        |          |d<   |d         } ||          }t	          j        | |d|          S )	zLList of strings. Files copied in this changeset with
    their sources.
    r   r   r   r      copiesNs	   getcopiesrb   )r>   getr   getcopiesfnr   compatfilecopiesdict)rI   rJ   r!   r8   rL   copies	getcopiess          r"   showfilecopiesr   W  s     GW--D


7F
+
+CWh//Eg{3377	BBF~u$$")"5d";";E,,'	3,,  r$   s   file_copies_switchr   c                     |                      |d                              d          pg }t          j        | |d|          S )z^List of strings. Like "file_copies" but displayed
    only if the --copied switch is set.
    r   r   rb   )r>   r   r   r   )rI   rJ   r   s      r"   showfilecopiesswitchr   o  sJ    
 g{3377	BBHbF,,  r$   s	   file_addsc                     |                      |d          }t          j        | |d|                                          S )z/List of strings. Files added by this changeset.r   s   file_add)r>   r   compatfileslist
filesaddedrq   s      r"   showfileaddsr   z  sA     

7F
+
+C'+s~~'7'7  r$   s	   file_delsc                     |                      |d          }t          j        | |d|                                          S )z1List of strings. Files removed by this changeset.r   s   file_del)r>   r   r   filesremovedrq   s      r"   showfiledelsr     sC     

7F
+
+C'+s'7'7'9'9  r$   s	   file_modsc                     |                      |d          }t          j        | |d|                                          S )z2List of strings. Files modified by this changeset.r   s   file_mod)r>   r   r   filesmodifiedrq   s      r"   showfilemodsr     sC     

7F
+
+C'+s'8'8':':  r$   s   filesc                     |                      |d          }t          j        | |d|                                          S )zRList of strings. All files modified, added, or removed by this
    changeset.
    r   s   file)r>   r   r   r   rq   s      r"   	showfilesr     s8    
 

7F
+
+C''399;;OOOr$   s	   graphnode>   r   r   r   c                     |                      |d          }|                      |d          }|                      |d          }t          |||          S )zUString. The character representing the changeset node in an ASCII
    revision graph.r   r   r   )r>   getgraphnode)rI   rJ   r!   r8   rL   s        r"   showgraphnoder     sU     GW--D


7F
+
+CWh//Ec5)))r$   c                 B    t          | ||          pt          |          S r;   )getgraphnodecurrentgetgraphnodesymbol)r!   r8   rL   s      r"   r   r     s"    tS%00K4Fs4K4KKr$   c                    | j                                         }|d         | j        k    r
|d d         }|                                |v rdS |                    d          }|Jddlm} |j                            |           }|                                r|j	        |j
        f}nd}||d<   |                                |v rdS dS )Nr      @s   merge_nodes)
mergestater&      %r$   )dirstater0   nullidrl   r    r   readunresolvedcountlocalother)r!   r8   rL   wpnodesmerge_nodesmergestatemodr   s          r"   r   r     s    m##%%GqzT[  "1"+
xxzzWtii//555555&166t<<J))++ !)/1AB $/E.!88::$$4sr$   c                     |                                  rdS |                                 rdS |                                 rdS dS )N   x   *   _   o)obsolete
isunstableclosesbranchr8   s    r"   r   r     sL    
||~~ t			 t					 ttr$   s
   graphwidthr&   c                     dS )z?Integer. The width of the graph drawn by 'log --graph' or zero.r   r&   rh   s     r"   showgraphwidthr    s	     1r$   s   indexc                 D    t          j        t          d                    )z7Integer. The current iteration of the loop. (0 indexed)s   can't use index in this context)r   Abortr   rh   s     r"   	showindexr    s     +a:;;
<
<<r$   	   latesttagc                 $    t          | |d          S )zList of strings. The global tags on the most recent globally
    tagged ancestor of this changeset.  If no such tags exist, the list
    consists of the single string "null".
    N)showlatesttagsrh   s     r"   showlatesttagr    s     '7D111r$   c                     t          | ||          fd}d         }t          | |d|d          }t          |||t          j                  S )z4helper method for the latesttag keyword and functionc                 (    t           d         | | dS )Nr   )s   changess   distancer     tag)_showchangessincetag)r|   r+   s    r"   r~   z showlatesttags.<locals>.<lambda>  s    (]	  r$   r   r  rV   )	separator)rS   r   r   r   rY   )rI   rJ   rK   r   rB   r   r+   s         @r"   r  r    sd    w99J
   G a=D,MMMA1dGX%6777r$   s   latesttagdistancec                 .    t          | |          d         S )z(Integer. Longest path to the latest tag.r   )rS   rh   s     r"   showlatesttagdistancer    s     '**1--r$   s   changessincelatesttagc                     t          | |          d         d         }|                     |d|i          }t          | |          S )z-Integer. All ancestors not in the latest tag.r   r   r  )rS   
overlaymapr  )rI   rJ   r4   s      r"   showchangessincelatesttagr!    sF     
)
)!
,Q
/C  63-88G111r$   c                 j   |                      |d          }|                      |d          }d}|                                g}|                     |d          }|                                 d}d |                                D             }t	          |                    d||                    |z   S )Nr   r   r   r  r   c                 6    g | ]}|                                 S r&   r(   r<   s     r"   r#   z(_showchangessincetag.<locals>.<listcomp>  s     ///A///r$   r/   )r>   r)   symbolr0   r2   r1   )rI   rJ   r!   r8   offsetr1   r4   s          r"   r  r    s    GW--D


7F
+
+CFGGII;D
..&
)
)C wwyy/////tyy)45566??r$   ra   c                    |                      |d          }|                      |d          }|                                }| |j        j        }t          |j        j        n)|j                            |          t          |          | 	                    |d          }| 
                    d|          }t          j        |d |fd          S )Nr   r      rev   nodera   c                     dS )Nr'  r&   )r3   mhexmrevs    r"   r~   zshowmanifest.<locals>.<lambda>(  s    td;; r$   )r>   manifestnodenodeconstantswdiridr   wdirhexmanifestlogr)   r   r   processr   
hybriditem)rI   rJ   r!   r8   mnoder   r+  r,  s         @@r"   showmanifestr5    s    GW--D


7F
+
+CE}")!)##E**5zz  4$*G*GHHGW--A"	4;;;;;  r$   s   obsfate>   r   r   r   c                 Z   t          | |          }|                     |d          }|                     |d          }g }|                    | |          D ]E}t          j        |||d         |d         t
          j                  }|                    |           Ft          | |d|          S )Nr   r   
   successors   markerss   fate)	showsuccsandmarkersr>   tovaluer   obsfateprinterr   formatchangeidrG   rw   )rI   rJ   succsandmarkersr   r!   valuesr3   r|   s           r"   showobsfater?  ,  s     *'7;;O			'5	)	)BGW--DF$$Wg66  "a&*w7M
 
 	agw888r$   c                    |                      |d          }|                      |d          }|j                            |          }|dS |                    ||                                          }t	          | ||j        ||          S )z<helper method to generate a template keyword for a namespacer   r   Nru   )r>   namesr   rl   rw   templatename)rI   rJ   	namespacer!   r8   nsrA  s          r"   	shownamesrE  A  s    GW--D


7F
+
+C			"	"B	z 	HHT388::&&E"/5   r$   s
   namespacesc                   	
 |                      |d          
|                      |d          }t          j                    	d }
j                                        D ]g\  }}|                    
|                                          }t          | |d|          }t          || ||          t          j	                  	|<   ht          | |dt          	                    }	
fd}t          |	|t          j	                  S )zBDict of lists. Names attached to this changeset per
    namespace.r   r   c                       fdS )Nc                     d| j         | iS )N   name)rB  )r|   rD  s    r"   r~   z5shownamespaces.<locals>.makensmapfn.<locals>.<lambda>[  s    '1boq9 r$   r&   )rD  s   `r"   makensmapfnz#shownamespaces.<locals>.makensmapfnY  s    99999r$   rI  	   namespacec                 ^    | |          j         |          j        j         |          j        dS )N)rK  s   namess   builtins	   colorname)rA  builtin	colorname)rD  
namespacesr!   s    r"   r   zshownamespaces.<locals>.makemapd  s4     n
2.*R.2	
 
 	
r$   )r>   r   r   rA  itemsrl   r   r   r   rY   list)rI   rJ   r8   rJ  r   rD  rA  r   r   rO  r!   s            @@r"   shownamespacesrR  P  s    GW--D


7F
+
+CJ: : : !!## N N2sxxzz**GWgu==5++b//8;LMM
1,Z8H8HIIA
 
 
 
 
 
 1j'8+<===r$   s   negrevc                     |                      |d          }|                                }||dk     rdS |                      |d          }|t          |          z
  S )zmInteger. The repository-local changeset negative revision number,
    which counts in the opposite direction.r   Nr   r   )r>   r)   r2   )rI   rJ   r8   r)   r!   s        r"   
shownegrevrT  o  s]     

7F
+
+C
''))C
{cAggtGW--DT?r$   r)  c                 V    |                      |d          }|                                S )zUString. The changeset identification hash, as a 40 hexadecimal
    digit string.
    r   )r>   r   rq   s      r"   shownoderV  {  s'    
 

7F
+
+C7799r$      obsoletec                 ^    |                      |d          }|                                rdS dS )z9String. Whether the changeset is obsolete. (EXPERIMENTAL)r   rW  r$   )r>   r  rq   s      r"   showobsoleterY    s3     

7F
+
+C
||~~ {3r$   s   onelinesummaryc                     ddl m} |                     |d          }|                     |d          }|                    ||          S )zString. A one-line summary for the ctx (not including trailing newline).
    The default template be overridden in command-templates.oneline-summary.r   )cmdutilr   r   )r   r[  r>   format_changeset_summary)rI   rJ   r[  r   r8   s        r"   showonelinesummaryr]    sV     			'5	)	)B


7F
+
+C++B444r$      path   fctxc                 V    |                      |d          }|                                S )zDString. Repository-absolute path of the current file. (EXPERIMENTAL)r_  )r>   pathrI   rJ   fctxs      r"   showpathrd    '     GW--D99;;r$   s   peerurlsc                     |                      |d          }|j        j        t          j        |j                  }t          j        d |D                       fd}fd}t          d||          S )zcA dictionary of repository locations defined in the [paths] section
    of your configuration file.r   c              3   .   K   | ]\  }}||j         fV  d S r;   )rawloc)r   r   r*   s      r"   r=   zshowpeerurls.<locals>.<genexpr>  s,      ==41a!QX======r$   c                    |          }d| i}t          |          dk    re|d         j        |d<   |d         j                                        }t	          j        t          |                    }|                    |           t	          j                    }|D ]_}t	          j        t          |j                                                            }|j        |d<   |                    |           |g|d<   `|S )NrI  r   r   s   urls   urls)r2   rh  
suboptionsrP  r   r   rD   r   )r   psdsub_opts	path_dictr*   pathss         r"   r   zshowpeerurls.<locals>.makemap  s    1XaLr77a<<1AfI!u'--//H}VH%5%566HHHXMOO	 	% 	%A}VAL,>,>,@,@%A%ABBH !IfX&&&#AgJJr$   c                     d| |          fz  S r   r&   )r   urlss    r"   
format_onez showpeerurls.<locals>.format_one  s    1d1g,&&r$   N)r>   r   ro  r   
list_pathsr   r   r   )rI   rJ   r!   	all_pathsr   rr  ro  rq  s         @@r"   showpeerurlsru    s     GW--DGME"47++I===9=====D     ' ' ' ' ' 4w
333r$   s   predecessorsc                 (   |                      |d          |                      |d          }t          t          j        |                                                    }t          j        t          |          }t          d|fdfd          S )zDReturns the list of the closest visible predecessors. (EXPERIMENTAL)r   r   Nc                     d|          iS Nr   r&   r3   r!   s    r"   r~   z"showpredecessors.<locals>.<lambda>      647# r$   c                 8    t          j        |                    S r;   r   r<  ry  s    r"   r~   z"showpredecessors.<locals>.<lambda>      '(a11 r$   )	r>   rD   r   closestpredecessorsrl   r   maplistr   r   )rI   rJ   r8   predecessorsr!   s       @r"   showpredecessorsr    s     GW--D


7F
+
+C'5dCHHJJGGHHL#C66L####1111	  r$   s   reporootc                 <    |                      |d          }|j        S )z5String. The root directory of the current repository.r   )r>   root)rI   rJ   r!   s      r"   showreporootr    s!     GW--D9r$   s   sizec                 V    |                      |d          }|                                S )z:Integer. Size of the current file in bytes. (EXPERIMENTAL)r_  )r>   sizerb  s      r"   showsizer    re  r$   s   status>   r   r_  r   c                     t          j        | |d          }t          j        | ||          }|sdS t          | |          }||vrt          | |d          }|                    |          S )z7String. Status code of the current file. (EXPERIMENTAL)r^  NTr   )r   	runsymbol	stringifyr   r   )rI   rJ   ra  r   s       r"   
showstatusr    sy     !'7G<<D!'7D99D 11G7#GWdCCC;;tr$   s   successorssetsc                    	                       d          	                      d          }g }|                                rgt          j        	|                                d          }d |D             }|D ]/}t          d|	fd	fd          }|                    |           0 fd	fd
}t           ||          |d t          j                  S )zReturns a string of sets of successors for a changectx. Format used
    is: [ctx1, ctx2], [ctx3] if ctx has been split into ctx1 and ctx2
    while also diverged into ctx3. (EXPERIMENTAL)r   r   T)closestc                 &    g | ]}d  |D             S )c                 ,    g | ]}t          |          S r&   r   r   ns     r"   r#   z1showsuccessorssets.<locals>.<listcomp>.<listcomp>  s    %%%Q#a&&%%%r$   r&   )r   sss     r"   r#   z&showsuccessorssets.<locals>.<listcomp>  s'    666"%%"%%%666r$   Nc                     d|          iS rx  r&   ry  s    r"   r~   z$showsuccessorssets.<locals>.<lambda>      647+ r$   c                 8    t          j        |                    S r;   r|  ry  s    r"   r~   z$showsuccessorssets.<locals>.<lambda>  s    '0a99 r$   c                 0    t          j        |           S r;   )r   r  )rl  rI   rJ   s    r"   renderz"showsuccessorssets.<locals>.render  s    %gw:::r$   c              3   R   K   d                     fd| D                       V  d S )Ns   ; c              3   .   K   | ]} |          V  d S r;   r&   )r   rl  r  s     r"   r=   z2showsuccessorssets.<locals>.gen.<locals>.<genexpr>  s+      11q111111r$   )join)datar  s    r"   genzshowsuccessorssets.<locals>.gen  s:      jj1111D1111111111r$   c                 
    d| iS )Ns   successorsetr&   )r3   s    r"   r~   z$showsuccessorssets.<locals>.<lambda>  s    OQ#7 r$   )	r>   r  r   successorssetsrl   r   rG   r   rY   )
rI   rJ   r8   r  ssetsr  hr  r  r!   s
   ``      @@r"   showsuccessorssetsr    s+   
 GW--D


7F
+
+CD
||~~ &tSXXZZFFF66666 	 	B++++9999	 A KKNNNN; ; ; ; ; ;2 2 2 2 2 D		4779J  r$   s   succsandmarkersc                    |                      |d          |                      |d          }t          j        |          }|g }g }|D ]}|d         }d |D             }t          d|fdfd          }g }|d         D ]}t	          |d	                   }	t          d
 |d         D                       }
d}|d         t          d |d         D                       }|	|
f|dd         z   |fz   |dd         z   }|                    |           |                    ||d           t          j        |          S )zReturns a list of dict for each final successor of ctx. The dict
    contains successors node id in "successors" keys and the list of
    obs-markers from ctx to the set of successors in "markers".
    (EXPERIMENTAL)
    r   r   Nr7  c                 ,    g | ]}t          |          S r&   r  r  s     r"   r#   z'showsuccsandmarkers.<locals>.<listcomp>$  s    111c!ff111r$   c                     d|          iS rx  r&   ry  s    r"   r~   z%showsuccsandmarkers.<locals>.<lambda>(  s    vtAw' r$   c                 8    t          j        |                    S r;   r|  ry  s    r"   r~   z%showsuccsandmarkers.<locals>.<lambda>)  s    g,T!W55 r$   r8  r   c              3   4   K   | ]}t          |          V  d S r;   r  r  s     r"   r=   z&showsuccsandmarkers.<locals>.<genexpr>0  s(      11qCFF111111r$   r      c              3   4   K   | ]}t          |          V  d S r;   r  r  s     r"   r=   z&showsuccsandmarkers.<locals>.<genexpr>3  s(      "8"8a3q66"8"8"8"8"8"8r$   r      )r7  r8  )	r>   r   successorsandmarkersr   r   tuplerG   r   mappinglist)rI   rJ   r8   r>  r  i
successorsfinalmarkersmhexprechexsucs
hexparents	newmarkerr!   s                @r"   r9  r9    s    GW--D


7F
+
+C)$44F~ D K K}%
11j111
''''5555	
 

 : 	+ 	+A!A$iiG11AaD11111GJt""8"81Q4"8"8"888
 '*QqsV3zmCaeKI	****JLIIJJJJ#D)))r$   s   p1c                     |                      |d          }t          j        d|                                it                    S )zChangeset. The changeset's first parent. ``{p1.rev}`` for the revision
    number, and ``{p1.node}`` for the identification hash.r   tmpl)r>   r   mappingdictr   _changeidtmplrq   s      r"   showp1r  <  <     

7F
+
+C#VSVVXX$6]KKKKr$   s   p2c                     |                      |d          }t          j        d|                                it                    S )zChangeset. The changeset's second parent. ``{p2.rev}`` for the revision
    number, and ``{p2.node}`` for the identification hash.r   r  )r>   r   r  p2r  rq   s      r"   showp2r  D  r  r$   s   p1revc                 z    |                      |d          }|                                                                S )zInteger. The repository-local revision number of the changeset's
    first parent, or -1 if the changeset has no parents. (DEPRECATED)r   )r>   r   r)   rq   s      r"   	showp1revr  L  /     

7F
+
+C6688<<>>r$   s   p2revc                 z    |                      |d          }|                                                                S )zInteger. The repository-local revision number of the changeset's
    second parent, or -1 if the changeset has no second parent. (DEPRECATED)r   )r>   r  r)   rq   s      r"   	showp2revr  T  r  r$   s   p1nodec                 z    |                      |d          }|                                                                S )zString. The identification hash of the changeset's first parent,
    as a 40 digit hexadecimal string. If the changeset has no parents, all
    digits are 0. (DEPRECATED)r   )r>   r   r   rq   s      r"   
showp1noder  \  /    
 

7F
+
+C6688<<>>r$   s   p2nodec                 z    |                      |d          }|                                                                S )zString. The identification hash of the changeset's second
    parent, as a 40 digit hexadecimal string. If the changeset has no second
    parent, all digits are 0. (DEPRECATED)r   )r>   r  r   rq   s      r"   
showp2noder  e  r  r$   s   parentsc                    |                      |d          |                      |d          }t          j        |          }d |D             }d |D             }t          | |d|          }t	          ||fdfdt
                    S )	zList of strings. The parents of the changeset in "rev:node"
    format. If the changeset has only one "natural" parent (the predecessor
    revision) nothing is shown.r   r   c                 6    g | ]}|                                 S r&   r(   r<   s     r"   r#   zshowparents.<locals>.<listcomp>v  s     $$$QUUWW$$$r$   c                     g | ]C}d |                                 fd|                                fd|                                fgDS )r(  r)     phase)r)   r   phasestrr<   s     r"   r#   zshowparents.<locals>.<listcomp>w  sV        !%%''	Waeegg.1::<<0HI  r$   r`   c                     d|          iS rx  r&   ry  s    r"   r~   zshowparents.<locals>.<lambda>  rz  r$   c                 8    t          j        |                    S r;   r|  ry  s    r"   r~   zshowparents.<locals>.<lambda>  r}  r$   )keytype)r>   r   meaningfulparentsr   r   int)rI   rJ   r8   pctxsr5   r0   r   r!   s          @r"   showparentsr  n  s    
 GW--D


7F
+
+C%dC00E$$e$$$E   G 	)W==A	####1111   r$   r  c                 V    |                      |d          }|                                S )z!String. The changeset phase name.r   )r>   r  rq   s      r"   	showphaser    s'     

7F
+
+C<<>>r$   s   phaseidxc                 V    |                      |d          }|                                S )z.Integer. The changeset phase index. (ADVANCED)r   )r>   phaserq   s      r"   showphaseidxr    s'     

7F
+
+C99;;r$   r(  c                 V    |                      |d          }t          j        |          S )z8Integer. The repository-local changeset revision number.r   )r>   r   intrevrq   s      r"   showrevr    s)     

7F
+
+C>#r$   s   subreposc                 x   |                      |d          }|j        }|st          | |dg           S |                                j        pi }g }|D ]-}||vs||         ||         k    r|                    |           .|D ]}||vr|                    |           t          | |dt          |                    S )z:List of strings. Updated subrepositories in the changeset.r   s   subrepo)r>   substaterw   r   rG   rD   )rI   rJ   r8   r  	psubstatesubrepossubs          r"   showsubreposr    s     

7F
+
+C|H <'7J;;;!'RIH ! !i8C=IcN#B#BOOC    ! !hOOC   gw
F84D4DEEEr$      tagsc                 $    t          | |d          S )z8List of strings. Any tags associated with the changeset.r  )rE  rh   s     r"   showtagsr    s     Wgw///r$   s	   termwidthc                 V    |                      |d          }|                                S )z+Integer. The width of the current terminal.r   )r>   	termwidthrI   rJ   r   s      r"   showtermwidthr    s'     
		'5	)	)B<<>>r$   s   userc                 V    |                      |d          }|                                S )z/String. The unmodified author of the changeset.r   )r>   userrq   s      r"   rg   rg     s'     

7F
+
+C88::r$      instabilitiesc                 z    |                      |d          }t          | |d|                                d          S )zYList of strings. Evolution instabilities affecting the changeset.
    (EXPERIMENTAL)
    r   s   instabilityr  ru   )r>   rw   instabilitiesrq   s      r"   showinstabilitiesr    sK    
 

7F
+
+C   r$   s	   verbosityc                 h    |                      |d          }|j        rdS |j        rdS |j        rdS dS )zOString. The current output verbosity in 'debug', 'quiet', 'verbose',
    or ''.r   s   debugs   quiets   verboser$   )r>   	debugflagquietverboser  s      r"   showverbosityr    sK     
		'5	)	)B	| x	 x	 z3r$   s   whyunstablec                 T  	 |                      |d          	|                      |d          }d t          j        	|          }|D ]G}|                    d          r0|d         }t	          dd |D             	fd	fd          }||d<   Hd	}t          j        ||d
          S )zRList of dicts explaining all instabilities of a changeset.
    (EXPERIMENTAL)
    r   r   c                 X    dt          j        |           |                                 fz  S )Ns   %s (%s))r   r<  r  r  s    r"   
formatnodez#showwhyunstable.<locals>.formatnode  s%    W3C88#,,..IIIr$   s   divergentnodesNc                 6    g | ]}|                                 S r&   r  )r   dnodes     r"   r#   z#showwhyunstable.<locals>.<listcomp>  s     111111r$   c                     d|          iS rx  r&   ry  s    r"   r~   z!showwhyunstable.<locals>.<lambda>  r  r$   c                 &     |                    S r;   r&   )r3   r  r!   s    r"   r~   z!showwhyunstable.<locals>.<lambda>  s    **T!W-- r$   sM   {instability}:{if(divergentnodes, " ")}{divergentnodes} {reason} {node|short}   
)r  sep)r>   r   whyunstabler   r   r   r  )
rI   rJ   r8   entriesentrydnodesdnhybridr  r  r!   s
           @@r"   showwhyunstabler    s    
 GW--D


7F
+
+CJ J J !$,,G 	0 	099&'' 	0,-F11&111++++-----	 H (0E#$	! 	 #G$EBBBBr$   c                 X    |j                                         D ]\  }}|t          |<   dS )z1Load template keyword from specified registrarobjN)_tablerP  keywords)r   extnameregistrarobjnamefuncs        r"   loadkeywordr     s9    ")//11  
d r$   r;   )F)gr
   r   rl   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   utilsr   r   hybridr   
hybriddict
hybridlistr   rw   r   rS   r^   r  defaulttemplr  templatekeywordri   rm   rr   rx   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  r!  r  	_requiresr5  r?  rE  rR  rT  rV  rY  r]  rd  ru  r  r  r  r  r  r9  r  r  r  r  r  r  r  r  r  r  r  r  r  rg   r  r  r  r  r>  i18nfunctionsr&   r$   r"   <module>r     s               
                                  
 
$
$
$
$
.B B B BJ  @ + t#&+  )6[  +)+H55 fX...& & /.&
 gv%6777+ + 87+ fX...  /. x000K K 10K &(9:::
= 
= ;:
= x000  10 #w.?@@@0 0 A@0 "gv->???  @? F8,,,< < -,< F8,,,
 
 -,
 v777
8 
8 87
8 ug...K K /.K fX...  /." &222  32	# 	# 	# 	#& & & & EEE    * &+???  @? (=>>>  ?> (=>>>  ?> (=>>>  ?> VH---P P .-P (C(C(CDDD* * ED*L L L  .   ,,,  -, B'''= = ('= (C(C(CDDD2 2 ED28 8 8& %0K0K0KLLL. . ML.
 )4O4O4OPPP2 2 QP2@ @ @  #*6!2   '8999  :9$ &>&>&>???9 9 @?9(   '6):;;;> > <;>< gv%6777  87 F8,,,  -, x000  10 "eV_===	5 	5 >=	5 G9---  .- y1114 4 214> GV+<===  >= y111  21 G9---  .- %C%C%CDDD	 	 ED	 "gv->???  @?B #w.?@@@)* )* A@)*X &***L L +*L &***L L +*L VH---  .- VH---  .- fX...  /. fX...  /. w&7888  98, VH---  .- x000  10 6(+++  ,+ x000F F 10F( GV#45550 0 650
 000  10 F8,,,  -, !VH555  65 000  10 7F*;<<<C C =<C<   !!r$   