HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/lib64/python2.7/site-packages/hgext/remotenames.pyo
�
1�3\c@@s-dZddlmZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZddlmZe
jr�ddlZejjZnddlZejZdZiZeje�Zej�Zej�Zed	d
de �ed	dde �ed	d
dd�defd��YZ!d	e"fd��YZ#d�Z$d�Z%d�Z&ed	dddh�d��Z'eddddh�d��Z(eddddh�d��Z)d�Z*ed�d��Z+ed�d ��Z,ed!�d"��Z-dS(#s@ 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')
i(tabsolute_import(t_(tbin(t	bookmarksterrort
extensionstlogexchanget
namespacestpycompatt	registrart
revsetlangtsmartsetttemplateutiltutil(t
stringutilNsships-with-hg-coretremotenamesRtdefaulttbranchesthoistedpeertlazyremotenamedictcB@sqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(s�
    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).
    cC@s1i|_i|_||_||_t|_dS(N(tcachetpotentialentriest_kindt_repotFalsetloaded(tselftkindtrepo((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt__init__[s
				cC@sct|_|j}xJtj||j�D]3\}}}|d|}|||f|j|<q(WdS(sA Read the remotenames file, store entries matching selected kind t/N(tTrueRRRtreadremotenamefileRR(RRtnodetrpathtrnametname((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt_loadbs		cC@s�||jkrdS|j|\}}}|j}t|�}y|jj|�Wntk
rfdSX|jdkr�||j�r�dS|gS(s= Check that the node for potentialentry exists and return it RN(	RtNoneRRt	changelogtrevtLookupErrorRtclosesbranch(RtpotentialentryR!tremoteR$Rtbinnode((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt_resolvedataks	
cC@sB|js|j�n|j|�}|dk	r5|St��dS(N(RR%t_fetchandcacheR&tKeyError(Rtkeytval((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt__getitem__|s	
cC@s
t|j�S(N(titerR(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt__iter__�scC@s
t|j�S(N(tlenR(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt__len__�scC@s
t�dS(N(tNotImplementedError(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt__setitem__�scC@s
t�dS(N(R8(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt__delitem__�scC@sN||jkr|j|S|j|�}|dk	rF||j|<|SdSdS(N(RR.R&(RR1R2((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyR/�s
cC@s#|js|j�n|jj�S(s( Get a list of bookmark or branch names (RR%Rtkeys(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyR;�s	
cc@sR|js|j�nx5|jj�D]$\}}|t|d�gfVq&WdS(s" Iterate over (name, node) tuples iN(RR%Rt	iteritemsR(Rtktvtup((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyR<�s	
(t__name__t
__module__t__doc__RR%R.R3R5R7R9R:R/R;R<(((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRPs
											
	cB@s_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
s%
    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.
    cG@s||_|j�dS(N(Rt
clearnames(RRtargs((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyR�s	cC@s8td|j�|_td|j�|_|j�dS(s Clear all remote names state RRN(RRRRt_invalidatecache(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRB�scC@s(d|_d|_d|_d|_dS(N(R&t
_nodetobmarkst
_nodetobrancht
_hoisttonodest
_nodetohoists(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRD�s			cC@s|jS(N(R(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytbmarktonodes�scC@se|js^|j�}i|_x=|j�D],\}}|jj|dg�j|�q+Wn|jS(Ni(RERIR<t
setdefaulttappend(RRIR$R!((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytnodetobmarks�s		'cC@s|jS(N(R(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt
branchtonodes�scC@sr|jsk|j�}i|_xJ|j�D]9\}}x*|D]"}|jj|g�j|�q>Wq+Wn|jS(N(RFRMR<RJRK(RRMR$tnodesR!((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytnodetobranch�s		
'cC@s~|jsw|j�}i|_|d7}xL|j�D];\}}|j|�r5|t|�}||j|<q5q5Wn|jS(NR(RGRIR<t
startswithR6(RthoisttmarktonodesR$R!((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pythoisttonodes�s		
cC@s�|js�|j�}i|_|d7}x_|j�D]N\}}|j|�r5|t|�}|jj|dg�j|�q5q5Wn|jS(NRi(RHRIR<RPR6RJRK(RRQRRR$R!((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytnodetohoists�s		
*(R?R@RARRBRDRIRLRMRORSRT(((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyR�s									c	C@s�d|jkrdS|jd}xR|j|�D]A}|j||�}|sTq0n|d}|ddf||<q0W|||||�S(Ntremotebookmarksit t(tnamest	listnamesRN(	torigtuiRtfmtbmarkstnsR$RNR!((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytwrapprintbookmarks�s

cC@stjtdt�dS(Nt_printbookmarks(RtwrapfunctionRR_(R[((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytextsetup�sc@sw|jjddtd�|j�s)dSt|�|_tj}|jdd�r|dddddd	d
dd�d
d�dd��}|j	j
|�|jdd���r|dddddd	dd�fd�d
�fd�d�fd��}|j	j
|�qn|jdd�rs|dddddd	ddd�d
d�dd��}|j	j
|�ndS(NtexperimentalRsremotenames-extRRUttemplatenamet	colornametremotebookmarktlogfmtsremote bookmark:  %s
RYcS@s|jj�j�S(N(t_remotenamesRIR;(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt<lambda>RWtnamemapcS@s|jj�j|g�S(N(RhRItget(RR$((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRistnodemapcS@s|jj�j|g�S(N(RhRLRk(RR!((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRisRthoistednamesthoistednameshoisted name:  %s
c@s|jj��j�S(N(RhRSR;(R(RQ(s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRi!sc@s|jj��j|g�S(N(RhRSRk(RR$(RQ(s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRi#sc@s|jj��j|g�S(N(RhRTRk(RR!(RQ(s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRi%sRtremotebranchestremotebranchsremote branch:  %s
cS@s|jj�j�S(N(RhRMR;(R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRi/RWcS@s|jj�j|g�S(N(RhRMRk(RR$((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRi0scS@s|jj�j|g�S(N(RhRORk(RR!((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyRi2s(R[t	setconfigRtlocalRRhRt	namespacet
configboolRXtaddnamespacetconfig(R[RR^tremotebookmarknst
hoistednamenstremotebranchns((RQs7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt	reposetupsH					trequiresRtctxcC@s�|j|d�}|j|d�}g}d|jkr[|jdj||j��}nd|jkr�||jdj||j��7}ntj||d|dd�S(s<List of strings. Remote names associated with the changeset.RR|RURot
remotenametpluralR(tresourceRXR!Rt
compatlist(tcontexttmappingRR|R((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt
remotenameskw6s"&RUcC@sw|j|d�}|j|d�}g}d|jkr[|jdj||j��}ntj||d|dd�S(s@List of strings. Remote bookmarks associated with the changeset.RR|RURfR~(RRXR!RR�(R�R�RR|tremotebmarks((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytremotebookmarkskwFs"RocC@sw|j|d�}|j|d�}g}d|jkr[|jdj||j��}ntj||d|dd�S(s?List of strings. Remote branches associated with the changeset.RR|RoRpR~(RRXR!RR�(R�R�RR|Ro((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytremotebrancheskwSs"c
@sEtj|ddtd��}|rUtjtj|dtd���\}}}nd}}tj}t	�}|j
�xr|D]j}	|	|jkr�|j|	}
xE|
j|�D]1}||�s�q�n|j
|
j||��q�Wq�q�W|dkr|rtjtd�|��n�fd�|D�}|tj|�@S(	s<utility function to return a set of revs based on the rtypesiisonly one argument acceptedsargument must be a stringtliteralsremote name '%s' does not existc3@s-|]#}�j|�r�j|�VqdS(N(thasnodeR((t.0tn(tcl(s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pys	<genexpr>wsN(R
tgetargsRRt
stringmatchert	getstringR&R
talwaystsetR'RXRYtupdateRNRtRepoLookupErrorRtbaseset(
RtsubsettxtrtypesRCRtpatterntmatcherRNtrtypeR^R$trevs((R�s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt_revsetutil`s(+
			

$
sremotenames([name])cC@st|||d�S(s�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`.
    RURo(RURo(R�(RR�R�((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytremotenamesrevsetzssremotebranches([name])cC@st|||d�S(s�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`.
    Ro(Ro(R�(RR�R�((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytremotebranchesrevset�ssremotebookmarks([name])cC@st|||d�S(s�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`.
    RU(RU(R�(RR�R�((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pytremotebmarksrevset�s(.RAt
__future__Rtmercurial.i18nRtmercurial.nodeRt	mercurialRRRRRRR	R
RRR
tmercurial.utilsRtispy3tcollections.abctcollectionstabctMutableMappingtmutablemappingt
testedwithtconfigtablet
configitemttemplatekeywordtrevsetpredicateRRtobjectRR_RbRzR�R�R�R�R�R�R�(((s7/usr/lib64/python2.7/site-packages/hgext/remotenames.pyt<module>sBL		ZE			5!!
!