~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/dir_exporter.py

  • Committer: Martin Pool
  • Date: 2011-06-28 17:25:26 UTC
  • mfrom: (5999 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6001.
  • Revision ID: mbp@canonical.com-20110628172526-10cok2s17dvw7x62
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
33
33
 
34
34
    `dest` should either not exist or should be empty. If it does not exist it
35
35
    will be created holding the contents of this tree.
36
 
    
 
36
 
37
37
    :param fileobj: Is not used in this exporter
38
38
 
39
39
    :note: If the export fails, the destination directory will be
66
66
            try:
67
67
                symlink_target = tree.get_symlink_target(ie.file_id)
68
68
                os.symlink(symlink_target, fullpath)
69
 
            except OSError,e:
 
69
            except OSError, e:
70
70
                raise errors.BzrError(
71
71
                    "Failed to create symlink %r -> %r, error: %s"
72
72
                    % (fullpath, symlink_target, e))
104
104
        os.utime(fullpath, (mtime, mtime))
105
105
 
106
106
        yield
107
 
        
108
 
def dir_exporter(tree, dest, root, subdir=None, filtered=False, 
109
 
                 force_mtime=None, fileobj=None):
110
 
 
111
 
    for _ in dir_exporter_generator(tree, dest, root, subdir, filtered,
112
 
                                    force_mtime, fileobj):
113
 
        pass