Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/mercurial/repoview.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��c@s�ddlZddlZddlZddlZddlZd�Zd�Zd�Zd�Zd�Z	ied6ed6ed	6e	d
6Z
idd6dd6d	d6d
d	6Zd�Z
defd
��YZdS(i�NcCstj|d�S(scRevisions candidates to be hidden

    This is a standalone function to help extensions to wrap it.tobsolete(Rtgetrevs(trepo((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pythideablerevssc	s|jjst�t|�}|r|j}t|�}|jd|�}gtj|||�D]}||krb|^qb}x+|dj	�D]}|j
|j��q�Wx.|jj
�D]}|j
||j��q�W|j|dt��t�fd�|D��St�S(sbcompute the set of hidden revision to filter

    During most operation hidden should be filtered.tstartt	inclusivec3s!|]}|�kr|VqdS(N((t.0tr(tblocked(s6/sys/lib/python2.7/site-packages/mercurial/repoview.pys	<genexpr>&sN(t	changelogtfilteredrevstAssertionErrorRtmintrevstrevsett	_childrentNonetparentstappendtrevt
_bookmarkstvaluest	ancestorstTruet	frozenset(	Rthideabletclt
firsthideableR
Rtblockerstpartbm((Rs6/sys/lib/python2.7/site-packages/mercurial/repoview.pyt
computehiddens	cs��jjst�t�d�}tj��r��j�tj��jj�t	�fd��jj
�D��}�jd|�}t���fd�|D��}t
||B�S|SdS(s�compute the set of revision that should be filtered when used a server

    Secret and hidden changeset should not pretend to be here.tvisiblec3s|]}�j|�VqdS(N(R(Rtn(R(s6/sys/lib/python2.7/site-packages/mercurial/repoview.pys	<genexpr>4sRc3s*|] }��|��kr|VqdS(N((RR(tgetphaseRtsecret(s6/sys/lib/python2.7/site-packages/mercurial/repoview.pys	<genexpr>6sN(R	R
Rt
filterrevstphasest	hassecretR#t_phasecachetphaseRt
phaserootsR
tsetR(RthiddenstfirstR
tsecrets((RR"RR#s6/sys/lib/python2.7/site-packages/mercurial/repoview.pytcomputeunserved)s		&"csk�jjst�tj�jjd�rd�jj�t�d�}t	��fd�|D��St	�S(s�compute the set of revision that should be filtered when used a server

    Secret and hidden changeset should not pretend to be here.itbasec3s$|]}��|�r|VqdS(N((RR(R"R(s6/sys/lib/python2.7/site-packages/mercurial/repoview.pys	<genexpr>Ds(
R	R
RtutiltanyR'R)R(R$R(Rt
maymutable((R"Rs6/sys/lib/python2.7/site-packages/mercurial/repoview.pytcomputemutable;scs�|jjst�|j�t��}xF|jjdD]4}|r9t|t�fd�|D���}q9q9Wtd|�}tt	|t����S(s.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 egal or
    higher than the first mutable changeset is filtered.ic3s|]}�j|�VqdS(N(R(RR(R(s6/sys/lib/python2.7/site-packages/mercurial/repoview.pys	<genexpr>[si(
R	R
RtlenR'R)RtmaxRtxrange(Rtfirstmutabletroots((Rs6/sys/lib/python2.7/site-packages/mercurial/repoview.pytcomputeimpactableGs	,R tservedt	immutableR/cCs@||jkr5t|}||j��|j|<n|j|S(s5returns set of filtered revision for this filter name(tfilteredrevcachetfiltertablet
unfiltered(Rt
filternametfunc((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyR$ps
trepoviewcBsbeZdZd�Zed��Zd�Zd�Zd�Zd�Z	d�Z
ed��ZRS(	s�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`.
    cCsPtj|d|�tj|d|�tj|dd�tj|dd�dS(Nt_unfilteredrepoR?t_clcachekeyt_clcache(tobjectt__setattr__R(tselfRR?((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyt__init__�scCs|j}|j}t||j�}|j}t|�|j�t|�f}|dk	r�|j	}z.d|_t|�|j�t|�f}Wd||_	X||j
ks�||kr�d}q�n|dkrtj|�}||_	tj
|d|�tj
|d|�n|S(s_return a filtered version of the changeset

        this changelog must not be used for writingNRDRC((RBR	R$R?RDR4ttipthashRR
RCtcopyRERF(RGtunfit
unfichangelogR
Rtnewkeyt	oldfiltertcurkey((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyR	�s&			!		%
	cCs|jS(s&Return an unfiltered version of a repo(RB(RG((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyR>�scCs&||jkr|S|j�j|�S(s)Return a filtered version of a repository(R?R>tfiltered(RGtname((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyRQ�scCst|j|�S(N(tgetattrRB(RGtattr((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyt__getattr__�scCst|j||�S(N(tsetattrRB(RGRTtvalue((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyRF�scCst|j|�S(N(tdelattrRB(RGRT((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyt__delattr__�scCs
|jjS(N(RBtrequirements(RG((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyRZ�s(t__name__t
__module__t__doc__RHtpropertyR	R>RQRURFRYRZ(((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyRAws!						(RKR%R0RRRRR.R3R9R=RtsubsettableR$RERA(((s6/sys/lib/python2.7/site-packages/mercurial/repoview.pyt<module>	s$					



	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.