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

�*�^��@spddlmZddlmZmZmZmZddlmZddl	m
Z
ddlmZdd�Z
ddd�Zdd
d�Zdd�Zd
S)�)�absolute_import�)�errors�lock�merge�revision)�Branch)�gettext)�notecCsBddlm}tjd}|sdS|||||�}|D]}||�q0dS)Nr)�SwitchHookParamsZpost_switch)�branchrr�hooks)�control_dir�	to_branch�force�revision_idrr
�params�hook�r�//usr/lib/python3/dist-packages/breezy/switch.py�_run_post_switch_hooks s
rFNc
Csz|��}Wn8tjyD}z|r&|r,|�nd}WYd}~n*d}~00|sT|j��r^|��n|��zn|dur�|��}	t|	�dkr�t�	t
d���|r�|��|dur�|j}
d}n|jj}
|�
�}W|dur�|��n|dur�|��0|���*t|||�r|jnd|�Wd�n1�s"0Y|��}|�rD|��n|��z�|du�r`|�
�}|du�rr|�
�}||k�r�|�s�tt
d�|���nJ|
�|�}|j�|�}
t�||||
�|�|�|�s�tt
d�|���|�r�|��t||||�W|��n
|��0dS)a�Switch the branch associated with a checkout.

    :param control_dir: ControlDir of the checkout to change
    :param to_branch: branch that the checkout is to reference
    :param force: skip the check for local commits in a heavy checkout
    :param revision_id: revision ID to switch to.
    :param store_uncommitted: If True, store uncommitted changes in the
        branch.
    NrzAPending merges must be committed or reverted before using switch.z"Tree is up to date at revision %d.zUpdated to revision %d.)Zopen_workingtreerZNotBranchErrorr�get_bound_location�
lock_writeZlock_tree_writeZget_parent_ids�len�BzrCommandErrorr	�store_uncommitted�
repository�
last_revisionZunlock�	lock_read�_set_branch_locationr
ZrevnoZ
revision_treerZMerge3MergerZset_last_revisionZrestore_uncommittedr)rrr�quietrr�possible_transportsZtree�exZ
parent_idsZsource_repositoryZbase_revision_idZ	base_treeZtarget_treerrr�switch*sj
�

�

:



�

r#c

Cs�|��}|�|�dur(|�|d|��n`|}|��}|dur�g}z |s^t||�r^t�td���Wn:tjy�}z t�td�|j	��WYd}~n
d}~00|�
��H|�d�|j|d|d�|�|j
�|�|�����Wd�n1s�0Yn�|���p|j�|j�}	|jjj�rZ|�s>|	�|��|����rZ|j��|jj|dd�nt�td���Wd�n1�s~0YdS)	z�Set location value of a branch reference.

    :param control: ControlDir of the checkout to change
    :param to_branch: branch that the checkout is to reference
    :param force: skip the check for local commits in a heavy checkout
    NzyCannot switch as local commits found in the checkout. Commit these to the bound branch or use --force to throw them away.z_Unable to connect to current master branch %(target)s: %(error)s To switch anyway, use --force.T)Z	overwriter!�)�namez(Cannot switch a branch, only a checkout.)Zfind_branch_formatZ
get_referenceZ
set_referencer�_any_local_commitsrrr	ZBoundBranchConnectionFailure�__dict__rZset_bound_locationZpull�baseZ
set_parent�get_master_branchZ
get_parentrr�	get_graphZ
controldirZ_formatZcolocated_branches�is_ancestorrZdestroy_branchZset_branch_reference)
ZcontrolrZcurrent_branchrZ
branch_format�bZbound_branchr!�e�graphrrrrxsN�
��

�2
���
�rc	Cs�t�|���}|tjkr�|�|�}|���v|���N|��}|j�|j�}|�||�stWd�Wd�dSWd�n1s�0YWd�n1s�0YdS)z;Does this branch have any commits not in the master branch?NTF)	rZensure_nullrZ
NULL_REVISIONr)rrr*r+)Zthis_branchr!Zlast_revZother_branchZother_last_revr.rrrr&�s

�Xr&)FFNFN)F)Z
__future__rr$rrrrrrZi18nr	Ztracer
rr#rr&rrrr�<module>s
�
N
4