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/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/discovery.cpython-310.pyc
o

�]LbX�@s�ddlmZddlZddlmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZddd	�ZGd
d�de�Z	ddd
�Zdd�Zddd�Zdd�Zdd�Zdd�Zdd�ZdS)�)�absolute_importN�)�_)�hex�short)
�	bookmarks�	branchmap�error�obsolete�phases�pycompat�scmutil�setdiscovery�
treediscovery�utilFc	s�|�d�s
t�||||�S|r#|jj�t�fdd�|D��r#|d|fStj|j||||d�}|\}}}|rG|sG|jj�t	�fdd�|D��}t
|�||pPt
|�fS)a�Return a tuple (common, anyincoming, heads) used to identify the common
    subset of nodes between repo and remote.

    "common" is a list of (at least) the heads of the common subset.
    "anyincoming" is testable as a boolean indicating if any nodes are missing
      locally. If remote does not support getbundle, this actually is a list of
      roots of the nodes that would be incoming, to be supplied to
      changegroupsubset. No code except for pull should be relying on this fact
      any longer.
    "heads" is either the supplied heads, or else the remote's heads.
    "ancestorsof" if not None, restrict the discovery to a subset defined by
      these nodes. Changeset outside of this set won't be considered (but may
      still appear in "common").

    If you pass heads and they are all known locally, the response lists just
    these heads in "common" and in "heads".

    Please use findcommonoutgoing to compute the set of outgoing nodes to give
    extensions a good hook into outgoing.
    s	getbundlec3��|]}�|�VqdS�N���.0�h��	knownnoder�5/usr/lib/python3/dist-packages/mercurial/discovery.py�	<genexpr>;��z%findcommonincoming.<locals>.<genexpr>F)�abortwhenunrelated�ancestorsofc3��|]}�|�VqdSrr�r�n)�has_noderrrI��)�capabler�findcommonincoming�	changelog�hasnode�allr�findcommonheads�ui�any�list)	�repo�remote�heads�forcer�res�common�anyinc�srvheadsr)r!rrr$ s$

�
r$c@s@eZdZdZ	ddd�Zdd�Zejdd��Zejd	d
��Z	dS)�outgoinga�Represents the result of a findcommonoutgoing() call.

    Members:

      ancestorsof is a list of the nodes whose ancestors are included in the
      outgoing operation.

      missing is a list of those ancestors of ancestorsof that are present in
      local but not in remote.

      common is a set containing revs common between the local and the remote
      repository (at least all of those that are ancestors of ancestorsof).

      commonheads is the list of heads of common.

      excluded is the list of missing changeset that shouldn't be sent
      remotely.

    Some members are computed on demand from the heads, unless provided upfront
    by discovery.Ncs�d||fvsJ��j}|dur|��}|rDg}|D]}|��fdd�|�|�D��q|�||�\}}	}
t|��|
}�fdd�|D�}n|sJ�jg}||_||_||_	d|_
d|_g|_dS)Ncsg|]	}|�jkr|�qSr)�nullid)r�p)r,rr�
<listcomp>nsz%outgoing.__init__.<locals>.<listcomp>c�g|]}|�vr|�qSrrr)�includedrrr7u�)
r%r.�extend�parents�nodesbetween�setr5�commonheadsr�_revlog�_common�_missing�excluded)�selfr,r?r�missingroots�cl�	discbasesr �csets�rootsr.r)r9r,r�__init__cs( 
zoutgoing.__init__cCs"|j�|j|j�}|\|_|_dSr)r@�findcommonmissingr?rrArB)rD�setsrrr�_computecommonmissings�zoutgoing._computecommonmissingcC�|jdur	|��|jSr)rArM�rDrrrr1��
zoutgoing.commoncCrNr)rBrMrOrrr�missing�rPzoutgoing.missing)NNN)
�__name__�
__module__�__qualname__�__doc__rJrMr�
propertycacher1rQrrrrr4Ms
�
r4cs|t|dd�}|durt||||d�}|\|_}}|jjtjp!|j}	|	s,|p)|��|_	nc|durD|�
d���|_	dd�|�d�D�|_nK|j
�|j|�}
|
\|_}g|_}g|_}
|D]}||}|��tjksn|��rt|
�|�q]|�|�q]t|�t|�kr�|}nt�|||
�}||_	|r�|��|j
��fdd�|jD�}t��|��||_t|j���fd	d�|j	D�|_	|S)
aNReturn an outgoing instance to identify the nodes present in repo but
    not in other.

    If onlyheads is given, only nodes ancestral to nodes in onlyheads
    (inclusive) are included. If you already know the local repo's heads,
    passing them in onlyheads is faster than letting them be recomputed here.

    If commoninc is given, it must be the result of a prior call to
    findcommonincoming(repo, other, force) to avoid recomputing it here.

    If portable is given, compute more conservative common and ancestorsof,
    to make bundles created from the instance more portable.N)r/rsservedcSsg|]}|���qSr��node�r�ctxrrrr7��z&findcommonoutgoing.<locals>.<listcomp>ssecret() or extinct()csh|]}��|��qSr��revr)rFrr�	<setcomp>�sz%findcommonoutgoing.<locals>.<setcomp>cr8rrr)r?rrr7�r:)r4r$r?�_phasecache�
phaserootsr�secret�obsstorer.r�filteredr>rCr%rKrArB�phase�extinct�append�len�newheadsrM�	ancestors)r,�other�	onlyheadsr/�	commoninc�portable�og�_any�_hds�
mayexcluderL�
allmissingrQrCrXrZr�missingrevsr)rFr?r�findcommonoutgoing�sB�



rtcsN|j��}|j}|j}|j}i}t�}t�}|jD]}||}	|�|	�|�|	���q|�	��}
|
�
di���}Wd�n1sCwY|j}t
�|�D]*\}
}|
|vrYqPg}g}|D]}||�rk|�|�q_|�|�q_|t|�|f||
<qP|D]
}
|
|vr�dggf||
<q}t�|dd�t
�|�D��}|�|dd�|D��t
�|�D]\}
}|||
ddd�<q�t
�|�D]\}
}|D]
}|dur�|��q�|gf||
<q�|j�r%|jj��fdd�|jD�}|�fd	d�|jD�O}|jj|d
d�}tt
�|��D]!\}
}|\}}}}t|||�}|t|d�|t|d�f||
<�q|S)
acompute a summary of branch and heads status before and after push

    return {'branch': ([remoteheads], [newheads],
                       [unsyncedheads], [discardedheads])} mapping

    - branch: the branch name,
    - remoteheads: the list of remote heads known locally
                   None if the branch is new,
    - newheads: the new remote heads (known locally) with outgoing pushed,
    - unsyncedheads: the list of remote heads unknown locally,
    - discardedheads: the list of heads made obsolete by the push.
    �	branchmapNcss,�|]\}}|ddur||dfVqdS)rNrr�r�branchr.rrrrs�
��z _headssummary.<locals>.<genexpr>cs��|]}|��VqdSrr\rYrrrr
rrc�h|]}�|��qSrrr��torevrrr^r[z _headssummary.<locals>.<setcomp>cryrrrrzrrr^r[T)�	inclusiver)r,�
unfilteredr-r4r%r>rQ�addrw�commandexecutor�callcommand�resultr&r�	iteritemsrfr+r�remotebranchcache�update�sortrbr]rr?ri�sorted�_postprocessobsolete)�pushopr,r-r4rF�headssum�
missingctx�branchesr rZ�e�	remotemaprrwr.�known�unsyncedr�newmaprh�items�l�futureheads�allfuturecommon�remoteheads�
unsyncedheads�placeholderr�rrzr�
_headssummary�st




�����

�r�cs`|jj�t�fdd�|D��}|�d||j�}tdd�|D��}|r&dg}ng}d|||gfiS)z;Compute branchmapsummary for repo without branchmap supportc3s�|]	}�|�r|VqdSrrrrrrr/��z#_oldheadssummary.<locals>.<genexpr>sheads(%ln + %ln)csrxrrW)r�crrrr6rN)r%r&r�r>rQ)r,r�r4�inc�oldheads�rrhr�rrr�_oldheadssummary(sr�cs�|j��}|j}|j�|���}|�dddi���}Wd�n1s$wYt�}�fdd�|j�	dd�D�}�D]6}|�
|�}|rc||vrc|�|||}	}
t�||
|	�rb|�
|	���q<||vrr||vrr|�
�|�q<|S)Nslistkeyss	namespaces	bookmarkscsg|]}��|��qSr)�
expandname)r�b��localbookmarksrrr7Ps��z _nowarnheads.<locals>.<listcomp>spushing)r,r}r-�
_bookmarksrr�r�r>r)�
configlist�getr�	validdestr~rX)r�r,r-r��remotebookmarks�bookmarkedheads�newbookmarks�bm�rnode�lctx�rctxrr�r�_nowarnheads?s6

����
�
��r�cCsB|j��}|j}|j}|j}|j}t|j�}||jgkrdS|�	d�r(t
|�}nt||||�}||_dd�t
�|�D�}|r�|s�d�t|��}	t�}
|����D]
\}}}
}|r]|
�|�qP|
t|�@}
|
rqtd�|	t|
�f}ntd�|	}td�}tj||d	��t|�}d}tt
�|��D�]\}}|\}}}}|dur�t�}nt|�}|�|�d}t|�}|�|�|r�d|vr�d}nt�||�}|dur�|j�td
��n|dur�|j�td�|�n|j�td�||f�|du�r
t|�d
k�rt|�}|du�rtd�|}td�}nt|�t|�k�rt|||�}|�r�|du�rl|dv�r8td�t |d�|f}n(||d�!��rVtd�t |d�||d�!�df}n
td�t |d�}|�rhtd�}ntd�}|du�rz|j�"td��n
|j�"td�|�|D]
}|j�"dt |���q�q�|�r�tj||d	��dS)zpCheck that a push won't add any outgoing head

    raise StateError error and display ui message as needed.
    NrucSs g|]\}}|ddur|�qS)rNrrvrrrr7~s
�zcheckheads.<locals>.<listcomp>s, s0push creates new remote branches: %s (%d closed)s$push creates new remote branches: %ss8use 'hg push --new-branch' to create new remote branches)�hints,remote has heads that are not known locally
s0remote has heads that are not known locally: %s
s?remote has heads on branch '%s' that are not known locally: %s
rs0push creates new branch '%s' with multiple headss?merge or see 'hg help push' for details about pushing new heads)sdefaultNs.push creates new remote head %s on branch '%s'rs2push creates new remote head %s with bookmark '%s'spush creates new remote head %ssHpull and merge or see 'hg help push' for details about pushing new headssnew remote heads:
s!new remote heads on branch '%s':
s %s
)#r,r}r-r4r��	newbranch�bool�incomingr5r#r�r��
pushbranchmaprr��joinr�r>r�iterbranchesr~rrgr	�
StateErrorr�r�r
�
nodesummariesr)�statusr+rr�note)r�r,r-r4r�r�r�r��newbranches�branchnames�closedbranches�tagr.�tip�isclosed�errmsgr��nowarnheads�errormsgrwrhr��discardedheads�oldhs�dhs�newhsrrrr�
checkheadsbs�



�
��

������

����

�
�������
��r�cs�|j}|����jjj�tj��jj����fdd����fdd�}t	�
t�j|���jj
}t�}t�}t�}t�}	|D]$}
|
�vrH|�|
�q<|�|
�dur[d}|j�|t|
��|	�|
�q<t|�dkrp|	t|�Bt�fSt��d�}t��|�|r�|��}
�|
�}�|
��}�|�s�||vr�|�|
�q|��d|
||�}g}|D]}�|}|��|kr�|�|���q�t�fd	d
�|D��s�t��fdd
�|D��s�t�fdd
�|D��r�|�|
�n|�|
�|s~||	O}||fS)
z�post process the list of new heads with obsolescence information

    Exists as a sub-function to contain the complexity and allow extensions to
    experiment with smarter logic.

    Returns (newheads, discarded_heads) tuple
    cs��|��kSrr)r�)�getphase�public�unfirr�<lambda>sz&_postprocessobsolete.<locals>.<lambda>cs�|��vSrr)r )�futurecommonr{rrr�
sNs=checkheads: remote head unknown locally has local marker: %s
rsobsoletesonly(%n, (%ln+%ln))c3rrr)rr�)�ispublicrrrCrz'_postprocessobsolete.<locals>.<genexpr>c3s�|]	}�|��vVqdSrrr)�futurenonobsoleter{rrrDr�c3rrrr)�hasoutmarkerrrrEr")r,r}r%�index�get_revrr�r_rd�	functools�partial�pushingmarkerforrb�
successorsr>r~r�r)�debugrrgr
�getrevs�	frozenset�poprw�revsrfrXr*)r�r��candidate_newhsr,�ispushed�successorsmarkersr��	discarded�localcandidate�unknownheadsr�msg�obsrevs�nhr��current_branch�
branchrevs�branchnodesr�r)r�r�r�r�r�r�r{r�rr��sh
�
�����
�%r�cCs�|j}|g}t|�}|rB|��}||�rdS|�|d�}|D]!}|d}	|	s,|dp+d}	|	D]}
|
|vr>|�|
�|�|
�q.q|sdS)a�true if some markers are to be pushed for node

    We cannot just look in to the pushed obsmarkers from the pushop because
    discovery might have filtered relevant markers. In addition listing all
    markers relevant to all changesets in the pushed set would be too expensive
    (O(len(repo)))

    (note: There are cache opportunity in this function. but it would requires
    a two dimensional stack.)
    Trr�F)r�r>r�r�r~rf)rbr�rXr��stack�seen�current�markers�m�nextsr rrrr�Rs(

���r�)NFN)NFNF)F)�
__future__rr��i18nrrXrr�rrr	r
rrr
rrrr$�objectr4rtr�r�r�r�r�r�rrrr�<module>s 0
-F
�@
V#[

https://t.me/RX1948 - 2025