/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/archive/tar.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-05-06 03:06:18 UTC
  • mfrom: (7500.1.2 trunk-merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200506030618-131sjbc876q7on66
Merge the 3.1 branch.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-merge-3.1/+merge/383481

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Export a tree to a tarball."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
from contextlib import closing
 
20
from io import BytesIO
22
21
import os
23
22
import sys
24
23
import tarfile
28
27
    osutils,
29
28
    )
30
29
from ..export import _export_iter_entries
31
 
from ..sixish import (
32
 
    BytesIO,
33
 
    )
34
30
 
35
31
 
36
32
def prepare_tarball_item(tree, root, final_path, tree_path, entry, force_mtime=None):
185
181
    except ImportError as e:
186
182
        raise errors.DependencyNotPresent('lzma', e)
187
183
 
188
 
    if sys.version_info[0] == 2:
189
 
        compressor = lzma.LZMACompressor(
190
 
            options={"format": compression_format})
191
 
    else:
192
 
        compressor = lzma.LZMACompressor(
193
 
            format={
194
 
                'xz': lzma.FORMAT_XZ,
195
 
                'raw': lzma.FORMAT_RAW,
196
 
                'alone': lzma.FORMAT_ALONE,
197
 
                }[compression_format])
 
184
    compressor = lzma.LZMACompressor(
 
185
        format={
 
186
            'xz': lzma.FORMAT_XZ,
 
187
            'raw': lzma.FORMAT_RAW,
 
188
            'alone': lzma.FORMAT_ALONE,
 
189
            }[compression_format])
198
190
 
199
191
    for chunk in tarball_generator(
200
192
            tree, root, subdir, force_mtime=force_mtime):