/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 bzrlib/export/dir_exporter.py

1st cut merge of bzr.dev r3907

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import StringIO
23
23
 
24
24
from bzrlib import errors, osutils
 
25
from bzrlib.export import _export_iter_entries
25
26
from bzrlib.filters import (
26
27
    ContentFilterContext,
27
28
    filtered_output_bytes,
29
30
from bzrlib.trace import mutter
30
31
 
31
32
 
32
 
def dir_exporter(tree, dest, root, filtered=False):
 
33
def dir_exporter(tree, dest, root, subdir, filtered=False):
33
34
    """Export this tree to a new directory.
34
35
 
35
36
    `dest` should not exist, and will be created holding the
41
42
    :note: If the export fails, the destination directory will be
42
43
           left in a half-assed state.
43
44
    """
 
45
    mutter('export version %r', tree)
44
46
    os.mkdir(dest)
45
 
    mutter('export version %r', tree)
46
 
    inv = tree.inventory
47
 
    entries = inv.iter_entries()
48
 
    entries.next() # skip root
49
 
    for dp, ie in entries:
50
 
        # The .bzr* namespace is reserved for "magic" files like
51
 
        # .bzrignore and .bzrrules - do not export these
52
 
        if dp.startswith(".bzr"):
53
 
            continue
54
 
        
 
47
    for dp, ie in _export_iter_entries(tree, subdir):
55
48
        fullpath = osutils.pathjoin(dest, dp)
56
49
        if ie.kind == "file":
57
50
            if filtered: