~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/dir_exporter.py

  • Committer: John Arbash Meinel
  • Date: 2010-03-25 12:32:24 UTC
  • mfrom: (5115 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5116.
  • Revision ID: john@arbash-meinel.com-20100325123224-km80yrpbn7cm0jcr
Merge bzr.dev to be ready for NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import errno
20
20
import os
21
 
import StringIO
22
21
import time
23
22
 
24
23
from bzrlib import errors, osutils
30
29
from bzrlib.trace import mutter
31
30
 
32
31
 
33
 
def dir_exporter(tree, dest, root, subdir, filtered=False):
 
32
def dir_exporter(tree, dest, root, subdir, filtered=False,
 
33
                 per_file_timestamps=False):
34
34
    """Export this tree to a new directory.
35
35
 
36
36
    `dest` should either not exist or should be empty. If it does not exist it
92
92
            out.writelines(chunks)
93
93
        finally:
94
94
            out.close()
95
 
        os.utime(fullpath, (now, now))
 
95
        if per_file_timestamps:
 
96
            mtime = tree.get_file_mtime(tree.path2id(relpath), relpath)
 
97
        else:
 
98
            mtime = now
 
99
        os.utime(fullpath, (mtime, mtime))