~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/dir_exporter.py

Updated directory exporter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    )
28
28
 
29
29
 
30
 
def dir_exporter(tree, dest, root, subdir=None, filtered=False, force_mtime=None):
 
30
def dir_exporter(tree, dest, root, subdir=None, filtered=False, force_mtime=None, fileobj=None):
31
31
    """Export this tree to a new directory.
32
32
 
33
33
    `dest` should either not exist or should be empty. If it does not exist it
34
34
    will be created holding the contents of this tree.
 
35
    
 
36
    :param fileobj: Is not used in this exporter
35
37
 
36
38
    :note: If the export fails, the destination directory will be
37
39
           left in an incompletely exported state: export is not transactional.
69
71
        else:
70
72
            raise errors.BzrError("don't know how to export {%s} of kind %r" %
71
73
               (ie.file_id, ie.kind))
 
74
        yield
72
75
    # The data returned here can be in any order, but we've already created all
73
76
    # the directories
74
77
    flags = os.O_CREAT | os.O_TRUNC | os.O_WRONLY | getattr(os, 'O_BINARY', 0)
92
95
        else:
93
96
            mtime = tree.get_file_mtime(tree.path2id(relpath), relpath)
94
97
        os.utime(fullpath, (mtime, mtime))
 
98
        yield