ó
    6°hG6  ã                  ó(  • S r SSKJr  SSKrSSKJr  SSKJr  SSK	J
r
JrJrJrJrJrJrJrJrJr  SSKJr  Sr0 r\R0                  " \5      r\R2                  " 5       r\R4                  " 5       r\" S	S
SS9  \" S	SSS9  \" S	SSS9   " S S\R6                  R8                  5      r " S S5      rS rS r S r!\" S	SS1S9S 5       r"\" SSS1S9S 5       r#\" SSS1S9S 5       r$S r%\" S 5      S! 5       r&\" S"5      S# 5       r'\" S$5      S% 5       r(g)&a?  showing remotebookmarks and remotebranches in UI (EXPERIMENTAL)

By default both remotebookmarks and remotebranches are turned on. Config knob to
control the individually are as follows.

Config options to tweak the default behaviour:

remotenames.bookmarks
  Boolean value to enable or disable showing of remotebookmarks (default: True)

remotenames.branches
  Boolean value to enable or disable showing of remotebranches (default: True)

remotenames.hoistedpeer
  Name of the peer whose remotebookmarks should be hoisted into the top-level
  namespace (default: 'default')
é    )ÚannotationsN)Ú_)Úbin)
Ú	bookmarksÚerrorÚ
extensionsÚlogexchangeÚ
namespacesÚ	registrarÚ
revsetlangÚsmartsetÚtemplateutilÚutil)Ú
stringutils   ships-with-hg-coreó   remotenamesó	   bookmarksT)Údefaultó   branchesó   hoistedpeers   defaultc                  ó^   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS r\rSrg)ÚlazyremotenamedictéM   aÜ  
Read-only dict-like Class to lazily resolve remotename entries

We are doing that because remotenames startup was slow.
We lazily read the remotenames file once to figure out the potential entries
and store them in self.potentialentries. Then when asked to resolve an
entry, if it is not in self.potentialentries, then it isn't there, if it
is in self.potentialentries we resolve it and store the result in
self.cache. We cannot be lazy is when asked all the entries (keys).
c                óF   • 0 U l         0 U l        Xl        X l        SU l        g )NF)ÚcacheÚpotentialentriesÚ_kindÚ_repoÚloaded)ÚselfÚkindÚrepos      Ú3/usr/lib/python3/dist-packages/hgext/remotenames.pyÚ__init__Úlazyremotenamedict.__init__Y   s"   € ØˆŒ
Ø "ˆÔØŒ
ØŒ
Øˆ�ó    c                ó°   • SU l         U R                  n[        R                  " XR                  5       H  u  p#nUS-   U-   nX#U4U R
                  U'   M!     g)z?Read the remotenames file, store entries matching selected kindTó   /N)r   r   r	   Úreadremotenamefiler   r   )r   r!   ÚnodeÚrpathÚrnameÚnames         r"   Ú_loadÚlazyremotenamedict._load`   sX   € àˆŒØ�z‰zˆÜ"-×"@Ò"@Ø—*‘*ö#
ÑˆD˜ð ˜4‘< %Ñ'ˆDØ+/¸Ð*=ˆD×!Ñ! $Ó'ò	#
r%   c                ó"  • XR                   ;  a  gU R                   U   u  p#nU R                  n[        U5      n UR                  R	                  U5        U R                  S:X  a  XV   R                  5       (       a  gU/$ ! [
         a     gf = f)z;Check that the node for potentialentry exists and return itNr   )r   r   r   Ú	changelogÚrevÚLookupErrorr   Úclosesbranch)r   Úpotentialentryr)   Úremoter,   r!   Úbinnodes          r"   Ú_resolvedataÚlazyremotenamedict._resolvedataj   sŒ   € à×!6Ñ!6Ó6ØØ!×2Ñ2°>ÑBÑˆ�dØ�z‰zˆÜ�d“)ˆð	Ø�N‰N×Ñ˜wÔ'ð �:‰:˜Ó$¨©×)CÑ)C×)EÑ)EØØˆyÐøô ó 	Ùð	ús   »B Â
BÂBc                ó„   • U R                   (       d  U R                  5         U R                  U5      nUb  U$ [        5       e©N)r   r-   Ú_fetchandcacheÚKeyError©r   ÚkeyÚvals      r"   Ú__getitem__Úlazyremotenamedict.__getitem__{   s4   € Ø�{�{Ø�J‰JŒLØ×!Ñ! #Ó&ˆØ‰?ØˆJä“*Ðr%   c                ó,   • [        U R                  5      $ r:   )Úiterr   ©r   s    r"   Ú__iter__Úlazyremotenamedict.__iter__„   s   € Ü�D×)Ñ)Ó*Ð*r%   c                ó,   • [        U R                  5      $ r:   )Úlenr   rD   s    r"   Ú__len__Úlazyremotenamedict.__len__‡   s   € Ü�4×(Ñ(Ó)Ð)r%   c                ó   • [         er:   ©ÚNotImplementedError)r   ÚkÚvs      r"   Ú__setitem__Úlazyremotenamedict.__setitem__Š   ó   € Ü!Ð!r%   c                ó   • [         er:   rL   )r   rN   s     r"   Ú__delitem__Úlazyremotenamedict.__delitem__�   rR   r%   c                óˆ   • XR                   ;   a  U R                   U   $ U R                  U5      nUb  X R                   U'   U$ g r:   )r   r7   r=   s      r"   r;   Ú!lazyremotenamedict._fetchandcache�   sB   € Ø—*‘*ÓØ—:‘:˜c‘?Ð"Ø×Ñ Ó$ˆØ‰?Ø!�J‰J�s‰OØˆJàr%   c                óx   • U R                   (       d  U R                  5         U R                  R                  5       $ )z&Get a list of bookmark or branch names)r   r-   r   ÚkeysrD   s    r"   rY   Úlazyremotenamedict.keysš   s'   € à�{�{Ø�J‰JŒLØ×$Ñ$×)Ñ)Ó+Ð+r%   c              #  óº   #   • U R                   (       d  U R                  5         U R                  R                  5        H  u  pU[	        US   5      /4v •  M     g7f)z Iterate over (name, node) tuplesr   N)r   r-   r   Úitemsr   )r   rN   Úvtups      r"   Ú	iteritemsÚlazyremotenamedict.iteritems    sG   é € ð �{�{Ø�J‰JŒLà×,Ñ,×2Ñ2Ö4‰GˆAØ”s˜4 ™7“|�nÐ%Ô%ò 5ùs   ‚AA)r   r   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r#   r-   r7   r@   rE   rI   rP   rT   r;   rY   r^   r\   Ú__static_attributes__© r%   r"   r   r   M   sE   † ñ	òò>òò"ò+ò*ò"ò"òò,ò&ð ƒEr%   r   c                  óN   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rSrg)Úremotenamesé¬   a  
This class encapsulates all the remotenames state. It also contains
methods to access that state in convenient ways. Remotenames are lazy
loaded. Whenever client code needs to ensure the freshest copy of
remotenames, use the `clearnames` method to force an eventual load.
c                ó0   • Xl         U R                  5         g r:   )r   Ú
clearnames)r   r!   Úargss      r"   r#   Úremotenames.__init__´   s   € ØŒ
Ø�‰Õr%   c                ó�   • [        SU R                  5      U l        [        SU R                  5      U l        U R	                  5         g)zClear all remote names stater   r   N)r   r   r   ÚbranchesÚ_invalidatecacherD   s    r"   rk   Úremotenames.clearnames¸   s2   € ä+¨L¸$¿*¹*ÓEˆŒÜ*¨;¸¿
¹
ÓCˆŒØ×ÑÕr%   c                ó<   • S U l         S U l        S U l        S U l        g r:   )Ú_nodetobmarksÚ_nodetobranchÚ_hoisttonodesÚ_nodetohoistsrD   s    r"   rp   Úremotenames._invalidatecache¾   s"   € Ø!ˆÔØ!ˆÔØ!ˆÔØ!ˆÕr%   c                ó   • U R                   $ r:   )r   rD   s    r"   ÚbmarktonodesÚremotenames.bmarktonodesÄ   s   € Ø�~‰~Ðr%   c                óø   • U R                   (       d^  U R                  5       n0 U l         UR                  5        H3  u  p#U R                   R                  US   / 5      R	                  U5        M5     U R                   $ )Nr   )rs   ry   r\   Ú
setdefaultÚappend)r   ry   r,   r)   s       r"   ÚnodetobmarksÚremotenames.nodetobmarksÇ   sg   € Ø×!×!Ø×,Ñ,Ó.ˆLØ!#ˆDÔØ*×0Ñ0Ö2‘
�Ø×"Ñ"×-Ñ-¨d°1©g°rÓ:×AÑAÀ$ÖGñ 3à×!Ñ!Ð!r%   c                ó   • U R                   $ r:   )ro   rD   s    r"   ÚbranchtonodesÚremotenames.branchtonodesÏ   s   € Ø�}‰}Ðr%   c                ó  • U R                   (       dd  U R                  5       n0 U l         UR                  5        H9  u  p#U H.  nU R                   R                  U/ 5      R	                  U5        M0     M;     U R                   $ r:   )rt   r�   r\   r|   r}   )r   r�   r,   Únodesr)   s        r"   ÚnodetobranchÚremotenames.nodetobranchÒ   so   € Ø×!×!Ø ×.Ñ.Ó0ˆMØ!#ˆDÔØ,×2Ñ2Ö4‘�Û!�DØ×&Ñ&×1Ñ1°$¸Ó;×BÑBÀ4ÖHó "ñ  5ð ×!Ñ!Ð!r%   c                ó  • U R                   (       di  U R                  5       n0 U l         US-  nUR                  5        H9  u  p4UR                  U5      (       d  M  U[	        U5      S  nX@R                   U'   M;     U R                   $ )Nr'   )ru   ry   r\   Ú
startswithrH   ©r   ÚhoistÚmarktonodesr,   r)   s        r"   ÚhoisttonodesÚremotenames.hoisttonodesÛ   sz   € Ø×!×!Ø×+Ñ+Ó-ˆKØ!#ˆDÔØ�T‰MˆEØ)×/Ñ/Ö1‘
�Ø—?‘? 5×)Ó)Ø¤ E£
 Ð-�DØ/3×&Ñ& tÓ,ñ 2ð ×!Ñ!Ð!r%   c                óN  • U R                   (       d‰  U R                  5       n0 U l         US-  nUR                  5        HY  u  p4UR                  U5      (       d  M  U[	        U5      S  nU R                   R                  US   / 5      R                  U5        M[     U R                   $ )Nr'   r   )rv   ry   r\   rˆ   rH   r|   r}   r‰   s        r"   ÚnodetohoistsÚremotenames.nodetohoistsæ   s‘   € Ø×!×!Ø×+Ñ+Ó-ˆKØ!#ˆDÔØ�T‰MˆEØ)×/Ñ/Ö1‘
�Ø—?‘? 5×)Ó)Ø¤ E£
 Ð-�DØ×&Ñ&×1Ñ1°$°q±'¸2Ó>×EÑEÀdÖKñ 2ð ×!Ñ!Ð!r%   )ru   rs   rt   rv   r   r   ro   N)r`   ra   rb   rc   rd   r#   rk   rp   ry   r~   r�   r…   rŒ   r�   re   rf   r%   r"   rh   rh   ¬   s4   † ñòò ò"òò"òò"ò	"õ	"r%   rh   c                óÐ   • SUR                   ;  a  g UR                   S   nUR                  U5       H)  nUR                  X&5      nU(       d  M  US   nUSS4XF'   M+     U " XX45      $ )Nó   remotebookmarksr   ó    r%   )ÚnamesÚ	listnamesr„   )	ÚorigÚuir!   ÚfmÚbmarksÚnsr,   r„   r)   s	            r"   Úwrapprintbookmarksr›   ò   sm   € Ø §¡Ó+ØØ	�‰Ð&Ñ	'€Bà—‘˜TÖ"ˆØ—‘˜Ó$ˆÞÙØ�Q‰xˆà˜d CÐ(ˆ‹ñ #ñ �˜"Ó%Ð%r%   c                óD   • [         R                  " [        S[        5        g )NÚ_printbookmarks)r   Úwrapfunctionr   r›   )r—   s    r"   ÚextsetuprŸ     s   € Ü×ÒœIÐ'8Ô:LÕMr%   c           
     óL  ^• UR                   R                  SSSS5        UR                  5       (       d  g [        U5      Ul        [
        R                  nU R                  SS5      (       av  U" SSSSS	 S
 S S9nUR                  R                  U5        U R                  SS5      mT(       a3  U" SSSSU4S jU4S jU4S jS9nUR                  R                  U5        U R                  SS5      (       a+  U" SSSSS S S S9nUR                  R                  U5        g g )Ns   experimentalr   Ts   remotenames-extr   r’   ó   remotebookmarks   remote bookmark:  %s
c                óR   • U R                   R                  5       R                  5       $ r:   )Ú_remotenamesry   rY   ©r!   s    r"   Ú<lambda>Úreposetup.<locals>.<lambda>  s   €  4×#4Ñ#4×#AÑ#AÓ#C×#HÑ#HÔ#Jr%   c                óV   • U R                   R                  5       R                  U/ 5      $ r:   )r£   ry   Úget©r!   r,   s     r"   r¥   r¦     ó#   €  t×'8Ñ'8×'EÑ'EÓ'G×'KÑ'KØ�bô(r%   c                óV   • U R                   R                  5       R                  U/ 5      $ r:   )r£   r~   r¨   ©r!   r)   s     r"   r¥   r¦     rª   r%   )ÚtemplatenameÚ	colornameÚlogfmtr•   ÚnamemapÚnodemapr   s   hoistednamess   hoistednames   hoisted name:  %s
c                óV   >• U R                   R                  T5      R                  5       $ r:   )r£   rŒ   rY   )r!   rŠ   s    €r"   r¥   r¦   (  s%   ø€  t×'8Ñ'8×'EÑ'EØó(ç‘$“&ð(r%   c                óZ   >• U R                   R                  T5      R                  U/ 5      $ r:   )r£   rŒ   r¨   )r!   r,   rŠ   s     €r"   r¥   r¦   +  ó)   ø€ ¨4×+<Ñ+<×+IÑ+IØó,ç‘#�d˜B“-ð, r%   c                óZ   >• U R                   R                  T5      R                  U/ 5      $ r:   )r£   r�   r¨   )r!   r)   rŠ   s     €r"   r¥   r¦   .  r´   r%   r   ó   remotebranchesó   remotebranchs   remote branch:  %s
c                óR   • U R                   R                  5       R                  5       $ r:   )r£   r�   rY   r¤   s    r"   r¥   r¦   :  s   €  4×#4Ñ#4×#BÑ#BÓ#D×#IÑ#IÔ#Kr%   c                óV   • U R                   R                  5       R                  U/ 5      $ r:   )r£   r�   r¨   r©   s     r"   r¥   r¦   ;  s#   €  t×'8Ñ'8×'FÑ'FÓ'H×'LÑ'LØ�bô(r%   c                óV   • U R                   R                  5       R                  U/ 5      $ r:   )r£   r…   r¨   r¬   s     r"   r¥   r¦   >  rª   r%   )r—   Ú	setconfigÚlocalrh   r£   r
   Ú	namespaceÚ
configboolr”   ÚaddnamespaceÚconfig)r—   r!   rš   ÚremotebookmarknsÚhoistednamensÚremotebranchnsrŠ   s         @r"   Ú	reposetuprÄ     s'  ø€ à‡G�G×Ñ�o ~°tÐ=OÔPà�:‰:�<‰<Øä# DÓ)€DÔÜ	×	Ñ	€Bà	‡}�}�^ \×2Ñ2ÙØØ+Ø'Ø,ÙJñññ
Ðð 	�
‰
×ÑÐ 0Ô1ð —	‘	˜.¨.Ó9ˆÞÙØØ,Ø(Ø-ôô ô ñˆMð �J‰J×#Ñ# MÔ2à	‡}�}�^ [×1Ñ1ÙØØ*Ø%Ø*ÙKñññ
ˆð 	�
‰
×Ñ Õ/ð 2r%   ó   repoó   ctx)Úrequiresc                óp  • U R                  US5      nU R                  US5      n/ nSUR                  ;   a,  UR                  S   R                  X#R                  5       5      nSUR                  ;   a.  XBR                  S   R                  X#R                  5       5      -  n[        R                  " XSUSS9$ )z<List of strings. Remote names associated with the changeset.rÅ   rÆ   r’   r¶   s
   remotenamer   ©Úplural©Úresourcer”   r)   r   Ú
compatlist)ÚcontextÚmappingr!   Úctxrh   s        r"   ÚremotenameskwrÑ   E  s¤   € ð ×Ñ˜G WÓ-€DØ
×
Ñ
˜7 FÓ
+€Cà€KØ˜TŸZ™ZÓ'Ø—j‘jÐ!3Ñ4×:Ñ:¸4ÇÁÃÓLˆà˜DŸJ™JÓ&Ø—z‘zÐ"3Ñ4×:Ñ:¸4ÇÁÃÓLÑLˆä×"Ò"Ø˜-¨¸^ñð r%   r’   c                óö   • U R                  US5      nU R                  US5      n/ nSUR                  ;   a,  UR                  S   R                  X#R                  5       5      n[        R                  " U USUSS9$ )z@List of strings. Remote bookmarks associated with the changeset.rÅ   rÆ   r’   r¡   rÉ   rË   )rÎ   rÏ   r!   rÐ   Úremotebmarkss        r"   ÚremotebookmarkskwrÔ   W  s{   € ð ×Ñ˜G WÓ-€DØ
×
Ñ
˜7 FÓ
+€Cà€LØ˜TŸZ™ZÓ'Ø—z‘zÐ"4Ñ5×;Ñ;¸DÇ(Á(Ã*ÓMˆä×"Ò"ØØØØØ!ñð r%   r¶   c                óö   • U R                  US5      nU R                  US5      n/ nSUR                  ;   a,  UR                  S   R                  X#R                  5       5      n[        R                  " U USUSS9$ )z?List of strings. Remote branches associated with the changeset.rÅ   rÆ   r¶   r·   rÉ   rË   )rÎ   rÏ   r!   rÐ   Úremotebranchess        r"   Úremotebrancheskwr×   j  s{   € ð ×Ñ˜G WÓ-€DØ
×
Ñ
˜7 FÓ
+€Cà€NØ˜DŸJ™JÓ&ØŸ™Ð$5Ñ6×<Ñ<¸TÇ8Á8Ã:ÓNˆä×"Ò"ØØØØØ ñð r%   c                ó¦  ^• [         R                  " USS[        S5      5      nU(       a;  [        R                  " [         R
                  " US   [        S5      5      5      u  pVnOS=pV[        R                  n[        5       nU R                  mU Hj  n	X�R                  ;   d  M  U R                  U	   n
U
R                  U 5       H2  nU" U5      (       d  M  UR                  U
R                  X5      5        M4     Ml     US:X  a)  U(       d"  [        R                  " [        S5      U-  5      eU4S jU 5       nU[         R"                  " U5      -  $ )	z<utility function to return a set of revs based on the rtypesr   é   s   only one argument accepteds   argument must be a stringNs   literals   remote name '%s' does not existc              3  óv   >#   • U  H.  nTR                  U5      (       d  M  TR                  U5      v •  M0     g 7fr:   )Úhasnoder1   )Ú.0ÚnÚcls     €r"   Ú	<genexpr>Ú_revsetutil.<locals>.<genexpr>–  s'   øé € Ð6šu˜!¨¯
©
°1¯‹IˆB�F‰F�1�IˆIšuùs   ƒ9¡9)r   Úgetargsr   r   ÚstringmatcherÚ	getstringr   ÚalwaysÚsetr0   r”   r•   Úupdater„   r   ÚRepoLookupErrorr   Úbaseset)r!   ÚsubsetÚxÚrtypesrl   r    ÚpatternÚmatcherr„   Úrtyperš   r,   ÚrevsrÞ   s                @r"   Ú_revsetutilrð   }  s  ø€ ä×Ò˜a  A¤qÐ)FÓ'GÓH€DÞÜ!+×!9Ò!9Ü× Ò   a¡¬!Ð,HÓ*IÓJó"
Ñˆ‘wð ÐˆÜ—+‘+ˆä‹E€EØ	�‰€BÛˆØ—J‘JÕØ—‘˜EÑ"ˆBØŸ™ TÖ*�Ù˜t—}‘}ÙØ—‘˜RŸX™X dÓ1Ö2ó +ñ ð ˆzÓ¦%Ü×#Ò#ÜÐ0Ó1°GÑ;ó
ð 	
ô 7™uÓ6€DØ”H×$Ò$ TÓ*Ñ*Ð*r%   s   remotenames([name])c                ó   • [        XUS5      $ )zÐAll changesets which have a remotename on them. If `name` is
specified, only remotenames of matching remote paths are considered.

Pattern matching is supported for `name`. See :hg:`help revisions.patterns`.
)r’   r¶   ©rð   ©r!   ré   rê   s      r"   Úremotenamesrevsetrô   š  s   € ô �t QÐ(OÓPÐPr%   s   remotebranches([name])c                ó   • [        XUS5      $ )zÒAll changesets which are branch heads on remotes. If `name` is
specified, only remotenames of matching remote paths are considered.

Pattern matching is supported for `name`. See :hg:`help revisions.patterns`.
)r¶   rò   ró   s      r"   Úremotebranchesrevsetrö   ¤  s   € ô �t QÐ(<Ó=Ð=r%   s   remotebookmarks([name])c                ó   • [        XUS5      $ )zÐAll changesets which have bookmarks on remotes. If `name` is
specified, only remotenames of matching remote paths are considered.

Pattern matching is supported for `name`. See :hg:`help revisions.patterns`.
)r’   rò   ró   s      r"   Úremotebmarksrevsetrø   ®  s   € ô �t QÐ(=Ó>Ð>r%   ))rd   Ú
__future__r   Úcollections.abcÚcollectionsÚmercurial.i18nr   Úmercurial.noder   Ú	mercurialr   r   r   r	   r
   r   r   r   r   r   Úmercurial.utilsr   Ú
testedwithÚconfigtableÚ
configitemÚtemplatekeywordÚrevsetpredicateÚabcÚMutableMappingr   rh   r›   rŸ   rÄ   rÑ   rÔ   r×   rð   rô   rö   rø   rf   r%   r"   Ú<module>r     s‹  ðñõ$ #ã å å ÷÷ ÷ õ 'ð #€
à€Ø×!Ò! +Ó.€
Ø×+Ò+Ó-€Ø×+Ò+Ó-€á 
ØØØòñ
 ØØØòñ
 ØØØòô\˜Ÿ™×7Ñ7ô \÷~C"ñ C"òL&ò Nò<0ñ~ �¨7°FÐ*;Ñ<ñó =ðñ" Ð#¨w¸Ð.?Ñ@ñó Aðñ$ Ð"¨g°vÐ->Ñ?ñó @ðò$+ñ: Ð'Ó(ñQó )ðQñ Ð*Ó+ñ>ó ,ð>ñ Ð+Ó,ñ?ó -ñ?r%   