https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/hgext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/__pycache__/remotenames.cpython-310.pyc
o

�]Lb 7�@s�dZddlmZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZddlmZe
jr@ddlZejjZnddlZejZdZiZe�e�Ze��Ze��Zed	d
dd�ed	d
dd�ed	ddd�Gdd�de�Z Gdd�de!�Z"dd�Z#dd�Z$dd�Z%ed	ddhd�dd��Z&edddhd�d d!��Z'ed"ddhd�d#d$��Z(d%d&�Z)ed'�d(d)��Z*ed*�d+d,��Z+ed-�d.d/��Z,dS)0a@ 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')
�)�absolute_import)�_)�bin)�	bookmarks�error�
extensions�logexchange�
namespaces�pycompat�	registrar�
revsetlang�smartset�templateutil�util)�
stringutilNsships-with-hg-core�remotenames�	bookmarksT)�default�branches�hoistedpeersdefaultc@sleZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZeZdS)�lazyremotenamedicta�
    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).
    cCs"i|_i|_||_||_d|_dS)NF)�cache�potentialentries�_kind�_repo�loaded)�self�kind�repo�r�3/usr/lib/python3/dist-packages/hgext/remotenames.py�__init__as

zlazyremotenamedict.__init__cCsFd|_|j}t�||j�D]\}}}|d|}|||f|j|<q
dS)z?Read the remotenames file, store entries matching selected kindT�/N)rrr�readremotenamefilerr)rr�node�rpath�rname�namerrr �_loadhs��zlazyremotenamedict._loadcCsr||jvrdS|j|\}}}|j}t|�}z|j�|�Wn
ty(YdSw|jdkr6||��r6dS|gS)z;Check that the node for potentialentry exists and return itNr)rrr�	changelog�rev�LookupErrorr�closesbranch)r�potentialentryr$�remoter'r�binnoderrr �_resolvedatars
�zlazyremotenamedict._resolvedatacCs*|js|��|�|�}|dur|St���N)rr(�_fetchandcache�KeyError�r�key�valrrr �__getitem__�s
zlazyremotenamedict.__getitem__cC�
t|j�Sr1)�iterr�rrrr �__iter__��
zlazyremotenamedict.__iter__cCr8r1)�lenrr:rrr �__len__�r<zlazyremotenamedict.__len__cC�t�r1��NotImplementedErrorr:rrr �__setitem__��zlazyremotenamedict.__setitem__cCr?r1r@r:rrr �__delitem__�rCzlazyremotenamedict.__delitem__cCs8||jvr
|j|S|�|�}|dur||j|<|SdSr1)rr0r4rrr r2�s



z!lazyremotenamedict._fetchandcachecCs|js|��|j��S)z&Get a list of bookmark or branch names)rr(r�keysr:rrr rE�s
zlazyremotenamedict.keysccs>�|js|��t�|j�D]\}}|t|d�gfVqdS)z Iterate over (name, node) tuplesrN)rr(r
�	iteritemsrr)r�k�vtuprrr rF�s��zlazyremotenamedict.iteritemsN)�__name__�
__module__�__qualname__�__doc__r!r(r0r7r;r>rBrDr2rErF�itemsrrrr rUs
	
	rc@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�remotenamesa%
    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.
    cGs||_|��dSr1)r�
clearnames)rr�argsrrr r!�szremotenames.__init__cCs(td|j�|_td|j�|_|��dS)zClear all remote names staterrN)rrr�branches�_invalidatecacher:rrr rO�szremotenames.clearnamescCsd|_d|_d|_d|_dSr1)�
_nodetobmarks�
_nodetobranch�
_hoisttonodes�
_nodetohoistsr:rrr rR�s
zremotenames._invalidatecachecC�|jSr1)rr:rrr �bmarktonodes��zremotenames.bmarktonodescCsF|js |��}i|_t�|�D]\}}|j�|dg��|�q|jS)Nr)rSrXr
rF�
setdefault�append)rrXr'r$rrr �nodetobmarks�szremotenames.nodetobmarkscCrWr1)rQr:rrr �
branchtonodes�rYzremotenames.branchtonodescCsL|js#|��}i|_t�|�D]\}}|D]}|j�|g��|�qq|jSr1)rTr]r
rFrZr[)rr]r'�nodesr$rrr �nodetobranch�s�zremotenames.nodetobranchcCsZ|js*|��}i|_|d7}t�|�D]\}}|�|�r)|t|�d�}||j|<q|jS)Nr")rUrXr
rF�
startswithr=�r�hoist�marktonodesr'r$rrr �hoisttonodes�s

�zremotenames.hoisttonodescCsh|js1|��}i|_|d7}t�|�D]\}}|�|�r0|t|�d�}|j�|dg��|�q|jS)Nr"r)rVrXr
rFr`r=rZr[rarrr �nodetohoists�s
�zremotenames.nodetohoistsN)
rIrJrKrLr!rOrRrXr\r]r_rdrerrrr rN�s	rNc	Cs^d|jvrdS|jd}|�|�D]}|�||�}|sq|d}|ddf||<q|||||�S)N�remotebookmarksr� �)�names�	listnamesr^)	�orig�uir�fm�bmarks�nsr'r^r$rrr �wrapprintbookmarks�s

rpcCst�tdt�dS)Ns_printbookmarks)r�wrapfunctionrrp)rlrrr �extsetup
srrc
s�|j�dddd�|��sdSt|�|_tj}|�dd�rY|ddddd	d
�dd
�dd
�d
�}|j�	|�|�
dd���rY|dddd�fdd
��fdd
��fdd
�d
�}|j�	|�|�dd�rx|dddddd
�dd
�dd
�d
�}|j�	|�dSdS)NsexperimentalrTsremotenames-extrrf�remotebookmarksremote bookmark:  %s
cS�|j����Sr1)�_remotenamesrXrE�rrrr �<lambda>�zreposetup.<locals>.<lambda>cS�|j���|g�Sr1)rurX�get�rr'rrr rw �
�cSryr1)rur\rz�rr$rrr rw#r|)�templatename�	colorname�logfmtrj�namemap�nodemaprshoistednamesshoistednameshoisted name:  %s
cs|j�����Sr1)rurdrErv�rbrr rw1s�c�|j����|g�Sr1)rurdrzr{r�rr rw4��
cr�r1)rurerzr}r�rr rw7r�r�remotebranches�remotebranchsremote branch:  %s
cSrtr1)rur]rErvrrr rwCrxcSryr1)rur]rzr{rrr rwDr|cSryr1)rur_rzr}rrr rwGr|)rl�	setconfig�localrNrur	�	namespace�
configboolri�addnamespace�config)rlrro�remotebookmarkns�
hoistednamens�remotebranchnsrr�r �	reposetupsP
�



��
�r��repo�ctx)�requirescCst|�|d�}|�|d�}g}d|jvr|jd�||���}d|jvr0||jd�||���7}tj||d|dd�S)z<List of strings. Remote names associated with the changeset.r�r�rfr�s
remotenamer��plural��resourcerir$r�
compatlist)�context�mappingr�ctxrNrrr �
remotenameskwNs


�r�rfcC�P|�|d�}|�|d�}g}d|jvr|jd�||���}tj||d|dd�S)z@List of strings. Remote bookmarks associated with the changeset.r�r�rfrsr�r�)r�r�rr��remotebmarksrrr �remotebookmarkskw`�
�r�r�cCr�)z?List of strings. Remote branches associated with the changeset.r�r�r�r�r�r�)r�r�rr��remotebranchesrrr �remotebrancheskwsr�r�c
s�t�|ddtd��}|rt�t�|dtd���\}}}nd}}tj}t�}|j	�|D]"}	|	|j
vrN|j
|	}
|
�|�D]}||�sDq=|�|
�
||��q=q,|dkr^|s^t�td�|���fdd	�|D�}|t�|�@S)
z<utility function to return a set of revs based on the rtypesr�sonly one argument acceptedsargument must be a stringNsliteralsremote name '%s' does not existc3s$�|]
}��|�r��|�VqdSr1)�hasnoder*)�.0�n��clrr �	<genexpr>�s�"z_revsetutil.<locals>.<genexpr>)r�getargsrr�
stringmatcher�	getstringr�always�setr)rirj�updater^r�RepoLookupErrorr
�baseset)
r�subset�x�rtypesrPr�pattern�matcherr^�rtyperor'�revsrr�r �_revsetutil�s.�

�
�r�sremotenames([name])cC�t|||d�S)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`.
    )rfr��r��rr�r�rrr �remotenamesrevset��r�sremotebranches([name])cCr�)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�rrr �remotebranchesrevset�r�r�sremotebookmarks([name])cCr�)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`.
    )rfr�r�rrr �remotebmarksrevset�r�r�)-rL�
__future__r�mercurial.i18nr�mercurial.noder�	mercurialrrrrr	r
rrr
rr�mercurial.utilsr�ispy3�collections.abc�collections�abc�MutableMapping�mutablemapping�
testedwith�configtable�
configitem�templatekeyword�revsetpredicater�objectrNrprrr�r�r�r�r�r�r�r�rrrr �<module>sb4

���_F@



	
	

https://t.me/RX1948 - 2025