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__/info.cpython-39.pyc
a

�*�^N�@sHddlmZdgZddlmZddlZddlZddlmZ	m
Z
mZmZ
mZmZddlmZddlmZmZmZmZdd	lmZd3dd�ZGd
d�de�Zd4dd�Zdd�Zdd�Zdd�Zdd�Zd5dd�Z d6dd�Z!dd�Z"dd �Z#d!d"�Z$d#d$�Z%d%d&�Z&d'd(�Z'd7d*d�Z(d8d+d,�Z)d9d-d.�Z*d/d0�Z+Gd1d2�d2e
j,�Z-e-�ZdS):�)�absolute_import�show_bzrdir_info)�StringION�)�branch�
controldir�errors�hooks�osutils�urlutils)�bzrdir)�
NoWorkingTree�NotBranchError�NoRepositoryPresent�NotLocalUrl)�
find_unmerged�cCs |dkr|S|dur|SdSdS)Nr�s�)�n�baseZplrr�-/usr/lib/python3/dist-packages/breezy/info.py�plural)s
rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LocationListcCsg|_||_dS�N)�locs�	base_path)�selfrrrr�__init__4szLocationList.__init__cCsP|durdSzt�|�}Wn$tjy>|j�||f�Yn0|�||�dS)z:Add a URL to the list, converting it to a path if possibleN)rZlocal_path_from_urlZ
InvalidURLr�append�add_path)r�labelZurl�pathrrr�add_url8szLocationList.add_urlcCsZzt�|j|�}Wntjy&Yn0|dkr4d}|dkrF|�d�}|j�||f�dS)z8Add a path, converting it to a relative path if possibler�.�/N)r
�relpathrrZPathNotChild�rstriprr)rr!r"rrrr Cs
zLocationList.add_pathcs(tdd�|jD����fdd�|jD�S)Ncss|]\}}t|�VqdSr)�len��.0�l�urrr�	<genexpr>Q�z)LocationList.get_lines.<locals>.<genexpr>csg|]\}}d�||f�qS)z
  %*s: %s
rr)�Zmax_lenrr�
<listcomp>Rr.z*LocationList.get_lines.<locals>.<listcomp>)�maxr�rrr/r�	get_linesPszLocationList.get_linesN)�__name__�
__module__�__qualname__rr#r r3rrrrr2s
rc
s�i�|dur(|j}|��}|durd|}n<d}d}z |durN|��rN|���d<WntybYn0|�r|j}||kr�|�d<||kr�|��r�|�d<n|�d<||kr�t�|�\}}||kr�|d�d<n&d|vr�d||df�d<n|�d<n&|���r
|�d<n|du�r�|�d	<n~d}|du�rJ|���rJ|du�r�|�d<n@|du�r^|�d	<n,|du�rt|j�d
<n|du�r�|j�d<n||k�r�|�d<|du�r�|���r�|j�d
<gd�}	�fdd�|	D�S)N�checkout of branch�light checkout root�repository checkout root�
checkout rootr�checkout of co-located branchz
%s, branch %s�repository branch�branch root�
repository�control directory�bound to branch�shared repository)r?r8r9r:r7r;rAr>r<r=r@cs g|]}|�vr|�|f�qSrr)r*r�rrrr0�r.z(gather_location_info.<locals>.<listcomp>)�user_url�get_bound_location�get_branch_referencer�	is_sharedrZsplit_segment_parameters)
r>r�working�controlZbranch_pathZmaster_pathZworking_pathZmaster_path_base�params�orderrrBr�gather_location_infoUsh
��












rKcCsB|�d�tt���}|D]\}}|�||�q|�|���dS)z8Show known locations for working, branch and repository.z
Location:
N)�writerr
�getcwdr#�
writelinesr3)r�outfile�	path_list�nameZlocrrr�_show_location_info�s

rRc
Cs�tt���}|�d|���|�d|���|�d|���|�d|���z|�d|���Wnt	j
tjtj
fy~Yn0|S)Nz
public branchzpush branchz
parent branchz
submit branchz
stacked on)rr
rMr#Zget_public_branchZget_push_locationZ
get_parentZget_submit_branchZget_stacked_on_url�_mod_branchZUnstackableBranchFormatrZUnstackableRepositoryFormatZ
NotStacked)rrrrr�_gather_related_branches�s
�
rTcCs<t|�}t|j�dkr8|�d�|�d�|�|���dS)z(Show parent and push location of branch.r�
zRelated branches:
N)rTr(rrLrNr3)rrOrrrr�_show_related_info�s


rVcCs6|jjr2|�d�|�d�|�dt|����dS)zShow control dir information.rUzControl directory:
z         %d branches
N)�_formatZcolocated_branchesrLr(Z
list_branches)rHrOrrr�_show_control_dir_info�s

rXcCsx|�d�|�d�|r,|�d|j���|rD|�d|j���|r\|�d|j���|rt|�d|j���dS)z?Show known formats for control, working, branch and repository.rUzFormat:
z       control: %s
�  working tree: %s
�        branch: %s
�    repository: %s
N)rLrWZget_format_description)rHr>rrGrOrrr�_show_format_info�s$

����r\cCs�|r|��s$|r|��s$|r�|��r�|�d�|�d�|r\|��rJd}nd}|�d|�|r�|��rnd}nd}|�d|�|r�|��r�d}nd}|�d|�dS)	z6Show locking status of working, branch and repository.rUz
Lock status:
�lockedZunlockedrYrZr[N)Zget_physical_lock_statusrL)r>rrGrOZstatusrrr�_show_locking_info�s4����

r^cCsJ|��}|rFt||�\}}|rF|�d�|�dt|�tt|��f�dS)z(Show missing master revisions in branch.rUz.Branch is out of date: missing %d revision%s.
N)Zget_master_branchrrLr(r)rrOZmasterZlocal_extraZremote_extrarrr�_show_missing_revisions_branch�s

��r_cCs�|j}z|��\}}Wntjy,YdS0z|��d}WntyTd}Yn0|r�||kr�|�|�}||}|�d�|�d|t|�f�dS)z'Show missing revisions in working tree.NrrUz4Working tree is out of date: missing %d revision%s.
)	r�last_revision_infor�UnsupportedOperationZget_parent_ids�
IndexErrorZrevision_id_to_revnorLr)rGrOrZbranch_revnoZbranch_last_revisionZtree_last_idZtree_last_revnoZ
missing_countrrr�_show_missing_revisions_working�s 



�rcc	Cs>|��}|j|dd�}|�d�|�d�|�dt|j��|�dt|j��|�dt|j��|�dt|j��|�d	t|j��|�d
t|j	��d}}|�
�D] }|�|�r�|d7}q�|d7}q�|�d
|�|�d|�d}|��D]"\}}|j
dkr�|dkr�|d7}q�|�d|t|dd�f�dS)z%Show statistics about a working tree.T)Zwant_unchangedrUzIn the working tree:
z  %8s unchanged
z  %8d modified
z  %8d added
z  %8d removed
z  %8d renamed
z
  %8d copied
rrz  %8d unknown
z  %8d ignored
Z	directoryrz  %8d versioned %s
ZsubdirectoryZsubdirectoriesN)Z
basis_treeZchanges_fromrLr(Z	unchangedZmodifiedZaddedZremovedZrenamedZcopiedZextrasZ
is_ignoredZiter_entries_by_dir�kindr)	rGrOZbasisZdeltaZ
ignore_cntZunknown_cntr"Zdir_cnt�entryrrr�_show_working_statss0






�rfc
Csz|��\}}Wntjy(iYS0|�d�|�d�|�d|t|�f�|jj||d�}|r�|d}|�d|t|�f�|�r�|d\}}tt��|dd	�}	|�d
|	t|	�f�|�dt	�
||��|d\}}|�d
t	�
||��|S)zShow statistics about a branch.rUzBranch history:
�  %8d revision%s
)�
committersrhz  %8d committer%s
Zfirstrevi�z  %8d day%s old
z   first revision: %s
Z	latestrevz  latest revision: %s
)r`rrarLrr>�gather_stats�int�timer
Zformat_date)
r�verboserOZrevno�head�statsrhZ	timestamp�timezoneZagerrr�_show_branch_stats2s2


�
�
�rqcCs |��r|�d�|�d�dS)zShow settings of a repository.rUz<Create working tree for new branches inside the repository.
N)�make_working_treesrL)r>rOrrr�_show_repository_infoLs
rscCs�t�}d|vr,|d}|�d|t|�f�d|vrJ|�d|dd�tdD]}||||�qR|��dkr�|�d�|�d	�|�|���d
S)z#Show statistics about a repository.�	revisionsrg�sizez
  %8d KiB
ir>rrUzRepository:
N)rrLrr	�getvalue)r>rorO�frt�hookrrr�_show_repository_statsTs

ryFcCs�|durtj}z|jdd�}Wnztttfy�d}z|jdd�}WnBty�d}z|��}Wnty~d}d}Yn0|}Yn0|j	}|}Yn0|j
}|j	}|}|dur�|��z&t||||||�W|dur�|�
�n|dur�|�
�0dS)z-Output to stdout the 'info' for a_controldir.NF)Zrecommend_upgrader)rQ)�sys�stdoutZopen_workingtreer
rrZopen_branchZopen_repositoryrr>rZ	lock_read�show_component_infoZunlock)Za_controldirrmrO�treerr>ZlockablerrrrdsB�



�
�c
Csf|durtj}|durd}|dur&d}t||||�}t||||�}|�d||f�tt||||d�|�|dur|t||�|dkr�dSt|||||�t	||||�t
||�|dur�t||�|dur�t||�t
||�n|dur�t||�|du�r|dk}t|||�}	n|du�r$|��}	|du�rL|du�rL|du�rLt||�|du�rbt||	|�dS)	z0Write info about all bzrdir components to stdoutNFrT�z%s (format: %s)
)rHr>rrGr)rzr{�describe_layout�describe_formatrLrRrKrVr\r^rXr_rcrfrqrjrsry)
rHr>rrGrmrOZlayout�formatZshow_committersrorrrr|�sL��








r|cCsf|dur<|dur<z|��}Wnty.Yn0|dur<dS|durHdS|dur�|dur�|��rfd}nd}g}|��r�|�d�t|���dkr�|�d�|r�|d	d
�|�7}|S|��r�d}nd}|dur�d
}nd}|dur�|dur�d}nV|du�r|jj	|jj	k�rd}d}n0|�
�du�rD|dk�r0d}|du�r@d}nd}|dk�rV|��}d||fSdS)z�Convert a control directory layout into a user-understandable term

    Common outputs include "Standalone tree", "Repository branch" and
    "Checkout".  Uncommon outputs include "Unshared repository with trees"
    and "Empty control directory"
    NzDangling branch referencezEmpty control directoryzShared repositoryzUnshared repositoryZtreesrzcolocated branchesz with z and zRepository zStandalone r}rzbranchless treerzLightweight checkoutzBound branchZCheckoutz%s%s)rErrFrrrr(Zbranch_names�joinrZcontrol_urlrD�lower)r>rr}rHZbranch_reference�phraseZextraZindependencerrrr�sV

�


rc	Cs�g}|dur(|dur(|j|jkr(d}d}ttj���}|�tj���|D]n}tj�|�}t|t	j
�r�|rx|j|jkrxqJ|r�|�
�|jkr�qJ|r�|j|jkr�qJ|j|jjur�qJ|�|�qJt|�dkr�dS|��dd�|D�}t|�dkr�|}d�|�S)z�Determine the format of an existing control directory

    Several candidates may be found.  If so, the names are returned as a
    single string, separated by ' or '.

    If no matching candidate is found, "unnamed" is returned.
    NrZunnamedcSsg|]}tj�|�js|�qSr)r�format_registryZget_infoZhidden)r*�crrrr0s�z#describe_format.<locals>.<listcomp>z or )rC�setrr��keys�difference_update�aliasesZmake_controldir�
isinstancerZBzrDirMetaFormat1Zworkingtree_formatrWZget_branch_formatZrepository_format�	__class__rr(�sortr�)	rHr>rr}Z
candidatesZnon_aliases�keyr�Znew_candidatesrrrr��sB
��
��r�cs eZdZdZ�fdd�Z�ZS)�	InfoHookszHooks for the info command.cs$tt|��dd�|�ddd�dS)Nzbreezy.infor	r>z�Invoked when displaying the statistics for a repository. repository is called with a statistics dictionary as returned by the repository and a file-like object to write to.)r�)�superr�rZadd_hookr2�r�rrrs�zInfoHooks.__init__)r4r5r6�__doc__r�
__classcell__rrr�rr�sr�)rN)NNNN)NNNNN)NNNN)FN)NNrN)NNNN).Z
__future__r�__all__�iorrlrzrrrSrrr	Z
_mod_hooksr
rZbzrrr
rrrZmissingrr�objectrrKrRrTrVrXr\r^r_rcrfrqrsryrr|rr�ZHooksr�rrrr�<module>sJ 
	#�
F		�
�


&�
)
:+