File: //kunden/lib/python3/dist-packages/breezy/__pycache__/export.cpython-39.pyc
a
�*�^t! � @ s| d Z ddlmZ ddlZddlZddlZddlZddlmZm Z m
Z
mZ ddd�Zdd
d�Z
dd
� Zddd�Zddd�ZdS )zEExport trees to tarballs, non-controlled directories, zipfiles, etc.
� )�absolute_importN� )�archive�errors�osutils�traceFc C s� |du r|durt |�}|du r(t|�}|snt�� }t| dd�rrz| j�| �� �j}W qr tj yj Y qr0 nd}t
�d| � |dkr�| �� �& t
| ||||�D ]}q�W d � n1 s�0 Y dS | �� �� | j|||||d�} |dk�r| D ]}
ttjdtj��|
� q�nd|du�r4| D ]}
|�|
� �q nBt|d��&}| D ]}
|�|
� �qDW d � n1 �sl0 Y W d � n1 �s�0 Y dS ) an Export the given Tree to the specific destination.
:param tree: A Tree (such as RevisionTree) to export
:param dest: The destination where the files,etc should be put
:param format: The format (dir, zip, etc), if None, it will check the
extension on dest, looking for a match
:param root: The root location inside the format.
It is common practise to have zipfiles and tarballs
extract into a subdirectory, rather than into the
current working directory.
If root is None, the default root will be
selected as the destination without its
extension.
:param subdir: A starting directory within the tree. None means to export
the entire tree, and anything else should specify the relative path to
a directory to start exporting from.
:param per_file_timestamps: Whether to use the timestamp stored in the
tree rather than now(). This will do a revision lookup
for every file so will be significantly slower.
:param fileobj: Optional file object to use
N�_repositoryzexport version %r�dir)�root�subdir�force_mtime�-�buffer�wb)�guess_format�
get_root_name�time�getattrr Zget_revisionZget_revision_idZ timestampr ZNoSuchRevisionr ZmutterZ lock_read�dir_exporter_generatorr �sys�stdout�write�open)�tree�dest�formatr
r Zper_file_timestamps�fileobjr Zunused�chunks�chunk�f� r �//usr/lib/python3/dist-packages/breezy/export.py�export# sF �
�
�
r"