~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/tar_exporter.py

Adjusted .tar.lzma

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
        ball.close()
179
179
 
180
180
 
181
 
def plain_tar_exporter(tree, dest, root, subdir, compression=None,
182
 
                       filtered=False, force_mtime=None):
 
181
def plain_tar_exporter(tree, dest, root, subdir, compression=None, filtered=False, force_mtime=None,
 
182
                       per_file_timestamps=False, fileobj=None):
183
183
    """Export this tree to a new tar file.
184
184
 
185
185
    `dest` will be created holding the contents of this tree; if it
186
186
    already exists, it will be clobbered, like with "tar -c".
187
187
    """
188
 
    if dest == '-':
 
188
    if fileobj is not None:
 
189
        stream = fileobj  
 
190
    elif dest == '-':
189
191
        stream = sys.stdout
190
192
    else:
191
193
        stream = open(dest, 'wb')
196
198
        ball.close()
197
199
 
198
200
 
199
 
def tar_xz_exporter(tree, dest, root, subdir, filtered=False,
200
 
                    force_mtime=None):
 
201
def tar_xz_exporter(tree, dest, root, subdir, filtered=False, force_mtime=None,
 
202
                    per_file_timestamps=False, fileobj=None):
201
203
    return tar_lzma_exporter(tree, dest, root, subdir, filtered=filtered,
202
 
        force_mtime=force_mtime, compression_format="xz")
203
 
 
204
 
 
205
 
def tar_lzma_exporter(tree, dest, root, subdir, filtered=False, force_mtime=None, compression_format="alone"):
 
204
        force_mtime=force_mtime,per_file_timestamps=per_file_timestamps, fileobj=fileobj, compression_format="xz")
 
205
 
 
206
 
 
207
def tar_lzma_exporter(tree, dest, root, subdir, filtered=False, force_mtime=None,
 
208
                      per_file_timestamps=False, fileobj=None, compression_format="alone"):
206
209
    """Export this tree to a new .tar.lzma file.
207
210
 
208
211
    `dest` will be created holding the contents of this tree; if it
211
214
    if dest == '-':
212
215
        raise errors.BzrError("Writing to stdout not supported for .tar.lzma")
213
216
 
 
217
    if fileobj is not None:
 
218
        raise errors.BzrError("Writing to fileobject not supported for .tar.lzma")
 
219
        
214
220
    try:
215
221
        import lzma
216
222
    except ImportError, e: