HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
Disabled: NONE
Upload Files
File: //kunden/lib/python3/dist-packages/breezy/__pycache__/status.cpython-39.pyc
a

�*�^M�
@s�ddlmZddlZddlmZmZmZm	Z	m
Z
mZddlm
Z
ddlmZmZddlmZdd
d�Zdddd	ddddd	ejf
dd
�Zdd�Zddd�Zdd�ZGdd�dej�ZGdd�de�Zdd�Ze�Ze�ded�dS)�)�absolute_importN�)�delta�hooks�log�osutils�tsort�revision)�errors)�mutter�warning)�ShelvingUnsupportedFTc
sd|r&�j|||d|d�}t�||�n:�j||||d�}�fdd�|jD�|_||||	||
d�dS)a�Display summary of changes.

    This compares two trees with regards to a list of files, and delegates
    the display to underlying elements.

    For short output, it creates an iterator on all changes, and lets a given
    reporter display these changes.

    For stantard output, it creates a delta of the changes, and forwards it
    to a callback

    :param to_file: If set, write to this file (default stdout.)
    :param old: Start tree for the comparison
    :param end: End tree for the comparison
    :param specific_files: If set, a list of filenames whose status should be
        shown.  It is an error to give a filename that is not in the working
        tree, or in the working inventory or in the basis inventory.
    :param show_short_reporter: Reporter in charge of display for short output
    :param show_long_callback: Callback in charge of display for normal output
    :param short: If True, gives short SVN-style status lines.
    :param want_unchanged: Deprecated parameter. If set, includes unchanged
        files.
    :param show_ids: If set, includes each file's id.
    :param want_unversioned: If False, only shows versioned files.
    :param classify: Add special symbols to indicate file kind.
    F)Zrequire_versioned�want_unversioned)�want_unchanged�specific_filesrcs g|]}��|jd�s|�qS)r)�
is_ignored�path)�.0Zchange��new��//usr/lib/python3/dist-packages/breezy/status.py�
<listcomp>Os�z"report_changes.<locals>.<listcomp>)�show_idsZshow_unchanged�classifyN)Ziter_changes�
_mod_delta�report_changesZchanges_fromZunversioned)
�to_file�oldrrZshow_short_reporter�show_long_callback�shortrrrrZchangesrrrrr&s
���rcs||durtj}|����Nd}|durN|��|j��kr@td�|����}n�t|�dk�rz|d�|j�}Wn4t	j
y�}
zt	�t|
���WYd}
~
n
d}
~
00t|�dk�r|dj
du�rz|d�|j��d}Wn6t	j
�y}
zt	�t|
���WYd}
~
n
d}
~
00n|�|����"������tdD]"}|t|�||||||d���q:t||��\}}|}tj|�j|	d	�}t||�|||
||||	d
�
|du�r�fdd�|D�}t|�dk�r�|�s�|�d
�d}nd}|D]}|�d||f��q���}|du�r,|j�|ddd�d}t|�dk�rJ|�sJ|�d�|D],}|�r^d}nd}|�d||��f��qN|�r�|�s�|�d�|D](}|�r�d}nd}|�d||f��q�|�r�|�r�t�|||d�|�r�t	�|��tdD]"}|t|�||||||d���q�Wd�n1�s.0YWd�n1�sN0YWd�n1�sn0YdS)a�Display summary of changes.

    By default this compares the working tree to a previous revision.
    If the revision argument is given, summarizes changes between the
    working tree and another, or between two revisions.

    The result is written out as Unicode and to_file should be able
    to encode that.

    If showing the status of a working tree, extra information is included
    about unknown files, conflicts, and pending merges.

    :param specific_files: If set, a list of filenames whose status should be
        shown.  It is an error to give a filename that is not in the working
        tree, or in the working inventory or in the basis inventory.
    :param show_ids: If set, includes each file's id.
    :param to_file: If set, write to this file (default stdout.)
    :param show_pending: If set, write pending merges.
    :param revision: If None, compare latest revision with working tree
        If not None, it must be a RevisionSpec list.
        If one revision, compare with working tree.
        If two revisions, show status between first and second.
    :param short: If True, gives short SVN-style status lines.
    :param verbose: If True, show all merged revisions, not just
        the merge tips
    :param versioned: If True, only shows versioned files.
    :param classify: Add special symbols to indicate file kind.
    :param show_long_callback: A callback: message = show_long_callback(to_file, delta,
        show_ids, show_unchanged, indent, filter), only used with the long output
    NTz-working tree is out of date, run 'brz update'rrF�
pre_status)r)Zoutput_fileZunversioned_filterr)r rrrcsg|]}��|�r|�qSr)r)rZspecificrrrr�s
�z$show_tree_status.<locals>.<listcomp>z	ignored:
� zI  z%s %s
)Z
ignore_missesZrecursezconflicts:
zC  z
nonexistent:
zX  )�verbose�post_status)�sys�stdoutZ	lock_read�
last_revision�branchrZ
basis_tree�lenZas_treer
�NoSuchRevisionZBzrCommandError�str�specr�StatusHookParams�_filter_nonexistentrZ_ChangeReporterrr�write�	conflictsZselect_conflictsZdescribe�show_pending_mergesZPathsDoNotExist)ZwtrrrZshow_pendingr	r r#�	versionedrrZnew_is_working_treer�e�hookZnonexistentsrZreporterZ
ignored_files�prefixZignored_filer0Zconflict�nonexistentrrr�show_tree_statusWs�)
$&�
��
�

�

��


�r7csNi}�D]0}||vrg||<q�fdd�||D�||<qt�||�}|��S)a�Get an iterator which will return the revisions in merge sorted order.

    This will build up a list of all nodes, such that only nodes in the list
    are referenced. It then uses MergeSorter to return them in 'merge-sorted'
    order.

    :param revision_ids: A set of revision_ids
    :param parent_map: The parent information for each node. Revisions which
        are considered ghosts should not be present in the map.
    :return: iterator from MergeSorter.iter_topo_order()
    csg|]}|�vr|�qSrr)r�p��revision_idsrrr�s�z)_get_sorted_revisions.<locals>.<listcomp>)rZMergeSorterZiter_topo_order)Ztip_revisionr:Z
parent_mapZparent_graphZrevision_idZsorterrr9r�_get_sorted_revisions�s
r;c
s�|��}t|�dkrdSt����dur0�d�|r>d}d}nd}d}���fdd	�}|dd�}|j}	|d
}
|s�|r���d�n
��d�|	j��}|
g}t�	���|D�],}
z|	j�
|
�}Wn@tj�y��|d
|
�
d�d�|�|
�Yq�Yn0|||�|�sq�|�|
|�}|�|
�|�tj�t|	j�|��}t|
||	j�|��}t|�\}}}}||
k�r�td||
f��|D]N\}}}}||}|du�rȈ�|d
|�
d�d��q�||||��q�q�dS)z8Write out a display of pending merges in a working tree.�NrzP   zP.   z  z    cs>�dur�}n�t|�}�jd|||d�}��|d�dS)N)r5�
)r)Z
log_stringr/)�revr5�widthZlog_message�Z
log_formatterZ
term_widthrrr�show_log_messages
z-show_pending_merges.<locals>.show_log_messagerzpending merges:
z8pending merge tips: (use -v to see all merge revisions)
z(ghost) zutf-8r=z;Somehow we misunderstood how iter_topo_order works %s != %s)Zget_parent_idsr)rZterminal_widthr(r/Z
repositoryZ	get_graphrZLineLogFormatterZget_revisionr
r*�decode�appendZfind_unique_ancestors�discard�
_mod_revisionZ
NULL_REVISION�dictZiter_revisionsr;Zget_parent_map�next�AssertionError)rrr r#�parentsZfirst_prefixZ
sub_prefixrA�pendingr(r'ZgraphZother_revisions�merger>Zmerge_extraZ	revisionsZrev_id_iteratorZnum�firstZdepthZeomZ	sub_mergerr@rr1�st




��




�
�

��r1cs^td|�|s|gfS|�|�}��|�}�fdd�|D���fdd�|D�}t|�t��fS)a�Convert orig_paths to two sorted lists and return them.

    The first is orig_paths paths minus the items in the second list,
    and the second list is paths that are not in either inventory or
    tree (they don't qualify if they exist in the tree's inventory, or
    if they exist in the tree but are not versioned.)

    If either of the two lists is empty, return it as an empty list.

    This can be used by operations such as brz status that can accept
    unknown or ignored files.
    zcheck paths: %rcsg|]}��|�s|�qSr)Zhas_filename�rr)�new_treerrrZ�z'_filter_nonexistent.<locals>.<listcomp>csg|]}|�vr|�qSrrrM)r6rrr[rO)rZfilter_unversioned_files�sorted)Z
orig_paths�old_treerN�sZ	remainingr)rNr6rr.Hs


r.c@seZdZdZdd�ZdS)�StatusHooksz�A dictionary mapping hook name to a list of callables for status hooks.

    e.g. ['post_status'] Is the list of items to be called when the
    status command has finished printing the status.
    cCs0tj�|dd�|�ddd�|�ddd�dS)	z�Create the default hooks.

        These are all empty initially, because by default nothing should get
        notified.
        z
breezy.statusrr$aKCalled with argument StatusHookParams after Bazaar has displayed the status. StatusHookParams has the attributes (old_tree, new_tree, to_file, versioned, show_ids, short, verbose). The last four arguments correspond to the command line options specified by the user for the status command. to_file is the output stream for writing.)r<�r!aGCalled with argument StatusHookParams before Bazaar displays the status. StatusHookParams has the attributes (old_tree, new_tree, to_file, versioned, show_ids, short, verbose). The last four arguments correspond to the command line options specified by the user for the status command. to_file is the output stream for writing.N)�
_mod_hooks�Hooks�__init__Zadd_hook��selfrrrrWjs�	�zStatusHooks.__init__N)�__name__�
__module__�__qualname__�__doc__rWrrrrrScsrSc@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
r-avObject holding parameters passed to post_status hooks.

    :ivar old_tree: Start tree (basis tree) for comparison.
    :ivar new_tree: Working tree.
    :ivar to_file: If set, write to this file.
    :ivar versioned: Show only versioned files.
    :ivar show_ids: Show internal object ids.
    :ivar short: Use short status indicators.
    :ivar verbose: Verbose flag.
    Nc		Cs4||_||_||_||_||_||_||_||_dS)a�Create a group of post_status hook parameters.

        :param old_tree: Start tree (basis tree) for comparison.
        :param new_tree: Working tree.
        :param to_file: If set, write to this file.
        :param versioned: Show only versioned files.
        :param show_ids: Show internal object ids.
        :param short: Use short status indicators.
        :param verbose: Verbose flag.
        :param specific_files: If set, a list of filenames whose status should be
            shown.  It is an error to give a filename that is not in the
            working tree, or in the working inventory or in the basis inventory.
        N)rQrNrr2rr r#r)	rYrQrNrr2rr r#rrrrrW�szStatusHookParams.__init__cCs|j|jkS)N)�__dict__)rY�otherrrr�__eq__�szStatusHookParams.__eq__c
Cs.d|jj|j|j|j|j|j|j|j|j	f	S)Nz$<%s(%s, %s, %s, %s, %s, %s, %s, %s)>)
�	__class__rZrQrNrr2rr r#rrXrrr�__repr__�s
�zStatusHookParams.__repr__)N)rZr[r\r]rWr`rbrrrrr-�s
�
r-cCs�|jr
dSt|jdd�}|dur$dSz
|�}WntyHtd�YnL0|��}|r�d}d}t|�dkrp|}n|}|j�|t|��|j�d�dS)z\post_status hook to display a summary of shelves.

    :param params: StatusHookParams.
    N�get_shelf_managerz7shelving not supported by tree, not displaying shelves.z%d shelf exists. z%d shelves exist. rz%See "brz shelve --list" for details.
)	r�getattrrNr
rZactive_shelvesr)rr/)�paramsrcZmanagerZshelvesZsingularZpluralZfmtrrr�_show_shelve_summary�s$
rfr$z
brz status)FFFFT)FF)Z
__future__rr%�rrrrUrrrr	rEr
ZtracerrZworkingtreer
rZreport_deltar7r;r1r.rVrS�objectr-rfZinstall_named_hookrrrr�<module>s< 	�
2�


N".�