/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/builtins.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-19 01:32:32 UTC
  • mto: (6968.4.2 git-archive)
  • mto: This revision was merged to the branch mainline in revision 6972.
  • Revision ID: jelmer@jelmer.uk-20180519013232-rzci4jv8orowcve0
Fix tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3289
3289
      =================       =========================
3290
3290
    """
3291
3291
    encoding = 'exact'
 
3292
    encoding_type = 'exact'
3292
3293
    takes_args = ['dest', 'branch_or_subdir?']
3293
3294
    takes_options = ['directory',
3294
3295
        Option('format',
3326
3327
                    gettext("--uncommitted requires a working tree"))
3327
3328
            export_tree = tree
3328
3329
        else:
3329
 
            export_tree = _get_one_revision_tree('export', revision, branch=b, tree=tree)
 
3330
            export_tree = _get_one_revision_tree(
 
3331
                    'export', revision, branch=b,
 
3332
                    tree=tree)
3330
3333
 
3331
3334
        if filters:
3332
3335
            from breezy.filter_tree import ContentFilterTree
3333
 
            export_tree = ContentFilterTree(export_tree, export_tree._content_filter_stack)
 
3336
            export_tree = ContentFilterTree(
 
3337
                    export_tree, export_tree._content_filter_stack)
3334
3338
 
3335
3339
        # Try asking the tree first..
3336
3340
        if not per_file_timestamps:
 
3341
            chunks = export_tree.archive(
 
3342
                dest, format, root=root, subdir=subdir)
3337
3343
            try:
3338
 
                with open(dest, 'wb') as outf:
3339
 
                    outf.writelines(export_tree.archive(
3340
 
                        dest, format, root=root, subdir=subdir))
 
3344
                if dest == '-':
 
3345
                    self.outf.writelines(chunks)
 
3346
                else:
 
3347
                    with open(dest + '.tmp', 'wb') as outf:
 
3348
                        outf.writelines(chunks)
 
3349
                    os.rename(dest + '.tmp', dest)
3341
3350
            except errors.NoSuchExportFormat:
3342
3351
                pass
3343
3352
            else: