File: //kunden/lib/python3/dist-packages/breezy/__pycache__/push.cpython-39.pyc
a
�*�^� � @ sf d Z ddlmZ ddlmZmZmZmZ m
Z
ddlmZm
Z
ddlmZ G dd� de�Zd
dd�Zd
S )zUI helper for the push command.� )�absolute_import� )�branch�
controldir�errors�revision� transport)�note�warning)�gettextc @ s e Zd ZdZdd� Zdd� ZdS )�
PushResulta% Result of a push operation.
:ivar branch_push_result: Result of a push between branches
:ivar target_branch: The target branch
:ivar stacked_on: URL of the branch on which the result is stacked
:ivar workingtree_updated: Whether or not the target workingtree was updated.
c C s d | _ d | _d | _d | _d S )N)�branch_push_result�
stacked_on�workingtree_updated�
target_branch)�self� r �-/usr/lib/python3/dist-packages/breezy/push.py�__init__, s zPushResult.__init__c C sF | j du r6| jdur(ttd�| j � qBttd�� n| j �|� dS )z1Write a human-readable description of the result.Nz+Created new stacked branch referring to %s.zCreated new branch.)r
r r r �report)r �to_filer r r r 2 s
�zPushResult.reportN)�__name__�
__module__�__qualname__�__doc__r r r r r r r # s r FNc
C s� t j|dd�}ztj�|�}
W n tjy6 d}
Y n0 |
du �rzz| j||||| |
d�}W n� tjy� t� t
d�|f ��Y nz tjy� | s�t� t
d�| ��� Y nP tjy� |s�t� t
d�| ��� Y n& tj
y� t� t
d�| ��Y n0 t� }z|�� |_W n& tjtjtjf�y8 d|_Y n0 ||_tj|_d |_|�sl|du �rN| �� du �rN| �|j� n�|du�r�td
� z|
j| |||||d�}W n� tj�y� t� t
d���Y nh tj �y
} z&t� t
d
�|jj!j"j# ��W Y d}~n0d}~0 tj$�y0 t� t
d�| ��Y n0 |j%du �rNtd|jj � |�&|� |�r�|j}|�'� �. ddl(m)} ||||j|j� W d � n1 �s�0 Y dS )a� Push a branch to a location.
:param br_from: the source branch
:param revision_id: the revision-id to push up to
:param location: the url of the destination
:param to_file: the output stream
:param verbose: if True, display more output than normal
:param overwrite: list of things to overwrite ("history", "tags")
or boolean indicating for everything
:param remember: if True, store the location as the push location for
the source branch
:param stacked_on: the url of the branch, if any, to stack on;
if set, only the revisions not in that branch are pushed
:param create_prefix: if True, create the necessary parent directories
at the destination if they don't already exist
:param use_existing_dir: if True, proceed even if the destination
directory exists without a current control directory in it
:param lossy: Allow lossy push
�write)ZpurposeN)�revision_idr �
create_prefix�use_existing_dir�no_treezKTarget directory %s already contains a .bzr directory, but it is not valid.zwTarget directory %s already exists, but does not have a .bzr directory. Supply --use-existing-dir to push there anyway.zoParent directory of %s does not exist.
You may supply --create-prefix to create all leading parent directories.z(Too many redirections trying to make %s.r z_Ignoring request for a stacked branch as repository already exists at the destination location.)�lossyzUThese branches have diverged. See "brz help diverged-branches" for more information.zIIt is not possible to losslessly push to %s. You may want to use --lossy.z�At %s you have a valid .bzr control directory, but not a branch or repository. This is an unsupported configuration. Please move the target directory out of the way and try again.FzjThis transport does not update the working tree of: %s. See 'brz help working-trees' for more information.r )�show_branch_change)*r Z
get_transportr Z
ControlDirZopen_from_transportr ZNotBranchErrorZcreate_clone_on_transportZAlreadyControlDirErrorZBzrCommandErrorr Z
FileExistsZ
NoSuchFileZTooManyRedirectionsr Zget_stacked_on_urlr �_mod_branchZUnstackableBranchFormatZUnstackableRepositoryFormatZ
NotStackedr �
_mod_revisionZ
NULL_REVISIONZ old_revidZ old_revnoZget_push_locationZset_push_location�baser
Zpush_branchZDivergedBranchesZNoRoundtrippingSupport�mappingZvcsZabbreviationZNoRepositoryPresentr r Z lock_read�logr! )Zbr_fromr �locationr �verboseZ overwriteZrememberr r r r r Zto_transportZdir_toZbr_toZpush_result�er! r r r �_show_push_branch>