~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/dir_exporter.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-07-21 07:51:22 UTC
  • mfrom: (6034.1.1 filter-tree)
  • Revision ID: pqm@pqm.ubuntu.com-20110721075122-l9d0n4d3pk4p3hfg
(mbp) add ContentFilterTree decorator and use it for cat and export (Martin
 Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from bzrlib import errors, osutils
23
23
from bzrlib.export import _export_iter_entries
24
 
from bzrlib.filters import (
25
 
    ContentFilterContext,
26
 
    filtered_output_bytes,
27
 
    )
28
 
 
29
 
 
30
 
def dir_exporter_generator(tree, dest, root, subdir=None, filtered=False,
 
24
 
 
25
 
 
26
def dir_exporter_generator(tree, dest, root, subdir=None,
31
27
                           force_mtime=None, fileobj=None):
32
28
    """Return a generator that exports this tree to a new directory.
33
29
 
79
75
    # the directories
80
76
    flags = os.O_CREAT | os.O_TRUNC | os.O_WRONLY | getattr(os, 'O_BINARY', 0)
81
77
    for (relpath, executable), chunks in tree.iter_files_bytes(to_fetch):
82
 
        if filtered:
83
 
            filters = tree._content_filter_stack(relpath)
84
 
            context = ContentFilterContext(relpath, tree, ie)
85
 
            chunks = filtered_output_bytes(chunks, filters, context)
86
78
        fullpath = osutils.pathjoin(dest, relpath)
87
79
        # We set the mode and let the umask sort out the file info
88
80
        mode = 0666