File: //kunden/lib/python3/dist-packages/breezy/__pycache__/missing.cpython-39.pyc
a
�*�^# � @ sf d Z ddlmZ ddlmZmZ ddd�Zdd
d�Zdd
d�Zddd�Z dd� Z
ddd�Zdd� ZdS )zIDisplay what revisions are missing in 'other' from 'this' and vice versa.� )�absolute_import� )�errors�logNc c sZ |d u ri }| D ]D\}}}|� |�}|r4|�|�}nd }tj|||||�|�d�V qd S )N)�deltaZtags)Zget_revisionZget_revision_deltar ZLogRevision�get) � revisionsZrevision_source�verboseZrev_tag_dict�revno�rev_id�merge_depth�revr � r �0/usr/lib/python3/dist-packages/breezy/missing.py�iter_log_revisions s
�r �allFc C s� |du rd}| � � �\ |� � �4 t| ||||||d�W d � W d � S 1 sX0 Y W d � n1 sv0 Y dS )a Find revisions from each side that have not been merged.
:param local_branch: Compare the history of local_branch
:param remote_branch: versus the history of remote_branch, and determine
mainline revisions which have not been merged.
:param restrict: ('all', 'local', 'remote') If 'all', we will return the
unique revisions from both sides. If 'local', we will return None
for the remote revisions, similarly if 'remote' we will return None for
the local revisions.
:param include_merged: Show mainline revisions only if False,
all revisions otherwise.
:param backward: Show oldest versions first when True, newest versions
first when False.
:param local_revid_range: Revision-id range for filtering local_branch
revisions (lower bound, upper bound)
:param remote_revid_range: Revision-id range for filtering remote_branch
revisions (lower bound, upper bound)
:return: A list of [(revno, revision_id)] for the mainline revisions on
each side.
NF)�restrict�include_merged�backward�local_revid_range�remote_revid_range)Z lock_read�_find_unmerged)�local_branch�
remote_branchr r r r r r r r �
find_unmerged( s �r Tc
C s� | du rdS | sg S g }|}|}|| v r~|� |g�}|�|�} | sDq~|�|durXt|�nd|df� | d }|dur |d8 }q |s�|�� |S )a Enumerate the mainline revisions for these revisions.
:param ancestry: A set of revisions that we care about
:param graph: A Graph which lets us find the parents for a revision
:param tip_revno: The revision number for the tip revision
:param tip: The tip of mainline
:param backward: Show oldest versions first when True, newest versions
first when False.
:return: [(revno, revision_id, 0)] for all revisions in ancestry that
are left-hand parents from tip, or None if ancestry is None.
Nr r )Zget_parent_mapr �append�str�reverse)
�ancestry�graph� tip_revno�tipr ZmainlineZcurZ cur_revnoZ
parent_map�parentsr r r �_enumerate_mainlineJ s*
�
r# c
st � du rdS � sg S | � � }� fdd�|D �}|s<t�|�}g }|D ]*\}} }
}}|�d�tt|��| |
f� qD|S )a, Enumerate the revisions for the ancestry.
:param branch: The branch we care about
:param ancestry: A set of revisions that we care about
:param graph: A Graph which lets us find the parents for a revision
:param tip_revno: The revision number for the tip revision
:param tip: The tip of the ancsetry
:param backward: Show oldest versions first when True, newest versions
first when False.
:return: [(revno, revision_id)] for all revisions in ancestry that
are parents from tip, or None if ancestry is None.
Nc s* g | ]"\}}}}|� v rd ||||f�qS )r r )�.0Zrevid�n�d�e�r r r �
<listcomp>� s
�z*_enumerate_with_merges.<locals>.<listcomp>�.)Ziter_merge_sorted_revisionsr Zreverse_by_depthr �join�mapr )
�branchr r r r! r Zmerge_sorted_revisionsZrevline�seqr r r
Zend_of_merger r( r �_enumerate_with_mergesq s
�
r/ c s( �d u s|d u r|S � �fdd�|D �S )Nc s* g | ]"}� � |d �d �d �r|�qS )r r )Z
is_between)r$ r
�r �revid_ranger r r) � s �z _filter_revs.<locals>.<listcomp>r )r Zrevsr1 r r0 r �_filter_revs� s r2 c C sP z| � � \}}W n& tjtjfy6 d}| �� }Y n0 z|� � \} }
W n& tjtjfyn |�� }
d} Y n0 ||
kr�g g fS | j�|j�}|dkr�d}|�|
|g�}
nB|dkr�d}
|�||
g�}n&|dkr�td|f ��|� ||
�\}}
|�rt
| |||||�}t
||
|| |
|�}n t|||||�}t|
|| |
|�}t|||�t|||�fS )zSSee find_unmerged.
The branches should already be locked before entering.
NZremoteZlocalr z6param restrict not one of "all", "local", "remote": %r)
Zlast_revision_infor �UnsupportedOperationZGhostRevisionsHaveNoRevnoZ
last_revisionZ
repositoryZ get_graphZfind_unique_ancestors�
ValueErrorZfind_differencer/ r# r2 )r r r r r r r Zlocal_revnoZlocal_revision_idZremote_revnoZremote_revision_idr Zlocal_extraZremote_extra�localsZremotesr r r r � s`
���������r c s t � fdd�| D ��} | S )Nc s g | ]}� | |f�qS r r )r$ �r��history_mapr r r) � � z$sorted_revisions.<locals>.<listcomp>)�sorted)r r8 r r7 r �sorted_revisions� s r; )N)r NFNN)T)T)NN)
�__doc__Z
__future__r � r r r r r# r/ r2 r r; r r r r �<module> s
�
"
( �
# �
6