/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: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

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):
137
133
        buf = BytesIO()
138
134
        zipstream = gzip.GzipFile(basename, 'w', fileobj=buf,
139
135
                                  mtime=root_mtime)
140
 
        for chunk in tarball_generator(
141
 
                tree, root, subdir, force_mtime):
 
136
        for chunk in tarball_generator(tree, root, subdir, force_mtime):
142
137
            zipstream.write(chunk)
143
138
            # Yield the data that was written so far, rinse, repeat.
144
139
            yield buf.getvalue()
186
181
    except ImportError as e:
187
182
        raise errors.DependencyNotPresent('lzma', e)
188
183
 
189
 
    if sys.version_info[0] == 2:
190
 
        compressor = lzma.LZMACompressor(
191
 
            options={"format": compression_format})
192
 
    else:
193
 
        compressor = lzma.LZMACompressor(
194
 
            format={
195
 
                'xz': lzma.FORMAT_XZ,
196
 
                'raw': lzma.FORMAT_RAW,
197
 
                'alone': lzma.FORMAT_ALONE,
198
 
                }[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])
199
190
 
200
191
    for chunk in tarball_generator(
201
192
            tree, root, subdir, force_mtime=force_mtime):